Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

568 lines
20 KiB

  1. /*
  2. * Microsoft Confidential
  3. * Copyright (C) Microsoft Corporation 1992,1993
  4. * All Rights Reserved.
  5. *
  6. *
  7. * PIFMGRP.H
  8. * Private PIFMGR include file
  9. *
  10. * History:
  11. * Created 31-Jul-1992 3:45pm by Jeff Parsons
  12. */
  13. #include <windows.h> // declares NULL the "right" way (as 0)
  14. #ifndef RC_INVOKED
  15. #include <malloc.h> // misc. C runtime goop
  16. #include <memory.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #ifndef WINNT
  20. #include <setupx.h> // for Ip (inf) API
  21. #endif
  22. #include <prsht.h> // for PropertySheet(), pulls in shell.h
  23. #include <commdlg.h> // for GetOpenFileName(), GetSaveFileName()
  24. #endif /* RC_INVOKED */
  25. #include <commctrl.h> // for TRACKBAR_CLASS, HOTKEY_CLASS...
  26. #include <regstr.h>
  27. #include <winerror.h>
  28. #ifndef RC_INVOKED
  29. #define PIF_PROPERTY_SHEETS
  30. #include <pif.h>
  31. #endif /* RC_INVOKED */
  32. /*
  33. * Supported app extension types
  34. */
  35. #define APPTYPE_UNKNOWN -1
  36. #define APPTYPE_EXE 0
  37. #define APPTYPE_COM 1
  38. #define APPTYPE_BAT 2
  39. #define APPTYPE_CMD 3
  40. #define APPTYPE_PIF 4
  41. #define MAX_APP_TYPES 5
  42. /*
  43. * Bitmap IDs
  44. */
  45. #define DX_TTBITMAP 20
  46. #define DY_TTBITMAP 12
  47. #define MAX_STRING_SIZE 256
  48. #ifndef RC_INVOKED
  49. /*
  50. * Some typedefs mysteriously missing from windows.h
  51. */
  52. typedef const WORD * LPCWORD;
  53. typedef const VOID *LPCVOID;// pointer to const void
  54. #define PROP_SIG 0x504A
  55. /* Property flags
  56. *
  57. * Anyone can set PROP_DIRTY, but only Lock/UnlockPIFData should set
  58. * PROP_DIRTYLOCK. The latter is set/cleared when the last lock is about
  59. * to be unlocked (ie, when cLocks is going back to zero). At that time,
  60. * if PROP_DIRTY is set, then we also set PROP_DIRTYLOCK and skip the
  61. * call to GlobalUnlock; on the other hand, if PROP_DIRTY is clear, then
  62. * we also clear PROP_DIRTYLOCK and allow the call to GlobalUnlock to proceed.
  63. *
  64. * A consequence is that you must NEVER clear PROP_DIRTY while the data
  65. * is unlocked, unless you plan on checking PROP_DIRTYLOCK yourself and
  66. * relinquishing that outstanding lock, if it exists. It is much preferable
  67. * to either clear PROP_DIRTY while the data is locked (so that UnlockPIFData
  68. * will take care of it), or to simply call FlushPIFData with fDiscard set
  69. * appropriately.
  70. */
  71. #define PROP_DIRTY 0x0001 // memory block modified and unwritten
  72. #define PROP_DIRTYLOCK 0x0002 // memory block locked
  73. #define PROP_TRUNCATE 0x0004 // memory block shrunk, truncate on write
  74. #define PROP_RAWIO 0x0008 // direct access to memory block allowed
  75. #define PROP_NOTIFY 0x0010 // property sheet made changes
  76. #define PROP_IGNOREPIF 0x0020 // entry in [pif] exists, ignore any PIF
  77. #define PROP_SKIPPIF 0x0040 // don't try to open a PIF (various reasons)
  78. #define PROP_NOCREATEPIF 0x0080 // we opened the PIF once, so don't recreate
  79. #define PROP_REGEN 0x0100 // GetPIFData call in progress
  80. #define PROP_DONTWRITE 0x0200 // someone else has flushed, don't write
  81. #define PROP_REALMODE 0x0400 // disable non-real-mode props
  82. #define PROP_PIFDIR 0x0800 // PIF found in PIF directory
  83. #define PROP_NOPIF 0x1000 // no PIF found
  84. #define PROP_DEFAULTPIF 0x2000 // default PIF found
  85. #define PROP_INFSETTINGS 0x4000 // INF settings found
  86. #define PROP_INHIBITPIF 0x8000 // INF or OpenProperties requested no PIF
  87. #if (PROP_NOPIF != PRGINIT_NOPIF || PROP_DEFAULTPIF != PRGINIT_DEFAULTPIF || PROP_INFSETTINGS != PRGINIT_INFSETTINGS || PROP_INHIBITPIF != PRGINIT_INHIBITPIF)
  88. #error Bit mismatch in PIF constants
  89. #endif
  90. #ifndef OF_READ
  91. #define MAXPATHNAME 260
  92. #else
  93. #define MAXPATHNAME 260 // (sizeof(OFSTRUCTEX)-9)
  94. #endif
  95. typedef struct PIFOFSTRUCT {
  96. DWORD nErrCode;
  97. TCHAR szPathName[MAXPATHNAME];
  98. } PIFOFSTRUCT, *LPPIFOFSTRUCT;
  99. typedef struct PROPLINK { /* pl */
  100. struct PROPLINK *ppl; //
  101. struct PROPLINK *pplNext; //
  102. struct PROPLINK *pplPrev; //
  103. int iSig; // proplink signature
  104. int flProp; // proplink flags (PROP_*)
  105. int cbPIFData; // size of PIF data
  106. int cLocks; // # of locks, if any
  107. LPPIFDATA lpPIFData; // pointer (non-NULL if PIF data locked)
  108. int ckbMem; // memory setting from WIN.INI (-1 if none)
  109. int iSheetUsage; // number of prop sheets using this struct
  110. LPCTSTR lpszTitle; // title to use in dialogs (NULL if none)
  111. HWND hwndNotify; // who to notify when PROP_NOTIFY has been set
  112. UINT uMsgNotify; // message number to use when notifying, 0 if none
  113. DWORD hVM; // handle to associated VM (if any)
  114. HWND hwndTty; // handle to associated window (if any)
  115. LPTSTR lpArgs; // pointer to args for this instance (if any)
  116. HANDLE hPIF; // handle to PIF file
  117. PIFOFSTRUCT ofPIF; // hacked OpenFile() structure for PIF
  118. UINT iFileName; // offset of base filename in szPathName
  119. UINT iFileExt; // offset of base filename extension in szPathName
  120. TCHAR szPathName[MAXPATHNAME];
  121. } PROPLINK;
  122. typedef PROPLINK *PPROPLINK;
  123. #ifndef ROUNDUNITS
  124. #define ROUNDUNITS(a,b) (((a)+(b)-1)/(b))
  125. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  126. #endif
  127. #define INI_WORDS (5 + ROUNDUNITS(sizeof (WINDOWPLACEMENT), 2))
  128. #define MAX_INT_LENGTH 10 // "-32767" + separator + 3 chars of slop
  129. #define MAX_INI_WORDS 20
  130. #define MAX_INI_BUFFER (MAX_INT_LENGTH * MAX_INI_WORDS)
  131. #define ISVALIDINI(w) ((w)==1 || (w)==3 || (w)==5 || (w) == INI_WORDS)
  132. /* Owing to the fact that wFlags was originally defined as a combination
  133. * of font and window settings, WIN_SAVESETTINGS and WIN_TOOLBAR should be
  134. * considered reserved FNT flags. It is problematic to assert that no
  135. * one ever use those FNT flags for anything, but I will at least try to
  136. * catch them sticking those bits into FNT_DEFAULT....
  137. */
  138. #if (FNT_DEFAULT & (WIN_SAVESETTINGS | WIN_TOOLBAR))
  139. #error Reserved FNT flags incorrectly used
  140. #endif
  141. #if (FNT_TTFONTS - FNT_RASTERFONTS) != (FNT_BOTHFONTS - FNT_TTFONTS)
  142. #error Incorrect bit value(s) for FNT_RASTERFONTS and/or FNT_TTFONTS
  143. #endif
  144. typedef struct INIINFO {
  145. WORD wFlags; // This order is the same as written to file
  146. WORD wFontWidth; // We assume that if zero width, nothing to init
  147. WORD wFontHeight;
  148. WORD wWinWidth;
  149. WORD wWinHeight;
  150. WINDOWPLACEMENT wp; // If normalposition.left & right are zero,
  151. BYTE szInvokedName[128+1];// there is no position to restore
  152. } INIINFO;
  153. typedef INIINFO *PINIINFO;
  154. typedef INIINFO *LPINIINFO;
  155. /*
  156. * Types/structures for GetINIData
  157. */
  158. #define INIDATA_DECINT 0x0001
  159. #define INIDATA_FIXEDPOINT 0x0002
  160. #define INIDATA_BOOLEAN 0x0004
  161. #define INIDATA_INVERT 0x1000
  162. typedef struct _INIDATA {
  163. const TCHAR *pszSection;
  164. const TCHAR *pszKey;
  165. void *pValue;
  166. int iFlags;
  167. int iMask;
  168. } INIDATA, *PINIDATA;
  169. /*
  170. * Structure used to define bits associated with control IDs
  171. */
  172. typedef struct _BITINFO { /* binf */
  173. WORD id; /* Control ID (must be edit control) */
  174. BYTE bBit; /* bit #; if bit 7 set, sense of bit reversed */
  175. };
  176. typedef const struct _BITINFO BINF;
  177. typedef const struct _BITINFO *PBINF;
  178. #define Z2(m) ((m)&1?0:(m)&2?1:2)
  179. #define Z4(m) ((m)&3?Z2(m):Z2((m)>>2)+2)
  180. #define Z8(m) ((m)&15?Z4(m):Z4((m)>>4)+4)
  181. #define Z16(m) ((m)&255?Z8(m):Z8((m)>>8)+8)
  182. #define Z32(m) ((m)&65535?Z16(m):Z16((m)>>16)+16)
  183. #define BITNUM(m) Z32(m)
  184. /*
  185. * Warning: There is some evil overloading of these switches because
  186. * there isn't enough time to do it `right'.
  187. *
  188. * VINF_AUTO means that a value of zero means `Auto' and a nonzero
  189. * value represents itself.
  190. *
  191. * VINF_AUTOMINMAX means that there are really two fields, a min and a
  192. * max. If the two values are equal to each other, then the field value
  193. * is the common value, possibly zero for `None'. Otherwise, the min
  194. * is iMin and the max is iMax, which indicates `Auto'.
  195. */
  196. #define VINF_NONE 0x00
  197. #define VINF_AUTO 0x01 /* integer field supports AUTO only */
  198. #define VINF_AUTOMINMAX 0x02 /* integer field supports AUTO and NONE */
  199. /*
  200. * Structure used to validate integer parameters in property sheets.
  201. */
  202. typedef struct _VALIDATIONINFO {/* vinf */
  203. BYTE off; /* offset of integer in property structure */
  204. BYTE fbOpt; /* See VINF_* constants */
  205. WORD id; /* Control ID (must be edit control) */
  206. INT iMin; /* Minimum acceptable value */
  207. INT iMax; /* Maximum acceptable value */
  208. WORD idMsg; /* Message resource for error message */
  209. };
  210. typedef const struct _VALIDATIONINFO VINF;
  211. typedef const struct _VALIDATIONINFO *PVINF;
  212. #define NUM_TICKS 20 /* Number of tick marks in slider control */
  213. /*
  214. * Macro to dispatch Help subsystem messages.
  215. */
  216. #define HELP_CASES(rgdwHelp) \
  217. case WM_HELP: /* F1 or title-bar help button */ \
  218. OnWmHelp(lParam, &rgdwHelp[0]); \
  219. break; \
  220. \
  221. case WM_CONTEXTMENU: /* right mouse click */ \
  222. OnWmContextMenu(wParam, &rgdwHelp[0]); \
  223. break;
  224. /*
  225. * Internal function prototypes
  226. */
  227. /* XLATOFF */
  228. #ifndef DEBUG
  229. #define ASSERTFAIL()
  230. #define ASSERTTRUE(exp)
  231. #define ASSERTFALSE(exp)
  232. #define VERIFYTRUE(exp) (exp)
  233. #define VERIFYFALSE(exp) (exp)
  234. #else
  235. #define ASSERTFAIL() ASSERT(FALSE)
  236. #define ASSERTTRUE(exp) ASSERT((exp))
  237. #define ASSERTFALSE(exp) ASSERT((!(exp)))
  238. #define VERIFYTRUE(exp) ASSERT((exp))
  239. #define VERIFYFALSE(exp) ASSERT((!(exp)))
  240. #endif
  241. /*
  242. * CTASSERT -- Assert at compile-time, standalone.
  243. * CTASSERTF -- Assert at compile-time, inside a function.
  244. */
  245. #define CTASSERTF(c) switch (0) case 0: case c:
  246. #define CTASSERTPP(c,l) \
  247. static INLINE void Assert##l(void) { CTASSERTF(c); }
  248. #define CTASSERTP(c,l) CTASSERTPP(c,l)
  249. #define CTASSERT(c) CTASSERTP(c,__LINE__)
  250. /*
  251. * FunctionName allows us to make something happen on entry to every function.
  252. *
  253. * If SWAP_TUNING is defined, then the function name is squirted out the first
  254. * time it is called. This is used to decide which functions should go into
  255. * the PRELOAD segment and which in the RARE segment.
  256. */
  257. #ifndef DEBUG
  258. #define FunctionName(f)
  259. #else
  260. #ifdef SWAP_TUNING
  261. #define FunctionName(f) \
  262. static fSeen = 0; if (!fSeen) { OutputDebugString(#f TEXT("\r\n")); fSeen = 1; }
  263. #else
  264. #define FunctionName(f)
  265. #endif
  266. #endif
  267. #ifdef WINNT
  268. #ifdef UNICODE
  269. // NT and UNICODE
  270. #define NUM_DATA_PTRS 4
  271. #else
  272. // NT, but not UNICODE
  273. #define NUM_DATA_PTRS 3
  274. #endif
  275. #else
  276. // Neither NT or UNICODE
  277. #define NUM_DATA_PTRS 2
  278. #endif
  279. #define LP386_INDEX 0
  280. #define LPENH_INDEX 1
  281. #define LPNT31_INDEX 2
  282. #define LPNT40_INDEX 3
  283. #ifdef WINNT
  284. // Macro definitions that handle codepages
  285. //
  286. #define CP_US (UINT)437
  287. #define CP_JPN (UINT)932
  288. #define CP_WANSUNG (UINT)949
  289. #define CP_TC (UINT)950
  290. #define CP_SC (UINT)936
  291. #define IsBilingualCP(cp) ((cp)==CP_JPN || (cp)==CP_WANSUNG)
  292. #define IsFarEastCP(cp) ((cp)==CP_JPN || (cp)==CP_WANSUNG || (cp)==CP_TC || (cp)==CP_SC)
  293. #endif
  294. typedef LPVOID * DATAPTRS;
  295. typedef int (*GETSETFN)(HANDLE hProps, LPCSTR lpszGroup, LPVOID lpProps, int cbProps, UINT flOpt);
  296. typedef int (*DATAGETFN)(PPROPLINK ppl, DATAPTRS aDataPtrs, LPVOID lpData, int cbData, UINT flOpt);
  297. typedef int (*DATASETFN)(PPROPLINK ppl, DATAPTRS aDataPtrs, LPCVOID lpData, int cbData, UINT flOpt);
  298. /*
  299. * Constant strings used in multiple places.
  300. *
  301. * The null string is so popular, we keep a copy of it in each segment.
  302. */
  303. extern const TCHAR c_szNULL[]; // Null string in nonresident code segment
  304. extern const TCHAR r_szNULL[]; // Null string in resident code segment
  305. extern TCHAR g_szNone[16];
  306. extern TCHAR g_szAuto[16];
  307. extern const TCHAR szNoPIFSection[];
  308. extern CHAR szSTDHDRSIG[];
  309. extern CHAR szW286HDRSIG30[];
  310. extern CHAR szW386HDRSIG30[];
  311. extern CHAR szWENHHDRSIG40[];
  312. extern CHAR szCONFIGHDRSIG40[];
  313. extern CHAR szAUTOEXECHDRSIG40[];
  314. extern const TCHAR szDOSAPPDefault[];
  315. extern const TCHAR szDOSAPPINI[];
  316. extern const TCHAR szDOSAPPSection[];
  317. // In alphabetical order, for sanity's sake.
  318. extern const TCHAR sz386EnhSection[];
  319. extern const TCHAR szDisplay[];
  320. extern const TCHAR szTTDispDimKey[];
  321. extern const TCHAR szTTInitialSizes[];
  322. extern const TCHAR szNonWinSection[];
  323. extern const TCHAR szPP4[];
  324. extern const TCHAR szSystemINI[];
  325. extern const TCHAR szWOAFontKey[];
  326. extern const TCHAR szWOADBCSFontKey[];
  327. extern const TCHAR szZero[];
  328. // these are initialized at LoadGlobalFontData()
  329. extern TCHAR szTTCacheSection[2][32];
  330. extern CHAR szTTFaceName[2][LF_FACESIZE];
  331. #ifdef CUSTOMIZABLE_HEURISTICS
  332. extern const TCHAR szTTHeuristics[];
  333. extern const TCHAR szTTNonAspectMin[];
  334. #endif
  335. extern const TCHAR *apszAppType[];
  336. // pifdll.asm
  337. void GetSetExtendedData(DWORD hVM, WORD wGroup, LPCTSTR lpszGroup, LPVOID lpProps);
  338. WORD GetVxDVersion(WORD wVxdId);
  339. BOOL IsBufferDifferent(LPVOID lpv1, LPVOID lpv2, UINT cb);
  340. #ifndef WIN32
  341. void BZero(LPVOID lpvBuf, UINT cb);
  342. #else
  343. #define BZero(lpvBuf,cb) ZeroMemory(lpvBuf,(DWORD)cb)
  344. #endif
  345. #ifndef WINNT
  346. WORD flEmsSupport(void);
  347. #endif
  348. // pifmgr.c
  349. void GetINIData(void);
  350. void InitProperties(PPROPLINK ppl, BOOL fLocked);
  351. PPROPLINK ValidPropHandle(HANDLE hProps);
  352. int ResizePIFData(PPROPLINK ppl, int cbResize);
  353. BOOL GetPIFData(PPROPLINK ppl, BOOL fLocked);
  354. BOOL FlushPIFData(PPROPLINK ppl, BOOL fDiscard);
  355. LPWENHPIF40 AddEnhancedData(PPROPLINK ppl, LPW386PIF30 lp386);
  356. BOOL AddGroupData(PPROPLINK ppl, LPCSTR lpszGroup, LPVOID lpGroup, int cbGroup);
  357. BOOL RemoveGroupData(PPROPLINK ppl, LPCSTR lpszGroup);
  358. LPVOID GetGroupData(PPROPLINK ppl, LPCSTR lpszGroup, LPINT lpcbGroup, LPPIFEXTHDR *lplpph);
  359. // pifdat.c
  360. int GetPrgData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPPRG lpPrg, int cb, UINT flOpt);
  361. int SetPrgData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPPRG lpPrg, int cb, UINT flOpt);
  362. int GetTskData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPTSK lpTsk, int cb, UINT flOpt);
  363. int SetTskData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPTSK lpTsk, int cb, UINT flOpt);
  364. int GetVidData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPVID lpVid, int cb, UINT flOpt);
  365. int SetVidData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPVID lpVid, int cb, UINT flOpt);
  366. int GetMemData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPMEM lpMem, int cb, UINT flOpt);
  367. int SetMemData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPMEM lpMem, int cb, UINT flOpt);
  368. int GetKbdData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPKBD lpKbd, int cb, UINT flOpt);
  369. int SetKbdData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPKBD lpKbd, int cb, UINT flOpt);
  370. int GetMseData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPMSE lpMse, int cb, UINT flOpt);
  371. int SetMseData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPMSE lpMse, int cb, UINT flOpt);
  372. int GetSndData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPSND lpSnd, int cb, UINT flOpt);
  373. int SetSndData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPSND lpSnd, int cb, UINT flOpt);
  374. int GetFntData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPFNT lpFnt, int cb, UINT flOpt);
  375. int SetFntData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPFNT lpFnt, int cb, UINT flOpt);
  376. int GetWinData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPWIN lpWin, int cb, UINT flOpt);
  377. int SetWinData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPWIN lpWin, int cb, UINT flOpt);
  378. int GetEnvData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPENV lpEnv, int cb, UINT flOpt);
  379. int SetEnvData(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPENV lpEnv, int cb, UINT flOpt);
  380. #ifdef WINNT
  381. int GetNt31Data(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPNT31 lpNt31, int cb, UINT flOpt);
  382. int SetNt31Data(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPNT31 lpNt31, int cb, UINT flOpt);
  383. #endif
  384. #ifdef UNICODE
  385. int GetNt40Data(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPNT40 lpNt40, int cb, UINT flOpt);
  386. int SetNt40Data(PPROPLINK ppl, DATAPTRS aDataPtrs, LPPROPNT40 lpNt40, int cb, UINT flOpt);
  387. #endif
  388. void CopyIniWordsToFntData(LPPROPFNT lpFnt, LPINIINFO lpii, int cWords);
  389. void CopyIniWordsToWinData(LPPROPWIN lpWin, LPINIINFO lpii, int cWords);
  390. // These could be defined as WINAPI if we ever wanted to export them back to WinOldAp
  391. WORD GetIniWords(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPWORD lpwBuf, WORD cwBuf, LPCTSTR lpszFilename);
  392. WORD ParseIniWords(LPCTSTR lpsz, LPWORD lpwBuf, WORD cwBuf, LPTSTR *lplpsz);
  393. BOOL WriteIniWords(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCWORD lpwBuf, WORD cwBuf, LPCTSTR lpszFilename);
  394. // piflib.c
  395. BOOL LoadGlobalEditData(void);
  396. void FreeGlobalEditData(void);
  397. void InitRealModeFlag(PPROPLINK ppl);
  398. // pifprg.c
  399. BOOL_PTR CALLBACK DlgPrgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  400. #ifdef UNICODE
  401. HICON LoadPIFIcon(LPPROPPRG lpprg, LPPROPNT40 lpnt40);
  402. #else
  403. HICON LoadPIFIcon(LPPROPPRG lpprg);
  404. #endif
  405. // pifvid.c
  406. BOOL_PTR CALLBACK DlgVidProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  407. // pifmem.c
  408. BOOL_PTR CALLBACK DlgMemProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  409. // pifmsc.c
  410. BOOL_PTR CALLBACK DlgMscProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  411. // pifhot.c
  412. typedef struct PIFKEY { /* PIF_Ky */
  413. WORD Scan; /* Scan code in lower byte */
  414. WORD ShVal; /* Shift state */
  415. WORD ShMsk; /* Mask for shift states interested in */
  416. BYTE Val; /* Enhanced key stuff */
  417. BYTE Pad[9]; /* Pad PIF struc to MAXHKYINFOSIZE bytes */
  418. } PIFKEY;
  419. typedef UNALIGNED PIFKEY *LPPIFKEY;
  420. typedef const UNALIGNED PIFKEY *LPCPIFKEY;
  421. WORD HotKeyWindowsFromOem(LPCPIFKEY lppifkey);
  422. void HotKeyOemFromWindows(LPPIFKEY lppifkey, WORD wHotKey);
  423. // pifsub.c
  424. void lstrcpypadA(LPSTR lpszDst, LPCSTR lpszSrc, int cbMax);
  425. int lstrcpyncharA(LPSTR lpszDst, LPCSTR lpszSrc, int cbMax, CHAR ch);
  426. int lstrskipcharA(LPCSTR lpszSrc, CHAR ch);
  427. int lstrskiptocharA(LPCSTR lpszSrc, CHAR ch);
  428. int lstrcpyfnameA(PSTR pszDest, size_t cchDest, PCSTR pszSrc);
  429. int lstrunquotefnameA(LPSTR lpszDst, LPCSTR lpszSrc, int cbMax, BOOL fShort);
  430. int lstrskipfnameA(LPCSTR lpszSrc);
  431. int cdecl Warning(HWND hwnd, WORD id, WORD type, ...);
  432. int MemoryWarning(HWND hwnd);
  433. LPTSTR LoadStringSafe(HWND hwnd, UINT id, LPTSTR lpsz, int cbsz);
  434. void SetDlgBits(HWND hDlg, PBINF pbinf, UINT cbinf, WORD wFlags);
  435. void GetDlgBits(HWND hDlg, PBINF pbinf, UINT cbinf, LPWORD lpwFlags);
  436. void SetDlgInts(HWND hDlg, PVINF pvinf, UINT cvinf, LPVOID lp);
  437. void AddDlgIntValues(HWND hDlg, int id, int iMax);
  438. void GetDlgInts(HWND hDlg, PVINF pvinf, int cvinf, LPVOID lp);
  439. BOOL ValidateDlgInts(HWND hDlg, PVINF pvinf, int cvinf);
  440. void LimitDlgItemText(HWND hDlg, int iCtl, UINT uiLimit);
  441. void SetDlgItemPct(HWND hDlg, int iCtl, UINT uiPct);
  442. UINT GetDlgItemPct(HWND hDlg, int iCtl);
  443. void SetDlgItemPosRange(HWND hDlg, int iCtl, UINT uiPos, DWORD dwRange);
  444. UINT GetDlgItemPos(HWND hDlg, int iCtl);
  445. BOOL AdjustRealModeControls(PPROPLINK ppl, HWND hDlg);
  446. void BrowsePrograms(HWND hDlg, UINT uiCtl, UINT uiCwd);
  447. void OnWmHelp(LPARAM lparam, const DWORD *pdwHelp);
  448. void OnWmContextMenu(WPARAM wparam, const DWORD *pdwHelp);
  449. #ifdef UNICODE
  450. void PifMgr_WCtoMBPath( LPWSTR lpUniPath, LPSTR lpAnsiPath, UINT cchBuf );
  451. #endif
  452. void PifMgrDLL_Init();
  453. #ifdef DEBUG
  454. void DebugASSERT(TCHAR *pszModule, int line);
  455. #endif
  456. extern TCHAR *pszNoMemory;
  457. extern CHAR szRasterFaceName[];
  458. #endif /* RC_INVOKED */