Source code of Windows XP (NT5)
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.

290 lines
6.1 KiB

  1. #ifndef _PRIV_H_
  2. #define _PRIV_H_
  3. #define STRICT
  4. /* disable "non-standard extension" warnings in our code
  5. */
  6. #ifndef RC_INVOKED
  7. #pragma warning(disable:4001)
  8. #endif
  9. // Define these before including dldecl.h
  10. #define DL_OLEAUT32
  11. #define DL_OLE32
  12. #include "dldecl.h" // dldecl.h needs to go before everything else
  13. #define CC_INTERNAL // This is for some internal prshtp.h stuff
  14. #ifndef WINNT
  15. #undef ShellMessageBoxA
  16. #define ShellMessageBoxA ShellMessageBox
  17. #undef SHGetNewLinkInfo
  18. #define SHGetNewLinkInfoA SHGetNewLinkInfo
  19. #endif
  20. // copied from old
  21. #ifdef WINNT
  22. //
  23. // need Wx86 definitions from ntpsapi.h
  24. //
  25. #include <nt.h>
  26. #include <ntrtl.h>
  27. #include <nturtl.h>
  28. #endif
  29. #include <windows.h>
  30. // VariantInit is a trivial function -- avoid using OleAut32, use intrinsic
  31. // version of memset for a good size win
  32. // (it's here so that atl (in stdafx.h) gets it too)
  33. #define VariantInit(p) memset(p, 0, sizeof(*(p)))
  34. #ifdef __cplusplus
  35. // (stdafx.h must come before windowsx.h)
  36. #include "stdafx.h" // ATL header file for this component
  37. #endif
  38. #include <windowsx.h>
  39. #include <ole2.h> // to get IStream for image.c
  40. #include "..\inc\port32.h"
  41. #include <winerror.h>
  42. #include <winnlsp.h>
  43. #include <docobj.h>
  44. #include <lm.h>
  45. #include <shlobj.h>
  46. #define _SHLWAPI_
  47. #include <shlwapi.h>
  48. #include <ccstock.h>
  49. #include <crtfree.h>
  50. #define DISALLOW_Assert
  51. #include <debug.h>
  52. #include <regstr.h>
  53. #define _WIN32_MSI 110
  54. #include <msi.h> // Darwin APIs
  55. #include <msiquery.h> // Darwin Datebase Query APIs
  56. #include <wininet.h> // For INTERNET_MAX_URL_LENGTH
  57. #include "shappmgrp.h"
  58. #include "shellp.h"
  59. #include <appmgmt.h>
  60. #include "apithk.h"
  61. #include "awthunk.h"
  62. #include <uxtheme.h>
  63. #include <shfusion.h>
  64. //
  65. // Local includes
  66. //
  67. //
  68. // Wrappers so our Unicode calls work on Win95
  69. //
  70. #ifdef WINNT
  71. #define StrCmpIW lstrcmpiW
  72. #else
  73. #define lstrcmpW StrCmpW
  74. #define lstrcmpiW StrCmpIW
  75. #define lstrcatW StrCatW
  76. #define lstrcpyW StrCpyW
  77. #define lstrcpynW StrCpyNW
  78. #endif
  79. // This DLL needs to run correctly on Win95. CharNextW is only stubbed
  80. // on Win95, so we need to do this...
  81. #define CharNextW(x) ((x) + 1)
  82. #define CharPrevW(y, x) ((x) - 1)
  83. // This is a TCHAR export on win9x and NT4, and since we need to link to
  84. // the old shell32.nt4/shell32.w95 we #undef it here
  85. #undef ILCreateFromPath
  86. STDAPI_(LPITEMIDLIST) ILCreateFromPath(LPCTSTR pszPath);
  87. //
  88. // Trace/dump/break flags specific to shell32.
  89. // (Standard flags defined in debug.h)
  90. //
  91. // Trace flags
  92. #define TF_OBJLIFE 0x00000010 // Object lifetime
  93. #define TF_DSO 0x00000020 // Data source object
  94. #define TF_FINDAPP 0x00000040 // Find app heuristic stuff
  95. #define TF_INSTAPP 0x00000080
  96. #define TF_SLOWFIND 0x00000100
  97. #define TF_TASKS 0x00000200
  98. #define TF_CTL 0x00000400
  99. #define TF_VERBOSEDSO 0x00000800 // squirts html and stuff
  100. // Break flags
  101. #define BF_ONDLLLOAD 0x00000010
  102. // Prototype flags
  103. #define PF_NEWADDREMOVE 0x00000001
  104. #define PF_NOSECURITYCHECK 0x00000002
  105. #define PF_FAKEUNINSTALL 0x00000004
  106. // Debug functions
  107. #ifdef DEBUG
  108. #define TraceAddRef(classname, cref) TraceMsg(TF_OBJLIFE, #classname "(%#08lx) %d>", (DWORD_PTR)this, cref)
  109. #define TraceRelease(classname, cref) TraceMsg(TF_OBJLIFE, #classname "(%#08lx) %d<", (DWORD_PTR)this, cref)
  110. #else
  111. #define TraceAddRef(classname, cref)
  112. #define TraceRelease(classname, cref)
  113. #endif
  114. #define MAX_URL_STRING INTERNET_MAX_URL_LENGTH
  115. #define RECTWIDTH(rc) ((rc).right-(rc).left)
  116. #define RECTHEIGHT(rc) ((rc).bottom-(rc).top)
  117. STDAPI_(void) DllAddRef(void);
  118. STDAPI_(void) DllRelease(void);
  119. //
  120. // Info string MAX length
  121. //
  122. #define MAX_INFO_STRING MAX_PATH * 3
  123. //
  124. // Global variables
  125. //
  126. EXTERN_C HINSTANCE g_hinst;
  127. #define HINST_THISDLL g_hinst
  128. #ifdef WINNT
  129. #define g_bRunOnNT TRUE
  130. #ifdef DOWNLEVEL
  131. #define g_bRunOnNT5 FALSE
  132. #else
  133. #define g_bRunOnNT5 TRUE
  134. #endif
  135. #else
  136. #define g_bRunOnNT FALSE
  137. #define g_bRunOnNT5 FALSE
  138. #endif
  139. EXTERN_C BOOL g_bRunOnIE4Shell;
  140. #ifdef DOWNLEVEL
  141. #pragma message("DOWNLEVEL is defined")
  142. #undef PathBuildRoot
  143. #undef PathCombine
  144. #undef PathFileExists
  145. #undef PathIsDirectory
  146. #undef PathIsUNC
  147. #undef PathRemoveArgs
  148. #undef PathFindExtension
  149. STDAPI_(LPTSTR) PathFindExtension(LPCTSTR pszPath);
  150. #undef PathFindFileName
  151. STDAPI_(LPTSTR) PathFindFileName(LPCTSTR pPath);
  152. #undef PathIsRoot
  153. STDAPI_(BOOL) PathIsRoot(LPCTSTR pPath);
  154. #undef PathQuoteSpaces
  155. STDAPI_(void) PathQuoteSpaces(LPTSTR lpsz);
  156. #undef PathRemoveBlanks
  157. STDAPI_(void) PathRemoveBlanks(LPTSTR lpszString);
  158. #undef PathRemoveFileSpec
  159. STDAPI_(BOOL) PathRemoveFileSpec(LPTSTR pFile);
  160. #undef PathGetArgs
  161. STDAPI_(LPTSTR) PathGetArgs(LPCTSTR pszPath);
  162. #undef PathStripToRoot
  163. STDAPI_(BOOL) PathStripToRoot(LPTSTR szRoot);
  164. #undef PathUnquoteSpaces
  165. STDAPI_(void) PathUnquoteSpaces(LPTSTR lpsz);
  166. #undef SHAnsiToUnicode
  167. STDAPI_(int)
  168. SHAnsiToUnicode(LPCSTR pszSrc, LPWSTR pwszDst, int cwchBuf);
  169. #undef SHDeleteKey
  170. #ifdef UNICODE
  171. STDAPI_(DWORD)
  172. SHDeleteKeyW(
  173. IN HKEY hkey,
  174. IN LPCWSTR pwszSubKey);
  175. #define SHDeleteKey SHDeleteKeyW
  176. #else
  177. STDAPI_(DWORD)
  178. SHDeleteKeyA(
  179. IN HKEY hkey,
  180. IN LPCSTR pszSubKey);
  181. #define SHDeleteKey SHDeleteKeyA
  182. #endif
  183. #undef SHQueryValueEx
  184. #undef SHQueryValueExA
  185. #undef SHQueryValueExW
  186. STDAPI_(DWORD)
  187. SHQueryValueExW(
  188. IN HKEY hkey,
  189. IN LPCWSTR pwszValue,
  190. IN LPDWORD lpReserved,
  191. OUT LPDWORD pdwType,
  192. OUT LPVOID pvData,
  193. IN OUT LPDWORD pcbData);
  194. STDAPI_(DWORD)
  195. SHQueryValueExA(
  196. IN HKEY hkey,
  197. IN LPCSTR pszValue,
  198. IN LPDWORD lpReserved,
  199. OUT LPDWORD pdwType,
  200. OUT LPVOID pvData,
  201. IN OUT LPDWORD pcbData);
  202. #ifdef UNICODE
  203. #define SHQueryValueEx SHQueryValueExW
  204. #else
  205. #define SHQueryValueEx SHQueryValueExA
  206. #endif
  207. #undef SHStrDup
  208. #ifdef UNICODE
  209. STDAPI SHStrDupW(LPCWSTR psz, WCHAR **ppwsz);
  210. #define SHStrDup SHStrDupW
  211. #else
  212. STDAPI SHStrDupA(LPCSTR psz, WCHAR **ppwsz);
  213. #define SHStrDup SHStrDupA
  214. #endif
  215. #define OVERRIDE_SHLWAPI_PATH_FUNCTIONS
  216. #include "shsemip.h"
  217. #endif //DOWNLEVEL
  218. #endif // _PRIV_H_