pifmgrp.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 20k
Category:

Windows Kernel

Development Platform:

Visual C++

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