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.

985 lines
41 KiB

  1. // --------------------------------------------------------------------------------
  2. // Msoert.h
  3. // Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  4. // --------------------------------------------------------------------------------
  5. // --------------------------------------------------------------------------------
  6. // Debug Crap
  7. // --------------------------------------------------------------------------------
  8. #include "msoedbg.h"
  9. // --------------------------------------------------------------------------------
  10. // GUIDS
  11. // --------------------------------------------------------------------------------
  12. #if !defined(__MSOERT_H) || defined(INITGUID)
  13. // {220D5CC1-853A-11d0-84BC-00C04FD43F8F}
  14. #ifdef ENABLE_RULES
  15. DEFINE_GUID(PST_IDENT_TYPE_GUID, 0x220d5cc3, 0x853a, 0x11d0, 0x84, 0xbc, 0x0, 0xc0, 0x4f, 0xd4, 0x3f, 0x8f);
  16. #elif defined(N_TEST)
  17. DEFINE_GUID(PST_IDENT_TYPE_GUID, 0x220d5cc2, 0x853a, 0x11d0, 0x84, 0xbc, 0x0, 0xc0, 0x4f, 0xd4, 0x3f, 0x8f);
  18. #else
  19. DEFINE_GUID(PST_IDENT_TYPE_GUID, 0x220d5cc1, 0x853a, 0x11d0, 0x84, 0xbc, 0x0, 0xc0, 0x4f, 0xd4, 0x3f, 0x8f);
  20. #endif
  21. // {417E2D75-84BD-11d0-84BB-00C04FD43F8F}
  22. #ifdef ENABLE_RULES
  23. DEFINE_GUID(PST_IMNACCT_SUBTYPE_GUID, 0x417e2d77, 0x84bd, 0x11d0, 0x84, 0xbb, 0x0, 0xc0, 0x4f, 0xd4, 0x3f, 0x8f);
  24. #elif defined(N_TEST)
  25. DEFINE_GUID(PST_IMNACCT_SUBTYPE_GUID, 0x417e2d76, 0x84bd, 0x11d0, 0x84, 0xbb, 0x0, 0xc0, 0x4f, 0xd4, 0x3f, 0x8f);
  26. #else
  27. DEFINE_GUID(PST_IMNACCT_SUBTYPE_GUID, 0x417e2d75, 0x84bd, 0x11d0, 0x84, 0xbb, 0x0, 0xc0, 0x4f, 0xd4, 0x3f, 0x8f);
  28. #endif
  29. // {6ADF2E20-8803-11d0-84BF-00C04FD43F8F}
  30. DEFINE_GUID(PST_CERTS_SUBTYPE_GUID, 0x6adf2e20, 0x8803, 0x11d0, 0x84, 0xbf, 0x0, 0xc0, 0x4f, 0xd4, 0x3f, 0x8f);
  31. #endif // !defined(__MSOERT_H) || defined(INITGUID)
  32. // --------------------------------------------------------------------------------
  33. // Include the rest of the stuff
  34. // --------------------------------------------------------------------------------
  35. #ifndef __MSOERT_H
  36. #define __MSOERT_H
  37. // --------------------------------------------------------------------------------
  38. // Define API decoration for direct importing of DLL references.
  39. // --------------------------------------------------------------------------------
  40. // OESTDAPI - Things exported from msoert2.dll (no debug exports)
  41. #if !defined(_MSOERT_)
  42. #define OESTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  43. #else // _MSOERT_
  44. #define OESTDAPI_(type) STDAPI_(type)
  45. #endif // !_MSOERT_
  46. #define DLLEXPORT __declspec(dllexport)
  47. #ifndef NOFLAGS
  48. #define NOFLAGS 0
  49. #endif
  50. // --------------------------------------------------------------------------------
  51. // IN OUT OPTIONS Definitions
  52. // --------------------------------------------------------------------------------
  53. #ifndef OUT
  54. #define OUT
  55. #endif
  56. #ifndef IN
  57. #define IN
  58. #endif
  59. #ifndef IN_OUT
  60. #define IN_OUT
  61. #endif
  62. #ifndef IN_OPT
  63. #define IN_OPT
  64. #endif
  65. #ifndef OUT_OPT
  66. #define OUT_OPT
  67. #endif
  68. #ifndef IN_OUT_OPT
  69. #define IN_OUT_OPT
  70. #endif
  71. //WIn64 macros
  72. #ifdef _WIN64
  73. #if defined (_AMD64_) || defined (_IA64_)
  74. #define ALIGNTYPE LARGE_INTEGER
  75. #else
  76. #define ALIGNTYPE DWORD
  77. #endif
  78. #define ALIGN ((ULONG) (sizeof(ALIGNTYPE) - 1))
  79. #define LcbAlignLcb(lcb) (((lcb) + ALIGN) & ~ALIGN)
  80. #define PbAlignPb(pb) ((LPBYTE) ((((DWORD) (pb)) + ALIGN) & ~ALIGN))
  81. #define MYALIGN ((POINTER_64_INT) (sizeof(ALIGNTYPE) - 1))
  82. #define MyPbAlignPb(pb) ((LPBYTE) ((((POINTER_64_INT) (pb)) + MYALIGN) & ~MYALIGN))
  83. #else //!WIN64
  84. #define LcbAlignLcb(lcb) (lcb)
  85. #define PbAlignPb(pb) (pb)
  86. #define MyPbAlignPb(pb) (pb)
  87. #endif
  88. // --------------------------------------------------------------------------------
  89. // CRLF Definitions
  90. // --------------------------------------------------------------------------------
  91. #define wchCR L'\r'
  92. #define wchLF L'\n'
  93. #define chCR '\r'
  94. #define chLF '\n'
  95. #define szCRLF "\r\n"
  96. // --------------------------------------------------------------------------------
  97. // Versioning Magic
  98. // --------------------------------------------------------------------------------
  99. typedef enum tagOEDLLVERSION {
  100. OEDLL_VERSION_5=1
  101. } OEDLLVERSION;
  102. #define OEDLL_VERSION_CURRENT OEDLL_VERSION_5
  103. #define STR_GETDLLMAJORVERSION "GetDllMajorVersion"
  104. typedef OEDLLVERSION (APIENTRY *PFNGETDLLMAJORVERSION)(void);
  105. // --------------------------------------------------------------------------------
  106. // RGB_AUTOCOLOR
  107. // --------------------------------------------------------------------------------
  108. #define RGB_AUTOCOLOR ((COLORREF)-1)
  109. // --------------------------------------------------------------------------------
  110. // NEXTID
  111. // --------------------------------------------------------------------------------
  112. #define NEXTID(pidl) ((LPITEMIDLIST)(((BYTE *)(pidl))+(pidl)->mkid.cb))
  113. #define PAD4(x) (((x)+3)&~3)
  114. // --------------------------------------------------------------------------------
  115. // INLINE
  116. // --------------------------------------------------------------------------------
  117. #ifdef INLINE
  118. #error define overlap
  119. #else
  120. // speed up debug build by turning off inline functions
  121. #ifdef DEBUG
  122. #define INLINE
  123. #else
  124. #define INLINE inline
  125. #endif
  126. #endif
  127. // --------------------------------------------------------------------------------
  128. // IS_EXTENDED
  129. // --------------------------------------------------------------------------------
  130. #define IS_EXTENDED(ch) \
  131. ((ch > 126 || ch < 32) && ch != '\t' && ch != '\n' && ch != '\r')
  132. // --------------------------------------------------------------------------------
  133. // Flag Utility Functions
  134. // --------------------------------------------------------------------------------
  135. #define FLAGSET(_dw, _f) do {_dw |= (_f);} while (0)
  136. #define FLAGTOGGLE(_dw, _f) do {_dw ^= (_f);} while (0)
  137. #define FLAGCLEAR(_dw, _f) do {_dw &= ~(_f);} while (0)
  138. #define ISFLAGSET(_dw, _f) (BOOL)(((_dw) & (_f)) == (_f))
  139. #define ISFLAGCLEAR(_dw, _f) (BOOL)(((_dw) & (_f)) != (_f))
  140. // --------------------------------------------------------------------------------
  141. // Used for building an IDataObject format enumerator
  142. // --------------------------------------------------------------------------------
  143. #define SETDefFormatEtc(fe, cf, med) {\
  144. (fe).cfFormat = ((CLIPFORMAT) (cf)); \
  145. (fe).dwAspect = DVASPECT_CONTENT; \
  146. (fe).ptd = NULL; \
  147. (fe).tymed = med; \
  148. (fe).lindex = -1; \
  149. }
  150. // --------------------------------------------------------------------------------
  151. // Some defines to create bit fields easier
  152. // --------------------------------------------------------------------------------
  153. #define FLAG01 0x00000001
  154. #define FLAG02 0x00000002
  155. #define FLAG03 0x00000004
  156. #define FLAG04 0x00000008
  157. #define FLAG05 0x00000010
  158. #define FLAG06 0x00000020
  159. #define FLAG07 0x00000040
  160. #define FLAG08 0x00000080
  161. #define FLAG09 0x00000100
  162. #define FLAG10 0x00000200
  163. #define FLAG11 0x00000400
  164. #define FLAG12 0x00000800
  165. #define FLAG13 0x00001000
  166. #define FLAG14 0x00002000
  167. #define FLAG15 0x00004000
  168. #define FLAG16 0x00008000
  169. #define FLAG17 0x00010000
  170. #define FLAG18 0x00020000
  171. #define FLAG19 0x00040000
  172. #define FLAG20 0x00080000
  173. #define FLAG21 0x00100000
  174. #define FLAG22 0x00200000
  175. #define FLAG23 0x00400000
  176. #define FLAG24 0x00800000
  177. #define FLAG25 0x01000000
  178. #define FLAG26 0x02000000
  179. #define FLAG27 0x04000000
  180. #define FLAG28 0x08000000
  181. #define FLAG29 0x10000000
  182. #define FLAG30 0x20000000
  183. #define FLAG31 0x40000000
  184. #define FLAG32 0x80000000
  185. // --------------------------------------------------------------------------------
  186. // Support Inclusion into a C file
  187. // --------------------------------------------------------------------------------
  188. #ifdef __cplusplus
  189. extern "C" {
  190. #endif
  191. // --------------------------------------------------------------------------------
  192. // Common String Lengths
  193. // --------------------------------------------------------------------------------
  194. #define cchMaxDate 64
  195. #define cchMaxTime 22
  196. // --------------------------------------------------------------------------------
  197. // ARRAYSIZE - Don't use this on extern'ed global data structures, it won't work
  198. // --------------------------------------------------------------------------------
  199. #ifndef ARRAYSIZE
  200. #define ARRAYSIZE(_rg) (sizeof((_rg))/sizeof((_rg)[0]))
  201. #endif // ARRAYSIZE
  202. // --------------------------------------------------------------------------------
  203. // HANDLE_COMMAND - Used in a WindowProc to simplify handling of WM_COMMAND messages
  204. // --------------------------------------------------------------------------------
  205. #define HANDLE_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
  206. case (id): { (fn)((HWND)(hwnd), (HWND)(hwndCtl), (UINT)(codeNotify)); break; }
  207. // --------------------------------------------------------------------------------
  208. // Standard Boolean Constants
  209. // --------------------------------------------------------------------------------
  210. #define fFalse ((BOOL) 0)
  211. #define fTrue ((BOOL) 1)
  212. // --------------------------------------------------------------------------------
  213. // Storage class macros
  214. // --------------------------------------------------------------------------------
  215. #ifdef _X86_
  216. #define BEGIN_CODESPACE_DATA data_seg(".rdata")
  217. #define BEGIN_NAME_CODESPACE_DATA(a) data_seg(".rdata$"#a, ".rdata")
  218. #define BEGIN_FUNCTION_CODESPACE_DATA data_seg(".rdata")
  219. #define END_CODESPACE_DATA data_seg()
  220. #define BEGIN_NAME_DATA(a) data_seg(".data$"#a, ".data")
  221. #define END_NAME_DATA data_seg()
  222. #else
  223. #define BEGIN_FUNCTION_CODESPACE_DATA
  224. #define BEGIN_NAME_CODESPACE_DATA(a)
  225. #define BEGIN_CODESPACE_DATA
  226. #define END_CODESPACE_DATA
  227. #define BEGIN_NAME_DATA(a)
  228. #define END_NAME_DATA
  229. #endif
  230. // --------------------------------------------------------------------------------
  231. // Macro that causes the compiler to ignore a local variable or
  232. // parameter without generating a warning.
  233. // --------------------------------------------------------------------------------
  234. #ifndef Unreferenced
  235. #define Unreferenced(a) ((void)a)
  236. #endif
  237. // --------------------------------------------------------------------------------
  238. // SAFECAST - Insures that a cast is valid, otherwise it won't compile
  239. // --------------------------------------------------------------------------------
  240. #define SAFECAST(_src, _type) (((_type)(_src)==(_src)?0:0), (_type)(_src))
  241. // --------------------------------------------------------------------------------
  242. // Computes the size of a member in a structure
  243. // --------------------------------------------------------------------------------
  244. #define sizeofMember(s,m) sizeof(((s *)0)->m)
  245. #if 0
  246. // --------------------------------------------------------------------------------
  247. // Computes the byte offset to the parent class from a nested class
  248. // --------------------------------------------------------------------------------
  249. #define _OEOffset(class, itf) ((UINT)&(((class *)0)->itf))
  250. // --------------------------------------------------------------------------------
  251. // Computes the parent interface of a nested class
  252. // --------------------------------------------------------------------------------
  253. /------------------Merge Conflict------------------\
  254. #define IToClass(class, itf, pitf) ((class *)(((LPSTR)pitf)-_OEOffset(class, itf)))
  255. #endif
  256. // --------------------------------------------------------------------------------
  257. // SafeReleaseCnt - SafeRelease and set ulCount to the after release ref count
  258. // --------------------------------------------------------------------------------
  259. #define SafeReleaseCnt(_object, _refcount) \
  260. if (_object) { \
  261. (_refcount) = (_object)->Release (); \
  262. (_object) = NULL; \
  263. } else
  264. // --------------------------------------------------------------------------------
  265. // SafeRelease - Releases an object and sets the object to NULL
  266. // --------------------------------------------------------------------------------
  267. #define SafeRelease(_object) \
  268. if (_object) { \
  269. (_object)->Release(); \
  270. (_object) = NULL; \
  271. } else
  272. // --------------------------------------------------------------------------------
  273. // SafeFreeLibrary - Checks if _hinst is non null and then calls FreeLibrary
  274. // --------------------------------------------------------------------------------
  275. #define SafeFreeLibrary(_hinst) \
  276. if (_hinst) { \
  277. FreeLibrary(_hinst); \
  278. _hinst = NULL; \
  279. } else
  280. // --------------------------------------------------------------------------------
  281. // SafeCloseHandle
  282. // --------------------------------------------------------------------------------
  283. #define SafeCloseHandle(_handle) \
  284. if (_handle) { \
  285. CloseHandle(_handle); \
  286. _handle = NULL; \
  287. } else
  288. // --------------------------------------------------------------------------------
  289. // SafeUnmapViewOfFile
  290. // --------------------------------------------------------------------------------
  291. #define SafeUnmapViewOfFile(_pView) \
  292. if (_pView) { \
  293. UnmapViewOfFile((LPVOID)_pView); \
  294. _pView = NULL; \
  295. } else
  296. // --------------------------------------------------------------------------------
  297. // SafePidlFree
  298. // --------------------------------------------------------------------------------
  299. #define SafePidlFree(_pidl) \
  300. if (_pidl) { \
  301. PidlFree(_pidl); \
  302. _pidl = NULL; \
  303. } else
  304. // --------------------------------------------------------------------------------
  305. // SafeInternetCloseHandle
  306. // --------------------------------------------------------------------------------
  307. #define SafeInternetCloseHandle(_handle) \
  308. if (_handle) { \
  309. InternetCloseHandle(_handle); \
  310. _handle = NULL; \
  311. } else
  312. // --------------------------------------------------------------------------------
  313. // SafeDelete - safely deletes a non-referenced counted object
  314. // --------------------------------------------------------------------------------
  315. #define SafeDelete(_obj) \
  316. if (_obj) { \
  317. delete _obj; \
  318. _obj = NULL; \
  319. } else
  320. // --------------------------------------------------------------------------------
  321. // ReleaseObj - Releases an Object if it is not NULL
  322. // --------------------------------------------------------------------------------
  323. #ifndef ReleaseObj
  324. #ifdef __cplusplus
  325. #define ReleaseObj(_object) (_object) ? (_object)->Release() : 0
  326. #else
  327. #define ReleaseObj(_object) (_object) ? (_object)->lpVtbl->Release(_object) : 0
  328. #endif // __cplusplus
  329. #endif
  330. // --------------------------------------------------------------------------------
  331. // SafeSysFreeString - Frees a bstr if not NULL
  332. // --------------------------------------------------------------------------------
  333. #define SafeSysFreeString(_x) \
  334. if (_x) { \
  335. SysFreeString(_x);\
  336. _x = NULL; \
  337. } else
  338. // -------------------------------------------------------------------------
  339. // ReplaceInterface - Replaces a member interface with a new interface
  340. // -------------------------------------------------------------------------
  341. #define ReplaceInterface(_pUnk, _pUnkNew) \
  342. { \
  343. if (_pUnk) \
  344. (_pUnk)->Release(); \
  345. if ((_pUnk) = (_pUnkNew)) \
  346. (_pUnk)->AddRef(); \
  347. }
  348. #ifdef __cplusplus
  349. }
  350. #endif
  351. // --------------------------------------------------------------------------------
  352. // SetWndThisPtrOnCreate
  353. // --------------------------------------------------------------------------------
  354. #define SetWndThisPtrOnCreate(hwnd, lpcs) \
  355. SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)(((LPCREATESTRUCT)lpcs)->lpCreateParams))
  356. // --------------------------------------------------------------------------------
  357. // SetWndThisPtr
  358. // --------------------------------------------------------------------------------
  359. #define SetWndThisPtr(hwnd, THIS) \
  360. SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)THIS)
  361. // --------------------------------------------------------------------------------
  362. // GetWndThisPtr
  363. // --------------------------------------------------------------------------------
  364. #define GetWndThisPtr(hwnd) \
  365. GetWindowLongPtr(hwnd, GWLP_USERDATA)
  366. // --------------------------------------------------------------------------------
  367. // ListView Helper Macros
  368. // --------------------------------------------------------------------------------
  369. #define ListView_GetSelFocused(_hwndlist) ListView_GetNextItem(_hwndlist, -1, LVNI_SELECTED|LVIS_FOCUSED)
  370. #define ListView_GetFirstSel(_hwndlist) ListView_GetNextItem(_hwndlist, -1, LVNI_SELECTED)
  371. #define ListView_GetFocusedItem(_hwndlist) ListView_GetNextItem(_hwndlist, -1, LVNI_FOCUSED)
  372. #define ListView_SelectItem(_hwndlist, _i) ListView_SetItemState(_hwndlist, _i, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED)
  373. #define ListView_UnSelectItem(_hwndlist, _i) ListView_SetItemState(_hwndlist, _i, 0, LVIS_SELECTED)
  374. #define ListView_FocusItem(_hwndlist, _i) ListView_SetItemState(_hwndlist, _i, LVIS_FOCUSED, LVIS_FOCUSED)
  375. #if (_WIN32_IE >= 0x0400)
  376. #define ListView_UnSelectAll(_hwndlist) { \
  377. ListView_SetItemState(_hwndlist, -1, 0, LVIS_SELECTED|LVIS_FOCUSED); \
  378. ListView_SetSelectionMark(_hwndlist, -1); \
  379. }
  380. #else
  381. #define ListView_UnSelectAll(_hwndlist) ListView_SetItemState(_hwndlist, -1, 0, LVIS_SELECTED|LVIS_FOCUSED);
  382. #endif
  383. #define ListView_SelectAll(_hwndlist) ListView_SetItemState(_hwndlist, -1, LVIS_SELECTED, LVIS_SELECTED)
  384. // --------------------------------------------------------------------------------
  385. // MAX Move Memory Definitions
  386. // --------------------------------------------------------------------------------
  387. #ifdef RtlMoveMemory
  388. #undef RtlMoveMemory
  389. #ifdef __cplusplus
  390. extern "C" {
  391. #endif
  392. __declspec(dllimport) void RtlMoveMemory(void *, const void *, unsigned long);
  393. #ifdef __cplusplus
  394. }
  395. #endif
  396. #endif
  397. #ifndef MSOERT_NO_MEMUTIL
  398. // --------------------------------------------------------------------------------
  399. // Memory Utility Functions
  400. // --------------------------------------------------------------------------------
  401. extern IMalloc *g_pMalloc;
  402. // --------------------------------------------------------------------------------
  403. // SafeMemFree
  404. // --------------------------------------------------------------------------------
  405. #ifndef SafeMemFree
  406. #ifdef __cplusplus
  407. #define SafeMemFree(_pv) \
  408. if (_pv) { \
  409. g_pMalloc->Free(_pv); \
  410. _pv = NULL; \
  411. } else
  412. #else
  413. #define SafeMemFree(_pv) \
  414. if (_pv) { \
  415. g_pMalloc->lpVtbl->Free(g_pMalloc, _pv); \
  416. _pv = NULL; \
  417. } else
  418. #endif // __cplusplus
  419. #endif // SafeMemFree
  420. // --------------------------------------------------------------------------------
  421. // MemFree
  422. // --------------------------------------------------------------------------------
  423. #define MemFree(_pv) g_pMalloc->Free(_pv)
  424. #define ReleaseMem(_pv) MemFree(_pv)
  425. #define AthFreeString(_psz) g_pMalloc->Free((LPVOID)_psz)
  426. // --------------------------------------------------------------------------------
  427. // Memory Allocation Functions
  428. // --------------------------------------------------------------------------------
  429. LPVOID ZeroAllocate(DWORD cbSize);
  430. BOOL MemAlloc(LPVOID* ppv, ULONG cb);
  431. BOOL MemRealloc(LPVOID *ppv, ULONG cbNew);
  432. HRESULT HrAlloc(LPVOID *ppv, ULONG cb);
  433. HRESULT HrRealloc(LPVOID *ppv, ULONG cbNew);
  434. #endif // !MSOERT_NO_MEMUTIL
  435. // --------------------------------------------------------------------------------
  436. // Debug Utility Functions
  437. // --------------------------------------------------------------------------------
  438. #ifndef MSOERT_NO_DEBUG
  439. #endif // !MSOERT_NO_DEBUG
  440. // --------------------------------------------------------------------------------
  441. // String Utility Functions
  442. // --------------------------------------------------------------------------------
  443. #ifndef MSOERT_NO_STRUTIL
  444. #define CCHMAX_STRINGRES 512
  445. // Used with HrFindInetTimeZone
  446. typedef struct tagINETTIMEZONE {
  447. LPSTR lpszZoneCode;
  448. INT cHourOffset;
  449. INT cMinuteOffset;
  450. } INETTIMEZONE, *LPINETTIMEZONE;
  451. // Used with CchFileTimeToDateTimeSz
  452. #define DTM_LONGDATE 0x00000001
  453. #define DTM_NOSECONDS 0x00000002
  454. #define DTM_NOTIME 0x00000004
  455. #define DTM_NODATE 0x00000008
  456. #define DTM_DOWSHORTDATE 0x00000010
  457. #define DTM_FORCEWESTERN 0x00000020
  458. #define DTM_NOTIMEZONEOFFSET 0x00000040
  459. #define TOUPPERA(_ch) (CHAR)LOWORD(CharUpperA((LPSTR)(DWORD_PTR)MAKELONG(_ch, 0)))
  460. #define TOLOWERA(_ch) (CHAR)LOWORD(CharLowerA((LPSTR)(DWORD_PTR)MAKELONG(_ch, 0)))
  461. OESTDAPI_(LPWSTR) PszDupW(LPCWSTR pcwszSource);
  462. OESTDAPI_(LPSTR) PszDupA(LPCSTR pcszSource);
  463. OESTDAPI_(LPSTR) PszDupLenA(LPCSTR pcszSource, int nLen);
  464. OESTDAPI_(BOOL) FIsEmptyA(LPCSTR pcszString);
  465. OESTDAPI_(BOOL) FIsEmptyW(LPCWSTR pcwszString);
  466. OESTDAPI_(LPWSTR) PszToUnicode(UINT cp, LPCSTR pcszSource);
  467. OESTDAPI_(ULONG) UlStripWhitespace(LPTSTR lpsz, BOOL fLeading, BOOL fTrailing, ULONG *pcb);
  468. OESTDAPI_(ULONG) UlStripWhitespaceW(LPWSTR lpwsz, BOOL fLeading, BOOL fTrailing, ULONG *pcb);
  469. OESTDAPI_(LPSTR) PszSkipWhiteA(LPSTR psz);
  470. OESTDAPI_(LPWSTR) PszSkipWhiteW(LPWSTR psz);
  471. OESTDAPI_(LPSTR) PszScanToWhiteA(LPSTR psz);
  472. OESTDAPI_(LPSTR) PszScanToCharA(LPSTR psz, CHAR ch);
  473. OESTDAPI_(VOID) StripCRLF(LPSTR lpsz, ULONG *pcb);
  474. OESTDAPI_(LPSTR) PszAllocA(INT nLen);
  475. OESTDAPI_(LPWSTR) PszAllocW(INT nLen);
  476. OESTDAPI_(BOOL) FIsSpaceA(LPSTR psz);
  477. OESTDAPI_(BOOL) FIsSpaceW(LPWSTR psz);
  478. OESTDAPI_(LPSTR) PszToANSI(UINT cp, LPCWSTR pcwszSource);
  479. OESTDAPI_(UINT) StrToUintW(LPCWSTR lpSrc);
  480. OESTDAPI_(UINT) StrToUintA(LPCSTR lpSrc);
  481. OESTDAPI_(INT) IsDigit(LPSTR psz);
  482. OESTDAPI_(CHAR) ChConvertFromHex(CHAR ch);
  483. OESTDAPI_(LPSTR) PszFromANSIStreamA(LPSTREAM pstm);
  484. OESTDAPI_(HRESULT) HrIndexOfMonth(LPCSTR pszMonth, ULONG *pulIndex);
  485. OESTDAPI_(HRESULT) HrIndexOfWeek(LPCSTR pszDay, ULONG *pulIndex);
  486. OESTDAPI_(HRESULT) HrFindInetTimeZone(LPCSTR pszTimeZone, LPINETTIMEZONE pTimeZone);
  487. OESTDAPI_(LPCSTR) PszDayFromIndex(ULONG ulIndex);
  488. OESTDAPI_(LPCSTR) PszMonthFromIndex(ULONG ulIndex);
  489. OESTDAPI_(LPSTR) PszEscapeMenuStringA(LPCSTR pszSource, LPSTR pszQuoted, int cch);
  490. OESTDAPI_(INT) IsPrint(LPSTR psz);
  491. OESTDAPI_(INT) IsUpper(LPSTR psz);
  492. OESTDAPI_(INT) IsAlphaNum(LPSTR psz);
  493. OESTDAPI_(LPSTR) strtrim(char *s);
  494. OESTDAPI_(LPWSTR) strtrimW(WCHAR *s);
  495. OESTDAPI_(INT) CchFileTimeToDateTimeSz(FILETIME * pft, CHAR * szDateTime, int cch, DWORD dwFlags);
  496. OESTDAPI_(LPCSTR) StrChrExA(UINT codepage, LPCSTR pszString, CHAR ch);
  497. OESTDAPI_(BOOL) FIsValidFileNameCharW(WCHAR wch);
  498. OESTDAPI_(BOOL) FIsValidFileNameCharA(UINT codepage, CHAR ch);
  499. OESTDAPI_(ULONG) CleanupFileNameInPlaceA(UINT codepage, LPSTR psz);
  500. OESTDAPI_(ULONG) CleanupFileNameInPlaceW(LPWSTR pwsz);
  501. OESTDAPI_(INT) ReplaceChars(LPCSTR pszString, CHAR chFind, CHAR chReplace);
  502. OESTDAPI_(INT) ReplaceCharsW(LPCWSTR pszString, WCHAR chFind, WCHAR chReplace);
  503. OESTDAPI_(LPCSTR) _MSG(LPSTR pszFormat, ...);
  504. OESTDAPI_(BOOL) IsValidFileIfFileUrl(LPSTR pszUrl);
  505. OESTDAPI_(BOOL) IsValidFileIfFileUrlW(LPWSTR pwszUrl);
  506. OESTDAPI_(BOOL) fGetBrowserUrlEncoding(LPDWORD pdwFlags);
  507. typedef int (*PFGETTIMEFORMATW)(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME * lpTime,
  508. LPCWSTR pwzFormat, LPWSTR pwzTimeStr, int cchTime);
  509. typedef int (*PFGETDATEFORMATW)(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME * lpDate,
  510. LPCWSTR pwzFormat, LPWSTR pwzDateStr, int cchDate);
  511. typedef int (*PFGETLOCALEINFOW)(LCID Locale, LCTYPE LCType, LPWSTR lpsz, int cchData);
  512. OESTDAPI_(BOOL) CchFileTimeToDateTimeW(FILETIME *pft, WCHAR * wsDateTime, int cch,
  513. DWORD dwFlags, PFGETDATEFORMATW pfGetDateFormatW,
  514. PFGETTIMEFORMATW pfGetTimeFormatW,
  515. PFGETLOCALEINFOW pfGetLocaleInfo);
  516. // --------------------------------------------------------------------------------
  517. // Unicode/ANSI Function Mapping
  518. // --------------------------------------------------------------------------------
  519. #ifdef UNICODE
  520. #define FIsEmpty FIsEmptyW
  521. #define PszDup PszDupW
  522. #define PszAlloc PszAllocW
  523. #define FIsSpace FIsSpaceW
  524. #define StrToUint StrToUintW
  525. #else
  526. #define FIsEmpty FIsEmptyA
  527. #define PszDup PszDupA
  528. #define PszAlloc PszAllocA
  529. #define FIsSpace FIsSpaceA
  530. #define StrToUint StrToUintA
  531. #endif
  532. #define IsSpace FIsSpaceA
  533. #endif // !MSOERT_NO_STRUTIL
  534. // --------------------------------------------------------------------------------
  535. // IStream Utility Functions
  536. // --------------------------------------------------------------------------------
  537. #ifndef MSOERT_NO_STMUTIL
  538. OESTDAPI_(HRESULT) HrIsStreamUnicode(LPSTREAM pstm, BOOL *pfLittleEndian);
  539. OESTDAPI_(HRESULT) HrCopyStreamToByte(LPSTREAM lpstmIn, LPBYTE pbDest, ULONG *pcb);
  540. OESTDAPI_(HRESULT) HrByteToStream(LPSTREAM *lppstm, LPBYTE lpb, ULONG cb);
  541. OESTDAPI_(HRESULT) HrGetStreamSize(LPSTREAM pstm, ULONG *pcb);
  542. OESTDAPI_(HRESULT) HrRewindStream(LPSTREAM pstm);
  543. OESTDAPI_(HRESULT) HrCopyStream(LPSTREAM pstmIn, LPSTREAM pstmOut, ULONG *pcb);
  544. OESTDAPI_(HRESULT) HrCopyLockBytesToStream(ILockBytes *pLockBytes, IStream *pStream, ULONG *pcbCopied);
  545. OESTDAPI_(HRESULT) HrSafeGetStreamSize(LPSTREAM pstm, ULONG *pcb);
  546. OESTDAPI_(HRESULT) HrGetStreamPos(LPSTREAM pstm, ULONG *piPos);
  547. OESTDAPI_(HRESULT) HrStreamSeekSet(LPSTREAM pstm, ULONG iPos);
  548. OESTDAPI_(HRESULT) HrCopyStreamCBEndOnCRLF(LPSTREAM lpstmIn, LPSTREAM lpstmOut, ULONG cb, ULONG *pcbActual);
  549. OESTDAPI_(HRESULT) CreateTempFileStream(LPSTREAM *ppstmFile);
  550. OESTDAPI_(HRESULT) HrStreamToByte(LPSTREAM lpstm, LPBYTE *lppb, ULONG *pcb);
  551. OESTDAPI_(HRESULT) HrCopyStreamCB(LPSTREAM lpstmIn, LPSTREAM lpstmOut, ULARGE_INTEGER uliCopy, ULARGE_INTEGER *puliRead, ULARGE_INTEGER *puliWritten);
  552. OESTDAPI_(HRESULT) HrStreamSeekCur(LPSTREAM pstm, LONG iPos);
  553. OESTDAPI_(HRESULT) HrStreamSeekEnd(LPSTREAM pstm);
  554. OESTDAPI_(HRESULT) HrStreamSeekBegin(LPSTREAM pstm);
  555. OESTDAPI_(BOOL) StreamSubStringMatch(LPSTREAM pstm, TCHAR *sz);
  556. OESTDAPI_(HRESULT) OpenFileStream(LPSTR pszFile, DWORD dwCreationDistribution, DWORD dwAccess, LPSTREAM *ppstmFile);
  557. OESTDAPI_(HRESULT) OpenFileStreamWithFlags(LPSTR pszFile, DWORD dwCreationDistribution, DWORD dwAccess, DWORD dwFlagsAndAttributes, LPSTREAM *ppstmFile);
  558. OESTDAPI_(HRESULT) OpenFileStreamShare(LPSTR pszFile, DWORD dwCreationDistribution, DWORD dwAccess, DWORD dwShare, LPSTREAM *ppstmFile);
  559. OESTDAPI_(HRESULT) WriteStreamToFile(LPSTREAM pstm, LPSTR lpszFile, DWORD dwCreationDistribution, DWORD dwAccess);
  560. OESTDAPI_(HRESULT) OpenFileStreamW(LPWSTR pszFile, DWORD dwCreationDistribution, DWORD dwAccess, LPSTREAM *ppstmFile);
  561. OESTDAPI_(HRESULT) OpenFileStreamWithFlagsW(LPWSTR pszFile, DWORD dwCreationDistribution, DWORD dwAccess, DWORD dwFlagsAndAttributes, LPSTREAM *ppstmFile);
  562. OESTDAPI_(HRESULT) OpenFileStreamShareW(LPWSTR pszFile, DWORD dwCreationDistribution, DWORD dwAccess, DWORD dwShare, LPSTREAM *ppstmFile);
  563. OESTDAPI_(HRESULT) WriteStreamToFileW(LPSTREAM pstm, LPWSTR lpszFile, DWORD dwCreationDistribution, DWORD dwAccess);
  564. #endif // !MSOERT_NO_STRUTIL
  565. // --------------------------------------------------------------------------------
  566. // Protected Storage
  567. // --------------------------------------------------------------------------------
  568. #ifndef MSOERT_NO_PROTSTOR
  569. #include "pstore.h"
  570. #ifdef ENABLE_RULES
  571. #define PST_IDENT_TYPE_STRING L"Identification with rules"
  572. #elif defined(N_TEST)
  573. #define PST_IDENT_TYPE_STRING L"Identification test"
  574. #else
  575. #define PST_IDENT_TYPE_STRING L"Identification"
  576. #endif
  577. #define PST_IMNACCT_SUBTYPE_STRING L"INETCOMM Server Passwords"
  578. #define PST_CERTS_SUBTYPE_STRING L"Certificate Trust"
  579. // --------------------------------------------------------------------------------
  580. // Protected Storage Functions
  581. // --------------------------------------------------------------------------------
  582. OESTDAPI_(HRESULT) PSTSetNewData(
  583. IN IPStore *const pISecProv,
  584. IN const GUID *const guidType,
  585. IN const GUID *const guidSubt,
  586. IN LPCWSTR wszAccountName,
  587. IN const BLOB *const pclear,
  588. OUT BLOB *const phandle);
  589. OESTDAPI_(HRESULT) PSTGetData(
  590. IN IPStore *const pISecProv,
  591. IN const GUID *const guidType,
  592. IN const GUID *const guidSubt,
  593. IN LPCWSTR wszLookupName,
  594. OUT BLOB *const pclear);
  595. OESTDAPI_(HRESULT) PSTCreateTypeSubType_NoUI(
  596. IN IPStore *const pISecProv,
  597. IN const GUID *const guidType,
  598. IN LPCWSTR szType,
  599. IN const GUID *const guidSubt,
  600. IN LPCWSTR szSubt);
  601. OESTDAPI_(LPWSTR) WszGenerateNameFromBlob(IN BLOB blob);
  602. OESTDAPI_(void) PSTFreeHandle(IN LPBYTE pb);
  603. #endif // !MSOERT_NO_PROTSTOR
  604. // --------------------------------------------------------------------------------
  605. // CAPI Utility - A few helper functions for the crypt32 utilities
  606. // --------------------------------------------------------------------------------
  607. #ifndef MSOERT_NO_CAPIUTIL
  608. #ifndef __WINCRYPT_H__
  609. #define _CRYPT32_
  610. #include <wincrypt.h>
  611. #endif
  612. typedef enum tagCERTSTATE CERTSTATE; // From mimeole.h
  613. OESTDAPI_(LPSTR) SzGetCertificateEmailAddress(const PCCERT_CONTEXT pCert);
  614. OESTDAPI_(HRESULT) HrDecodeObject(const BYTE *pbEncoded, DWORD cbEncoded, LPCSTR item, DWORD dwFlags,
  615. DWORD *pcbOut, LPVOID *ppvOut);
  616. OESTDAPI_(LPVOID) PVDecodeObject(const BYTE *pbEncoded, DWORD cbEncoded, LPCSTR item, DWORD *pcbOut);
  617. OESTDAPI_(LPVOID) PVGetCertificateParam(PCCERT_CONTEXT pCert, DWORD dwParam, DWORD *cbOut);
  618. OESTDAPI_(HRESULT) HrGetCertificateParam(PCCERT_CONTEXT pCert, DWORD dwParam, LPVOID * pvOut, DWORD *cbOut);
  619. OESTDAPI_(BOOL) FMissingCert(const CERTSTATE cs);
  620. OESTDAPI_(LPVOID) PVGetMsgParam(HCRYPTMSG hCryptMsg, DWORD dwParam, DWORD dwIndex, DWORD *pcbData);
  621. OESTDAPI_(HRESULT) HrGetMsgParam(HCRYPTMSG hCryptMsg, DWORD dwParam, DWORD dwIndex, LPVOID * ppv, DWORD * pcbData);
  622. LPVOID WINAPI CryptAllocFunc(size_t cbSize);
  623. VOID WINAPI CryptFreeFunc(LPVOID pv);
  624. HRESULT HrGetCertKeyUsage(PCCERT_CONTEXT pccert, DWORD * pdwUsage);
  625. HRESULT HrVerifyCertEnhKeyUsage(PCCERT_CONTEXT pccert, LPCSTR pszOidUsage);
  626. #endif // !MSOERT_NO_CAPIUTIL
  627. // --------------------------------------------------------------------------------
  628. // CAPI Utility - A few helper functions for the crypt32 utilities
  629. // --------------------------------------------------------------------------------
  630. #ifndef MSOERT_NO_RASUTIL
  631. OESTDAPI_(HRESULT) HrCreatePhonebookEntry(HWND hwnd, DWORD *pdwRASResult);
  632. OESTDAPI_(HRESULT) HrEditPhonebookEntry(HWND hwnd, LPTSTR pszEntryName, DWORD *pdwRASResult);
  633. OESTDAPI_(HRESULT) HrFillRasCombo(HWND hwndComboBox, BOOL fUpdateOnly, DWORD *pdwRASResult);
  634. #endif // !MSOERT_NO_RASUTIL
  635. // --------------------------------------------------------------------------------
  636. // Win32 Registry Utilities
  637. // --------------------------------------------------------------------------------
  638. #ifndef MSOERT_NO_REGUTIL
  639. OESTDAPI_(VOID) CopyRegistry(HKEY hSourceKey, HKEY hDestinationKey);
  640. #endif // !MSOERT_NO_REGUTIL
  641. // --------------------------------------------------------------------------------
  642. // t-wstrings
  643. // --------------------------------------------------------------------------------
  644. #ifndef MSOERT_NO_WSTRINGS
  645. OESTDAPI_(BOOL) UnlocStrEqNW(LPCWSTR pwsz1, LPCWSTR pwsz2, DWORD cch);
  646. #endif // !MSOERT_NO_WSTRINGS
  647. // --------------------------------------------------------------------------------
  648. // CStringParser
  649. // --------------------------------------------------------------------------------
  650. #ifndef MSOERT_NO_STRPARSE
  651. #ifdef __cplusplus
  652. #include "strparse.h"
  653. #endif // !__cplusplus
  654. #endif // !MSOERT_NO_STRPARSE
  655. // --------------------------------------------------------------------------------
  656. // DataObject Utility
  657. // --------------------------------------------------------------------------------
  658. #ifndef MSOERT_NO_ENUMFMT
  659. #ifdef __cplusplus
  660. typedef struct tagDATAOBJINFO
  661. {
  662. FORMATETC fe;
  663. LPVOID pData;
  664. DWORD cbData;
  665. } DATAOBJINFO, *PDATAOBJINFO;
  666. OESTDAPI_(HRESULT) CreateEnumFormatEtc(LPUNKNOWN pUnkRef, ULONG celt, PDATAOBJINFO rgInfo, LPFORMATETC rgfe,
  667. IEnumFORMATETC ** lppstmHFile);
  668. #endif // !__cplusplus
  669. #endif // !MSOERT_NO_ENUMFMT
  670. // --------------------------------------------------------------------------------
  671. // CPrivateUnknown Utility
  672. // --------------------------------------------------------------------------------
  673. #ifndef MSOERT_NO_PRIVUNK
  674. #ifdef __cplusplus
  675. #include "privunk.h"
  676. #endif // !__cplusplus
  677. #endif // !MSOERT_NO_PRIVUNK
  678. // --------------------------------------------------------------------------------
  679. // CByteStream Object
  680. // --------------------------------------------------------------------------------
  681. #ifndef MSOERT_NO_BYTESTM
  682. #ifdef __cplusplus
  683. #include "bytestm.h"
  684. #endif // !__cplusplus
  685. #endif // !MSOERT_NO_BYTESTM
  686. // --------------------------------------------------------------------------------
  687. // CLogFile Object
  688. // --------------------------------------------------------------------------------
  689. #ifndef MSOERT_NO_CLOGFILE
  690. #ifdef __cplusplus
  691. #include "..\\msoert\\clogfile.h"
  692. #endif // !__cplusplus
  693. #endif // !MSOERT_NO_CLOGFILE
  694. // --------------------------------------------------------------------------------
  695. // CDataObject Object
  696. // --------------------------------------------------------------------------------
  697. #ifndef MSOERT_NO_DATAOBJ
  698. #ifdef __cplusplus
  699. #include "..\\msoert\\dataobj.h"
  700. #endif // !__cplusplus
  701. #endif // !MSOERT_NO_DATAOBJ
  702. // --------------------------------------------------------------------------------
  703. // CUnknownList and CVoidPtrList Objects
  704. // --------------------------------------------------------------------------------
  705. #ifndef MSOERT_NO_LISTOBJS
  706. #ifdef __cplusplus
  707. #include "..\\msoert\\listintr.h"
  708. #endif // !__cplusplus
  709. #endif // !MSOERT_NO_LISTOBJS
  710. // --------------------------------------------------------------------------------
  711. // MSHTML utilities
  712. // --------------------------------------------------------------------------------
  713. #ifndef MSOERT_NO_MSHTMLUTILS
  714. #ifdef __cplusplus
  715. #include "..\\msoert\\mshtutil.h"
  716. #endif // !__cplusplus
  717. #endif // !MSOERT_NO_MSHTMLUTILS
  718. // --------------------------------------------------------------------------------
  719. // BSTR utilities
  720. // --------------------------------------------------------------------------------
  721. #ifndef MSOERT_NO_BSTUTILS
  722. #ifdef __cplusplus
  723. #include "..\\msoert\\bstr.h"
  724. #endif // !__cplusplus
  725. #endif // !MSOERT_NO_BSTRUTILS
  726. // --------------------------------------------------------------------------------
  727. // HFILESTM utilities
  728. // --------------------------------------------------------------------------------
  729. #ifndef MSOERT_NO_HFILESTM
  730. #ifdef __cplusplus
  731. OESTDAPI_(HRESULT) CreateStreamOnHFile (LPTSTR lpszFile,
  732. DWORD dwDesiredAccess,
  733. DWORD dwShareMode,
  734. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  735. DWORD dwCreationDistribution,
  736. DWORD dwFlagsAndAttributes,
  737. HANDLE hTemplateFile,
  738. LPSTREAM *lppstmHFile);
  739. OESTDAPI_(HRESULT) CreateStreamOnHFileW(LPWSTR lpwszFile,
  740. DWORD dwDesiredAccess,
  741. DWORD dwShareMode,
  742. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  743. DWORD dwCreationDistribution,
  744. DWORD dwFlagsAndAttributes,
  745. HANDLE hTemplateFile,
  746. LPSTREAM *lppstmHFile);
  747. #endif // !__cplusplus
  748. #endif // !MSOERT_NO_HFILESTM
  749. // --------------------------------------------------------------------------------
  750. // Outlook Express Runtime Utilities
  751. // --------------------------------------------------------------------------------
  752. #ifndef MSOERT_NO_OERTUTIL
  753. typedef struct tagTEMPFILEINFO *LPTEMPFILEINFO;
  754. typedef struct tagTEMPFILEINFO {
  755. LPTEMPFILEINFO pNext;
  756. LPSTR pszFilePath;
  757. HANDLE hProcess;
  758. } TEMPFILEINFO;
  759. #ifndef HIMAGELIST
  760. struct _IMAGELIST;
  761. typedef struct _IMAGELIST NEAR* HIMAGELIST;
  762. #endif
  763. OESTDAPI_(HIMAGELIST) LoadMappedToolbarBitmap(HINSTANCE hInst, int idBitmap, int cx);
  764. OESTDAPI_(VOID) UpdateRebarBandColors(HWND hwnd);
  765. OESTDAPI_(HRESULT) IsPlatformWinNT(void);
  766. OESTDAPI_(HRESULT) GenerateUniqueFileName(LPCSTR pszDirectory, LPCSTR pszFileName, LPCSTR pszExtension, LPSTR pszFilePath, ULONG cchMaxPath);
  767. OESTDAPI_(HRESULT) CreateTempFile(LPCSTR pszSuggest, LPCSTR pszExtension, LPSTR *ppszFilePath, HANDLE *phFile);
  768. OESTDAPI_(HRESULT) WriteStreamToFileHandle(IStream *pStream, HANDLE hFile, ULONG *pcbTotal);
  769. OESTDAPI_(HRESULT) AppendTempFileList(LPTEMPFILEINFO *ppHead, LPSTR pszFilePath, HANDLE hProcess);
  770. OESTDAPI_(VOID) DeleteTempFileOnShutdown(LPTEMPFILEINFO pTempFile);
  771. OESTDAPI_(VOID) DeleteTempFileOnShutdownEx(LPSTR pszFilePath, HANDLE hProcess);
  772. OESTDAPI_(VOID) CleanupGlobalTempFiles(void);
  773. OESTDAPI_(HRESULT) DeleteTempFile(LPTEMPFILEINFO pTempFile);
  774. OESTDAPI_(VOID) FreeTempFileList(LPTEMPFILEINFO pTempFileHead);
  775. #define SafeFreeTempFileList(_p) \
  776. { \
  777. if (_p) \
  778. { \
  779. FreeTempFileList(_p); \
  780. _p=NULL; \
  781. } \
  782. }
  783. OESTDAPI_(BOOL) FBuildTempPath(LPTSTR lpszOrigFile, LPTSTR lpszPath, ULONG cbMaxPath, BOOL fLink);
  784. OESTDAPI_(BOOL) FBuildTempPathW(LPWSTR lpszOrigFile, LPWSTR lpszPath, ULONG cchMaxPath, BOOL fLink);
  785. OESTDAPI_(HRESULT) ShellUtil_GetSpecialFolderPath(DWORD dwSpecialFolder, LPSTR rgchPath);
  786. OESTDAPI_(BOOL) FIsHTMLFile(LPSTR pszFile);
  787. OESTDAPI_(BOOL) FIsHTMLFileW(LPWSTR pwszFile);
  788. typedef int (*PFLOADSTRINGW)(HINSTANCE,UINT,LPWSTR,int);
  789. typedef int (*PFMESSAGEBOXW)(HWND,LPCWSTR,LPCWSTR,UINT);
  790. OESTDAPI_(int) MessageBoxInst(HINSTANCE hInst, HWND hwndOwner, LPTSTR pszTitle, LPTSTR psz1, LPTSTR psz2, UINT fuStyle);
  791. OESTDAPI_(int) MessageBoxInstW(HINSTANCE hInst, HWND hwndOwner, LPWSTR pwszTitle, LPWSTR pwsz1, LPWSTR pwsz2, UINT fuStyle,
  792. PFLOADSTRINGW pfLoadStringW, PFMESSAGEBOXW pfMessageBoxW);
  793. // window utils
  794. OESTDAPI_(void) IDrawText(HDC hdc, LPCTSTR pszText, RECT FAR* prc, BOOL fEllipses, int cyChar);
  795. OESTDAPI_(HRESULT) RicheditStreamIn(HWND hwndRE, LPSTREAM pstm, ULONG uSelFlags);
  796. OESTDAPI_(HRESULT) RicheditStreamOut(HWND hwndRE, LPSTREAM pstm, ULONG uSelFlags);
  797. OESTDAPI_(VOID) CenterDialog(HWND hwndDlg);
  798. OESTDAPI_(VOID) SetIntlFont(HWND hwnd);
  799. OESTDAPI_(BOOL) GetExePath(LPCTSTR szExe, TCHAR *szPath, DWORD cch, BOOL fDirOnly);
  800. OESTDAPI_(BOOL) BrowseForFolder(HINSTANCE hInst, HWND hwnd, TCHAR *pszDir, int cch, int idsText, BOOL fFileSysOnly);
  801. OESTDAPI_(BOOL) BrowseForFolderW(HINSTANCE hInst, HWND hwnd, WCHAR *pwszDir, int cch, int idsText, BOOL fFileSysOnly);
  802. OESTDAPI_(HRESULT) DoHotMailWizard(HWND hwndOwner, LPSTR pszUrl, LPSTR pszFriendly, RECT *prc, IUnknown *pUnkHost);
  803. OESTDAPI_(LONG_PTR) SetWindowLongPtrAthW(HWND hWnd, int nIndex, LONG_PTR dwNewLong);
  804. HRESULT GetHtmlCharset(IStream *pStmHtml, LPSTR *ppszCharset);
  805. #endif // MSOERT_NO_OERTUTIL
  806. typedef HANDLE HTHREAD;
  807. typedef HANDLE HEVENT;
  808. typedef HANDLE HPROCESS;
  809. typedef HANDLE HANDLE_16;
  810. typedef WPARAM WPARAM_16;
  811. #define EXTERN_C_16
  812. #define WINAPI_16
  813. #define CALLBACK_16
  814. #define EXPORT_16
  815. #define LOADDS_16
  816. #define HUGEP_16
  817. #define WaitForSingleObject_16 WaitForSingleObject
  818. #define GlobalAlloc_16 GlobalAlloc
  819. #define GlobalFree_16 GlobalFree
  820. #define CreateFileMapping_16 CreateFileMapping
  821. #define MapViewOfFile_16 MapViewOfFile
  822. #define UnmapViewOfFile_16 UnmapViewOfFile
  823. #define CloseHandle_FM16 CloseHandle
  824. #define CloseHandle_F16 CloseHandle
  825. #define INVALID_HANDLE_VALUE_16 INVALID_HANDLE_VALUE
  826. #define SetDlgThisPtr(hwnd, THIS) SetWndThisPtr(hwnd, THIS)
  827. #define GetDlgThisPtr(hwnd) GetWndThisPtr(hwnd)
  828. // Some one liners can be wrapped in IF_WIN16 or IF_WIN32 so that the
  829. // code is more readable.
  830. #define IF_WIN16(x)
  831. #define IF_NOT_WIN16(x) x
  832. #define IF_WIN32(x) x
  833. #endif // __MSOERT_H