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

Windows Kernel

Development Platform:

Visual C++

  1. #ifndef _PRIV_H_
  2. #define _PRIV_H_
  3. #ifdef STRICT
  4. #undef STRICT
  5. #endif
  6. #define STRICT
  7. /* disable "non-standard extension" warnings in our code
  8.  */
  9. #ifndef RC_INVOKED
  10. #pragma warning(disable:4001)
  11. #endif
  12. #ifdef WIN32
  13. #define _SHLWAPI_
  14. #define _OLE32_                     // we delay-load OLE
  15. #define _INC_OLE
  16. #define CONST_VTABLE
  17. #endif
  18. #define _COMCTL32_                  // for DECLSPEC_IMPORT
  19. #define _NTSYSTEM_                  // for DECLSPEC_IMPORT ntdll
  20. #define _SETUPAPI_                  // for DECLSPEC_IMPORT setupapi
  21. #define CC_INTERNAL
  22. // Conditional for apithk.c
  23. #ifndef _WIN32_WINDOWS
  24. #define _WIN32_WINDOWS      0x0400
  25. #endif
  26. #ifndef WINVER
  27. #define WINVER              0x0400
  28. #endif
  29. #include <windows.h>
  30. #include <windowsx.h>
  31. #include <ole2.h>               // to get IStream for image.c
  32. #include <port32.h>
  33. #define DISALLOW_Assert
  34. #include <debug.h>
  35. #include <winerror.h>
  36. #include <winnlsp.h>
  37. #include <docobj.h>
  38. #define WANT_SHLWAPI_POSTSPLIT
  39. #include <shlobj.h>
  40. #include <shlwapi.h>
  41. #include <ccstock.h>
  42. #include <crtfree.h>
  43. #include <regstr.h>
  44. #include <vdate.h>
  45. #include <setupapi.h>
  46. #ifdef TRY_NtPowerInformation
  47. //
  48. //  We would like to include <ntpoapi.h>, but ntpoapi.h redefines things
  49. //  in a manner incompatible with <winnt.h>...  It also relies on <nt.h>,
  50. //  which also redefines things in a manner incompatible with <winnt.h>.
  51. //  So we have to fake its brains out.  Yuck.
  52. //
  53. typedef LONG NTSTATUS;
  54. #undef ES_SYSTEM_REQUIRED
  55. #undef ES_DISPLAY_REQUIRED
  56. #undef ES_USER_PRESENT
  57. #undef ES_CONTINUOUS
  58. #define LT_DONT_CARE        NTPOAPI_LT_DONT_CARE
  59. #define LT_LOWEST_LATENCY   NTPOAPI_LT_LOWEST_LATENCY
  60. #define LATENCY_TIME        NTPOAPI_LATENCY_TIME
  61. #if defined(_M_IX86)
  62. #define FASTCALL _fastcall
  63. #else
  64. #define FASTCALL
  65. #endif
  66. #include <ntpoapi.h>
  67. #endif
  68. // ---------------------------------------------------------------------------
  69. //
  70. // Local includes
  71. //
  72. #include "thunk.h"
  73. //
  74. // Wrappers so our Unicode calls work on Win95
  75. //
  76. #define lstrcmpW            StrCmpW
  77. #define lstrcmpiW           StrCmpIW
  78. #define lstrcatW            StrCatW
  79. #define lstrcpyW            StrCpyW
  80. #define lstrcpynW           StrCpyNW
  81. #define CharLowerW          CharLowerWrapW
  82. #define CharNextW           CharNextWrapW
  83. #define CharPrevW           CharPrevWrapW
  84. //
  85. // This is a very important piece of performance hack for non-DBCS codepage.
  86. //
  87. #ifdef UNICODE
  88. // NB - These are already macros in Win32 land.
  89. #ifdef WIN32
  90. #undef AnsiNext
  91. #undef AnsiPrev
  92. #endif
  93. #define AnsiNext(x) ((x)+1)
  94. #define AnsiPrev(y,x) ((x)-1)
  95. #define IsDBCSLeadByte(x) ((x), FALSE)
  96. #endif // DBCS
  97. #define CH_PREFIX TEXT('&')
  98. //
  99. // Trace/dump/break flags specific to shell32.
  100. //   (Standard flags defined in debug.h)
  101. //
  102. // Trace flags
  103. #define TF_IDLIST           0x00000010      // IDList stuff
  104. #define TF_PATH             0x00000020      // path stuff
  105. #define TF_URL              0x00000040      // URL stuff
  106. #define TF_REGINST          0x00000080      // REGINST stuff
  107. #define TF_RIFUNC           0x00000100      // REGINST func tracing
  108. #define TF_REGQINST         0x00000200      // RegQueryInstall tracing
  109. #define TF_DBLIST           0x00000400      // SHDataBlockList tracing
  110. #define RECTWIDTH(rc)   ((rc).right-(rc).left)
  111. #define RECTHEIGHT(rc)  ((rc).bottom-(rc).top)
  112. // -1 means use CP_ACP, but do *not* verify
  113. // kind of a hack, but it's DEBUG and leaves 99% of callers unchanged
  114. #define CP_ACPNOVALIDATE    ((UINT)-1)
  115. //
  116. // Global variables
  117. //
  118. EXTERN_C HINSTANCE g_hinst;
  119. #define HINST_THISDLL   g_hinst
  120. EXTERN_C BOOL g_bRunningOnNT;
  121. EXTERN_C BOOL g_bRunningOnNT5OrHigher;
  122. EXTERN_C BOOL g_bRunningOnMemphis;
  123. // Icon mirroring
  124. EXTERN_C HDC g_hdc;
  125. EXTERN_C HDC g_hdcMask;
  126. EXTERN_C BOOL g_bMirroredOS;
  127. EXTERN_C DWORD g_tlsThreadRef;
  128. EXTERN_C DWORD_PTR _SHGetFileInfoA(LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA FAR  *psfi, UINT cbFileInfo, UINT uFlags);
  129. EXTERN_C DWORD_PTR _SHGetFileInfoW(LPCWSTR pwzPath, DWORD dwFileAttributes, SHFILEINFOW FAR  *psfi, UINT cbFileInfo, UINT uFlags);
  130. EXTERN_C UINT  _DragQueryFileA(HDROP hDrop, UINT iFile, LPSTR lpszFile, UINT cch);
  131. EXTERN_C UINT  _DragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch);
  132. EXTERN_C UINT _SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options);
  133. EXTERN_C int _IsNetDrive(int iDrive);
  134. EXTERN_C int _DriveType(int iDrive);
  135. EXTERN_C int _RealDriveType(int iDrive, BOOL fOKToHitNet);
  136. EXTERN_C LPITEMIDLIST _SHBrowseForFolderW(LPBROWSEINFOW pbiW);
  137. EXTERN_C LPITEMIDLIST _SHBrowseForFolderA(LPBROWSEINFOA pbiA);
  138. EXTERN_C BOOL _SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pwzPath);
  139. EXTERN_C BOOL _SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath);
  140. EXTERN_C BOOL _SHGetNewLinkInfoW(LPCWSTR pszpdlLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags);
  141. EXTERN_C BOOL _SHGetNewLinkInfoA(LPCSTR pszpdlLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, UINT uFlags);
  142. EXTERN_C HRESULT _SHDefExtractIconW(LPCWSTR pszFile, int nIconIndex, UINT  uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
  143. EXTERN_C HRESULT _SHDefExtractIconA(LPCSTR pszFile, int nIconIndex, UINT  uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
  144. EXTERN_C HICON _ExtractIconA(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex);
  145. EXTERN_C HICON _ExtractIconW(HINSTANCE hInst, LPCWSTR lpszExeFileName, UINT nIconIndex);
  146. EXTERN_C BOOL _GetSaveFileNameA(LPOPENFILENAMEA lpofn);
  147. EXTERN_C BOOL _GetSaveFileNameW(LPOPENFILENAMEW lpofn);
  148. EXTERN_C BOOL _GetOpenFileNameA(LPOPENFILENAMEA lpofn);
  149. EXTERN_C BOOL _GetOpenFileNameW(LPOPENFILENAMEW lpofn);
  150. EXTERN_C int  _Shell_GetCachedImageIndexW(LPVOID pszIconPath, int iIconIndex, UINT uIconFlags);
  151. EXTERN_C void _SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
  152. EXTERN_C void _SHFlushSFCache();
  153. EXTERN_C HRESULT _SHGetInstanceExplorer(IUnknown **ppunk);
  154. EXTERN_C BOOL _PrintDlgA(LPPRINTDLGA lppd);
  155. EXTERN_C BOOL _PrintDlgW(LPPRINTDLGW lppd);
  156. EXTERN_C BOOL _PageSetupDlgA(LPPAGESETUPDLGA lppsd);
  157. EXTERN_C BOOL _PageSetupDlgW(LPPAGESETUPDLGW lppsd);
  158. EXTERN_C BOOL _ShellExecuteExW(LPSHELLEXECUTEINFOW pExecInfoW);
  159. EXTERN_C BOOL _ShellExecuteExA(LPSHELLEXECUTEINFOA pExecInfoA);
  160. EXTERN_C int _SHFileOperationW(LPSHFILEOPSTRUCTW pFileOpW);
  161. EXTERN_C int _SHFileOperationA(LPSHFILEOPSTRUCTA pFileOpA);
  162. EXTERN_C UINT _ExtractIconExW(LPCWSTR pwzFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  163. EXTERN_C UINT _ExtractIconExA(LPCSTR pszFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  164. EXTERN_C BOOL  _PlaySoundA(LPCSTR pszSound, HMODULE hMod, DWORD fFlags);
  165. EXTERN_C BOOL  _PlaySoundW(LPCWSTR pszSound, HMODULE hMod, DWORD fFlags);
  166. EXTERN_C HRESULT _CLSIDFromProgID(LPCOLESTR lpszProgID, LPCLSID lpclsid);
  167. EXTERN_C int DrawTextFLW(HDC hdc, LPCWSTR lpString, int nCount, LPRECT lpRect, UINT uFormat);
  168. EXTERN_C int DrawTextExFLW(HDC hdc, LPWSTR pwzText, int cchText, LPRECT lprc, UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams);
  169. EXTERN_C BOOL GetTextExtentPointFLW(HDC hdc, LPCWSTR lpString, int nCount, LPSIZE lpSize);
  170. EXTERN_C int ExtTextOutFLW(HDC hdc, int xp, int yp, UINT eto, CONST RECT *lprect, LPCWSTR lpwch, UINT cLen, CONST INT *lpdxp);
  171. #undef ExpandEnvironmentStrings
  172. #define ExpandEnvironmentStrings #error "Use SHExpandEnvironmentStrings instead"
  173. #endif // _PRIV_H_