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.

798 lines
32 KiB

  1. /* Copyright (c) 2001-2003, Microsoft Corp. All rights reserved. */
  2. #if _MSC_VER > 1000
  3. #pragma once
  4. #endif
  5. #if defined(__cplusplus)
  6. extern "C" {
  7. #endif
  8. #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
  9. #if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
  10. #if !defined(ISOLATION_AWARE_USE_STATIC_LIBRARY)
  11. #define ISOLATION_AWARE_USE_STATIC_LIBRARY 0
  12. #endif
  13. #if !defined(ISOLATION_AWARE_BUILD_STATIC_LIBRARY)
  14. #define ISOLATION_AWARE_BUILD_STATIC_LIBRARY 0
  15. #endif
  16. #if !defined(ISOLATION_AWARE_INLINE)
  17. #if ISOLATION_AWARE_BUILD_STATIC_LIBRARY
  18. #define ISOLATION_AWARE_INLINE /* nothing */
  19. #else
  20. #if defined(__cplusplus)
  21. #define ISOLATION_AWARE_INLINE inline
  22. #else
  23. #define ISOLATION_AWARE_INLINE __inline
  24. #endif
  25. #endif
  26. #endif
  27. #if !ISOLATION_AWARE_USE_STATIC_LIBRARY
  28. FARPROC WINAPI WinuserIsolationAwarePrivatetRgCebPnQQeRff_HfReQP_QYY(LPCSTR pszProcName);
  29. #endif /* ISOLATION_AWARE_USE_STATIC_LIBRARY */
  30. ATOM WINAPI IsolationAwareRegisterClassA(const WNDCLASSA*lpWndClass);
  31. ATOM WINAPI IsolationAwareRegisterClassW(const WNDCLASSW*lpWndClass);
  32. BOOL WINAPI IsolationAwareUnregisterClassA(LPCSTR lpClassName,HINSTANCE hInstance);
  33. BOOL WINAPI IsolationAwareUnregisterClassW(LPCWSTR lpClassName,HINSTANCE hInstance);
  34. BOOL WINAPI IsolationAwareGetClassInfoA(HINSTANCE hInstance,LPCSTR lpClassName,LPWNDCLASSA lpWndClass);
  35. BOOL WINAPI IsolationAwareGetClassInfoW(HINSTANCE hInstance,LPCWSTR lpClassName,LPWNDCLASSW lpWndClass);
  36. ATOM WINAPI IsolationAwareRegisterClassExA(const WNDCLASSEXA*unnamed1);
  37. ATOM WINAPI IsolationAwareRegisterClassExW(const WNDCLASSEXW*unnamed1);
  38. BOOL WINAPI IsolationAwareGetClassInfoExA(HINSTANCE unnamed1,LPCSTR unnamed2,LPWNDCLASSEXA unnamed3);
  39. BOOL WINAPI IsolationAwareGetClassInfoExW(HINSTANCE unnamed1,LPCWSTR unnamed2,LPWNDCLASSEXW unnamed3);
  40. HWND WINAPI IsolationAwareCreateWindowExA(DWORD dwExStyle,LPCSTR lpClassName,LPCSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam);
  41. HWND WINAPI IsolationAwareCreateWindowExW(DWORD dwExStyle,LPCWSTR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam);
  42. HWND WINAPI IsolationAwareCreateDialogParamA(HINSTANCE hInstance,LPCSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
  43. HWND WINAPI IsolationAwareCreateDialogParamW(HINSTANCE hInstance,LPCWSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
  44. HWND WINAPI IsolationAwareCreateDialogIndirectParamA(HINSTANCE hInstance,LPCDLGTEMPLATEA lpTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
  45. HWND WINAPI IsolationAwareCreateDialogIndirectParamW(HINSTANCE hInstance,LPCDLGTEMPLATEW lpTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
  46. INT_PTR WINAPI IsolationAwareDialogBoxParamA(HINSTANCE hInstance,LPCSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
  47. INT_PTR WINAPI IsolationAwareDialogBoxParamW(HINSTANCE hInstance,LPCWSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
  48. INT_PTR WINAPI IsolationAwareDialogBoxIndirectParamA(HINSTANCE hInstance,LPCDLGTEMPLATEA hDialogTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
  49. INT_PTR WINAPI IsolationAwareDialogBoxIndirectParamW(HINSTANCE hInstance,LPCDLGTEMPLATEW hDialogTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
  50. int WINAPI IsolationAwareMessageBoxA(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType);
  51. int WINAPI IsolationAwareMessageBoxW(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT uType);
  52. int WINAPI IsolationAwareMessageBoxExA(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType,WORD wLanguageId);
  53. int WINAPI IsolationAwareMessageBoxExW(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT uType,WORD wLanguageId);
  54. int WINAPI IsolationAwareMessageBoxIndirectA(const MSGBOXPARAMSA*unnamed1);
  55. int WINAPI IsolationAwareMessageBoxIndirectW(const MSGBOXPARAMSW*unnamed1);
  56. #if defined(UNICODE)
  57. #define IsolationAwareCreateDialogIndirectParam IsolationAwareCreateDialogIndirectParamW
  58. #define IsolationAwareCreateDialogParam IsolationAwareCreateDialogParamW
  59. #define IsolationAwareCreateWindowEx IsolationAwareCreateWindowExW
  60. #define IsolationAwareDialogBoxIndirectParam IsolationAwareDialogBoxIndirectParamW
  61. #define IsolationAwareDialogBoxParam IsolationAwareDialogBoxParamW
  62. #define IsolationAwareGetClassInfo IsolationAwareGetClassInfoW
  63. #define IsolationAwareGetClassInfoEx IsolationAwareGetClassInfoExW
  64. #define IsolationAwareMessageBox IsolationAwareMessageBoxW
  65. #define IsolationAwareMessageBoxEx IsolationAwareMessageBoxExW
  66. #define IsolationAwareMessageBoxIndirect IsolationAwareMessageBoxIndirectW
  67. #define IsolationAwareRegisterClass IsolationAwareRegisterClassW
  68. #define IsolationAwareRegisterClassEx IsolationAwareRegisterClassExW
  69. #define IsolationAwareUnregisterClass IsolationAwareUnregisterClassW
  70. #else /* UNICODE */
  71. #define IsolationAwareCreateDialogIndirectParam IsolationAwareCreateDialogIndirectParamA
  72. #define IsolationAwareCreateDialogParam IsolationAwareCreateDialogParamA
  73. #define IsolationAwareCreateWindowEx IsolationAwareCreateWindowExA
  74. #define IsolationAwareDialogBoxIndirectParam IsolationAwareDialogBoxIndirectParamA
  75. #define IsolationAwareDialogBoxParam IsolationAwareDialogBoxParamA
  76. #define IsolationAwareGetClassInfo IsolationAwareGetClassInfoA
  77. #define IsolationAwareGetClassInfoEx IsolationAwareGetClassInfoExA
  78. #define IsolationAwareMessageBox IsolationAwareMessageBoxA
  79. #define IsolationAwareMessageBoxEx IsolationAwareMessageBoxExA
  80. #define IsolationAwareMessageBoxIndirect IsolationAwareMessageBoxIndirectA
  81. #define IsolationAwareRegisterClass IsolationAwareRegisterClassA
  82. #define IsolationAwareRegisterClassEx IsolationAwareRegisterClassExA
  83. #define IsolationAwareUnregisterClass IsolationAwareUnregisterClassA
  84. #endif /* UNICODE */
  85. #if !ISOLATION_AWARE_USE_STATIC_LIBRARY
  86. ISOLATION_AWARE_INLINE ATOM WINAPI IsolationAwareRegisterClassA(const WNDCLASSA*lpWndClass)
  87. {
  88. ATOM result = 0 ;
  89. ULONG_PTR ulpCookie = 0;
  90. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  91. if (!fActivateActCtxSuccess)
  92. return result;
  93. __try
  94. {
  95. result = RegisterClassA(lpWndClass);
  96. }
  97. __finally
  98. {
  99. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  100. {
  101. const BOOL fPreserveLastError = (result == 0 );
  102. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  103. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  104. if (fPreserveLastError)
  105. SetLastError(dwLastError);
  106. }
  107. }
  108. return result;
  109. }
  110. ISOLATION_AWARE_INLINE ATOM WINAPI IsolationAwareRegisterClassW(const WNDCLASSW*lpWndClass)
  111. {
  112. ATOM result = 0 ;
  113. ULONG_PTR ulpCookie = 0;
  114. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  115. if (!fActivateActCtxSuccess)
  116. return result;
  117. __try
  118. {
  119. result = RegisterClassW(lpWndClass);
  120. }
  121. __finally
  122. {
  123. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  124. {
  125. const BOOL fPreserveLastError = (result == 0 );
  126. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  127. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  128. if (fPreserveLastError)
  129. SetLastError(dwLastError);
  130. }
  131. }
  132. return result;
  133. }
  134. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareUnregisterClassA(LPCSTR lpClassName,HINSTANCE hInstance)
  135. {
  136. BOOL fResult = FALSE;
  137. ULONG_PTR ulpCookie = 0;
  138. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  139. if (!fActivateActCtxSuccess)
  140. return fResult;
  141. __try
  142. {
  143. fResult = UnregisterClassA(lpClassName,hInstance);
  144. }
  145. __finally
  146. {
  147. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  148. {
  149. const BOOL fPreserveLastError = (fResult == FALSE);
  150. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  151. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  152. if (fPreserveLastError)
  153. SetLastError(dwLastError);
  154. }
  155. }
  156. return fResult;
  157. }
  158. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareUnregisterClassW(LPCWSTR lpClassName,HINSTANCE hInstance)
  159. {
  160. BOOL fResult = FALSE;
  161. ULONG_PTR ulpCookie = 0;
  162. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  163. if (!fActivateActCtxSuccess)
  164. return fResult;
  165. __try
  166. {
  167. fResult = UnregisterClassW(lpClassName,hInstance);
  168. }
  169. __finally
  170. {
  171. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  172. {
  173. const BOOL fPreserveLastError = (fResult == FALSE);
  174. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  175. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  176. if (fPreserveLastError)
  177. SetLastError(dwLastError);
  178. }
  179. }
  180. return fResult;
  181. }
  182. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareGetClassInfoA(HINSTANCE hInstance,LPCSTR lpClassName,LPWNDCLASSA lpWndClass)
  183. {
  184. BOOL fResult = FALSE;
  185. ULONG_PTR ulpCookie = 0;
  186. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  187. if (!fActivateActCtxSuccess)
  188. return fResult;
  189. __try
  190. {
  191. fResult = GetClassInfoA(hInstance,lpClassName,lpWndClass);
  192. }
  193. __finally
  194. {
  195. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  196. {
  197. const BOOL fPreserveLastError = (fResult == FALSE);
  198. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  199. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  200. if (fPreserveLastError)
  201. SetLastError(dwLastError);
  202. }
  203. }
  204. return fResult;
  205. }
  206. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareGetClassInfoW(HINSTANCE hInstance,LPCWSTR lpClassName,LPWNDCLASSW lpWndClass)
  207. {
  208. BOOL fResult = FALSE;
  209. ULONG_PTR ulpCookie = 0;
  210. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  211. if (!fActivateActCtxSuccess)
  212. return fResult;
  213. __try
  214. {
  215. fResult = GetClassInfoW(hInstance,lpClassName,lpWndClass);
  216. }
  217. __finally
  218. {
  219. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  220. {
  221. const BOOL fPreserveLastError = (fResult == FALSE);
  222. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  223. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  224. if (fPreserveLastError)
  225. SetLastError(dwLastError);
  226. }
  227. }
  228. return fResult;
  229. }
  230. ISOLATION_AWARE_INLINE ATOM WINAPI IsolationAwareRegisterClassExA(const WNDCLASSEXA*unnamed1)
  231. {
  232. ATOM result = 0 ;
  233. ULONG_PTR ulpCookie = 0;
  234. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  235. if (!fActivateActCtxSuccess)
  236. return result;
  237. __try
  238. {
  239. result = RegisterClassExA(unnamed1);
  240. }
  241. __finally
  242. {
  243. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  244. {
  245. const BOOL fPreserveLastError = (result == 0 );
  246. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  247. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  248. if (fPreserveLastError)
  249. SetLastError(dwLastError);
  250. }
  251. }
  252. return result;
  253. }
  254. ISOLATION_AWARE_INLINE ATOM WINAPI IsolationAwareRegisterClassExW(const WNDCLASSEXW*unnamed1)
  255. {
  256. ATOM result = 0 ;
  257. ULONG_PTR ulpCookie = 0;
  258. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  259. if (!fActivateActCtxSuccess)
  260. return result;
  261. __try
  262. {
  263. result = RegisterClassExW(unnamed1);
  264. }
  265. __finally
  266. {
  267. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  268. {
  269. const BOOL fPreserveLastError = (result == 0 );
  270. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  271. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  272. if (fPreserveLastError)
  273. SetLastError(dwLastError);
  274. }
  275. }
  276. return result;
  277. }
  278. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareGetClassInfoExA(HINSTANCE unnamed1,LPCSTR unnamed2,LPWNDCLASSEXA unnamed3)
  279. {
  280. BOOL fResult = FALSE;
  281. ULONG_PTR ulpCookie = 0;
  282. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  283. if (!fActivateActCtxSuccess)
  284. return fResult;
  285. __try
  286. {
  287. fResult = GetClassInfoExA(unnamed1,unnamed2,unnamed3);
  288. }
  289. __finally
  290. {
  291. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  292. {
  293. const BOOL fPreserveLastError = (fResult == FALSE);
  294. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  295. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  296. if (fPreserveLastError)
  297. SetLastError(dwLastError);
  298. }
  299. }
  300. return fResult;
  301. }
  302. ISOLATION_AWARE_INLINE BOOL WINAPI IsolationAwareGetClassInfoExW(HINSTANCE unnamed1,LPCWSTR unnamed2,LPWNDCLASSEXW unnamed3)
  303. {
  304. BOOL fResult = FALSE;
  305. ULONG_PTR ulpCookie = 0;
  306. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  307. if (!fActivateActCtxSuccess)
  308. return fResult;
  309. __try
  310. {
  311. fResult = GetClassInfoExW(unnamed1,unnamed2,unnamed3);
  312. }
  313. __finally
  314. {
  315. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  316. {
  317. const BOOL fPreserveLastError = (fResult == FALSE);
  318. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  319. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  320. if (fPreserveLastError)
  321. SetLastError(dwLastError);
  322. }
  323. }
  324. return fResult;
  325. }
  326. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareCreateWindowExA(DWORD dwExStyle,LPCSTR lpClassName,LPCSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam)
  327. {
  328. HWND windowResult = NULL;
  329. ULONG_PTR ulpCookie = 0;
  330. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  331. if (!fActivateActCtxSuccess)
  332. return windowResult;
  333. __try
  334. {
  335. windowResult = CreateWindowExA(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam);
  336. }
  337. __finally
  338. {
  339. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  340. {
  341. const BOOL fPreserveLastError = (windowResult == NULL);
  342. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  343. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  344. if (fPreserveLastError)
  345. SetLastError(dwLastError);
  346. }
  347. }
  348. return windowResult;
  349. }
  350. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareCreateWindowExW(DWORD dwExStyle,LPCWSTR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam)
  351. {
  352. HWND windowResult = NULL;
  353. ULONG_PTR ulpCookie = 0;
  354. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  355. if (!fActivateActCtxSuccess)
  356. return windowResult;
  357. __try
  358. {
  359. windowResult = CreateWindowExW(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam);
  360. }
  361. __finally
  362. {
  363. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  364. {
  365. const BOOL fPreserveLastError = (windowResult == NULL);
  366. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  367. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  368. if (fPreserveLastError)
  369. SetLastError(dwLastError);
  370. }
  371. }
  372. return windowResult;
  373. }
  374. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareCreateDialogParamA(HINSTANCE hInstance,LPCSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
  375. {
  376. HWND windowResult = NULL;
  377. ULONG_PTR ulpCookie = 0;
  378. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  379. if (!fActivateActCtxSuccess)
  380. return windowResult;
  381. __try
  382. {
  383. windowResult = CreateDialogParamA(hInstance,lpTemplateName,hWndParent,lpDialogFunc,dwInitParam);
  384. }
  385. __finally
  386. {
  387. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  388. {
  389. const BOOL fPreserveLastError = (windowResult == NULL);
  390. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  391. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  392. if (fPreserveLastError)
  393. SetLastError(dwLastError);
  394. }
  395. }
  396. return windowResult;
  397. }
  398. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareCreateDialogParamW(HINSTANCE hInstance,LPCWSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
  399. {
  400. HWND windowResult = NULL;
  401. ULONG_PTR ulpCookie = 0;
  402. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  403. if (!fActivateActCtxSuccess)
  404. return windowResult;
  405. __try
  406. {
  407. windowResult = CreateDialogParamW(hInstance,lpTemplateName,hWndParent,lpDialogFunc,dwInitParam);
  408. }
  409. __finally
  410. {
  411. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  412. {
  413. const BOOL fPreserveLastError = (windowResult == NULL);
  414. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  415. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  416. if (fPreserveLastError)
  417. SetLastError(dwLastError);
  418. }
  419. }
  420. return windowResult;
  421. }
  422. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareCreateDialogIndirectParamA(HINSTANCE hInstance,LPCDLGTEMPLATEA lpTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
  423. {
  424. HWND windowResult = NULL;
  425. ULONG_PTR ulpCookie = 0;
  426. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  427. if (!fActivateActCtxSuccess)
  428. return windowResult;
  429. __try
  430. {
  431. windowResult = CreateDialogIndirectParamA(hInstance,lpTemplate,hWndParent,lpDialogFunc,dwInitParam);
  432. }
  433. __finally
  434. {
  435. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  436. {
  437. const BOOL fPreserveLastError = (windowResult == NULL);
  438. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  439. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  440. if (fPreserveLastError)
  441. SetLastError(dwLastError);
  442. }
  443. }
  444. return windowResult;
  445. }
  446. ISOLATION_AWARE_INLINE HWND WINAPI IsolationAwareCreateDialogIndirectParamW(HINSTANCE hInstance,LPCDLGTEMPLATEW lpTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
  447. {
  448. HWND windowResult = NULL;
  449. ULONG_PTR ulpCookie = 0;
  450. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  451. if (!fActivateActCtxSuccess)
  452. return windowResult;
  453. __try
  454. {
  455. windowResult = CreateDialogIndirectParamW(hInstance,lpTemplate,hWndParent,lpDialogFunc,dwInitParam);
  456. }
  457. __finally
  458. {
  459. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  460. {
  461. const BOOL fPreserveLastError = (windowResult == NULL);
  462. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  463. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  464. if (fPreserveLastError)
  465. SetLastError(dwLastError);
  466. }
  467. }
  468. return windowResult;
  469. }
  470. ISOLATION_AWARE_INLINE INT_PTR WINAPI IsolationAwareDialogBoxParamA(HINSTANCE hInstance,LPCSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
  471. {
  472. INT_PTR nResult = -1;
  473. ULONG_PTR ulpCookie = 0;
  474. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  475. if (!fActivateActCtxSuccess)
  476. return nResult;
  477. __try
  478. {
  479. nResult = DialogBoxParamA(hInstance,lpTemplateName,hWndParent,lpDialogFunc,dwInitParam);
  480. }
  481. __finally
  482. {
  483. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  484. {
  485. const BOOL fPreserveLastError = (nResult == -1);
  486. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  487. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  488. if (fPreserveLastError)
  489. SetLastError(dwLastError);
  490. }
  491. }
  492. return nResult;
  493. }
  494. ISOLATION_AWARE_INLINE INT_PTR WINAPI IsolationAwareDialogBoxParamW(HINSTANCE hInstance,LPCWSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
  495. {
  496. INT_PTR nResult = -1;
  497. ULONG_PTR ulpCookie = 0;
  498. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  499. if (!fActivateActCtxSuccess)
  500. return nResult;
  501. __try
  502. {
  503. nResult = DialogBoxParamW(hInstance,lpTemplateName,hWndParent,lpDialogFunc,dwInitParam);
  504. }
  505. __finally
  506. {
  507. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  508. {
  509. const BOOL fPreserveLastError = (nResult == -1);
  510. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  511. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  512. if (fPreserveLastError)
  513. SetLastError(dwLastError);
  514. }
  515. }
  516. return nResult;
  517. }
  518. ISOLATION_AWARE_INLINE INT_PTR WINAPI IsolationAwareDialogBoxIndirectParamA(HINSTANCE hInstance,LPCDLGTEMPLATEA hDialogTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
  519. {
  520. INT_PTR nResult = -1;
  521. ULONG_PTR ulpCookie = 0;
  522. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  523. if (!fActivateActCtxSuccess)
  524. return nResult;
  525. __try
  526. {
  527. nResult = DialogBoxIndirectParamA(hInstance,hDialogTemplate,hWndParent,lpDialogFunc,dwInitParam);
  528. }
  529. __finally
  530. {
  531. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  532. {
  533. const BOOL fPreserveLastError = (nResult == -1);
  534. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  535. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  536. if (fPreserveLastError)
  537. SetLastError(dwLastError);
  538. }
  539. }
  540. return nResult;
  541. }
  542. ISOLATION_AWARE_INLINE INT_PTR WINAPI IsolationAwareDialogBoxIndirectParamW(HINSTANCE hInstance,LPCDLGTEMPLATEW hDialogTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
  543. {
  544. INT_PTR nResult = -1;
  545. ULONG_PTR ulpCookie = 0;
  546. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  547. if (!fActivateActCtxSuccess)
  548. return nResult;
  549. __try
  550. {
  551. nResult = DialogBoxIndirectParamW(hInstance,hDialogTemplate,hWndParent,lpDialogFunc,dwInitParam);
  552. }
  553. __finally
  554. {
  555. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  556. {
  557. const BOOL fPreserveLastError = (nResult == -1);
  558. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  559. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  560. if (fPreserveLastError)
  561. SetLastError(dwLastError);
  562. }
  563. }
  564. return nResult;
  565. }
  566. ISOLATION_AWARE_INLINE int WINAPI IsolationAwareMessageBoxA(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType)
  567. {
  568. int nResult = 0 ;
  569. ULONG_PTR ulpCookie = 0;
  570. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  571. if (!fActivateActCtxSuccess)
  572. return nResult;
  573. __try
  574. {
  575. nResult = MessageBoxA(hWnd,lpText,lpCaption,uType);
  576. }
  577. __finally
  578. {
  579. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  580. {
  581. const BOOL fPreserveLastError = (nResult == 0 );
  582. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  583. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  584. if (fPreserveLastError)
  585. SetLastError(dwLastError);
  586. }
  587. }
  588. return nResult;
  589. }
  590. ISOLATION_AWARE_INLINE int WINAPI IsolationAwareMessageBoxW(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT uType)
  591. {
  592. int nResult = 0 ;
  593. ULONG_PTR ulpCookie = 0;
  594. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  595. if (!fActivateActCtxSuccess)
  596. return nResult;
  597. __try
  598. {
  599. nResult = MessageBoxW(hWnd,lpText,lpCaption,uType);
  600. }
  601. __finally
  602. {
  603. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  604. {
  605. const BOOL fPreserveLastError = (nResult == 0 );
  606. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  607. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  608. if (fPreserveLastError)
  609. SetLastError(dwLastError);
  610. }
  611. }
  612. return nResult;
  613. }
  614. ISOLATION_AWARE_INLINE int WINAPI IsolationAwareMessageBoxExA(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType,WORD wLanguageId)
  615. {
  616. int nResult = 0 ;
  617. ULONG_PTR ulpCookie = 0;
  618. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  619. if (!fActivateActCtxSuccess)
  620. return nResult;
  621. __try
  622. {
  623. nResult = MessageBoxExA(hWnd,lpText,lpCaption,uType,wLanguageId);
  624. }
  625. __finally
  626. {
  627. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  628. {
  629. const BOOL fPreserveLastError = (nResult == 0 );
  630. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  631. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  632. if (fPreserveLastError)
  633. SetLastError(dwLastError);
  634. }
  635. }
  636. return nResult;
  637. }
  638. ISOLATION_AWARE_INLINE int WINAPI IsolationAwareMessageBoxExW(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT uType,WORD wLanguageId)
  639. {
  640. int nResult = 0 ;
  641. ULONG_PTR ulpCookie = 0;
  642. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  643. if (!fActivateActCtxSuccess)
  644. return nResult;
  645. __try
  646. {
  647. nResult = MessageBoxExW(hWnd,lpText,lpCaption,uType,wLanguageId);
  648. }
  649. __finally
  650. {
  651. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  652. {
  653. const BOOL fPreserveLastError = (nResult == 0 );
  654. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  655. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  656. if (fPreserveLastError)
  657. SetLastError(dwLastError);
  658. }
  659. }
  660. return nResult;
  661. }
  662. ISOLATION_AWARE_INLINE int WINAPI IsolationAwareMessageBoxIndirectA(const MSGBOXPARAMSA*unnamed1)
  663. {
  664. int nResult = 0 ;
  665. ULONG_PTR ulpCookie = 0;
  666. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  667. if (!fActivateActCtxSuccess)
  668. return nResult;
  669. __try
  670. {
  671. nResult = MessageBoxIndirectA(unnamed1);
  672. }
  673. __finally
  674. {
  675. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  676. {
  677. const BOOL fPreserveLastError = (nResult == 0 );
  678. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  679. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  680. if (fPreserveLastError)
  681. SetLastError(dwLastError);
  682. }
  683. }
  684. return nResult;
  685. }
  686. ISOLATION_AWARE_INLINE int WINAPI IsolationAwareMessageBoxIndirectW(const MSGBOXPARAMSW*unnamed1)
  687. {
  688. int nResult = 0 ;
  689. ULONG_PTR ulpCookie = 0;
  690. const BOOL fActivateActCtxSuccess = IsolationAwarePrivateT_SqbjaYRiRY || IsolationAwarePrivatenPgViNgRzlnPgpgk(&ulpCookie);
  691. if (!fActivateActCtxSuccess)
  692. return nResult;
  693. __try
  694. {
  695. nResult = MessageBoxIndirectW(unnamed1);
  696. }
  697. __finally
  698. {
  699. if (!IsolationAwarePrivateT_SqbjaYRiRY)
  700. {
  701. const BOOL fPreserveLastError = (nResult == 0 );
  702. const DWORD dwLastError = fPreserveLastError ? GetLastError() : NO_ERROR;
  703. (void)IsolationAwareDeactivateActCtx(0, ulpCookie);
  704. if (fPreserveLastError)
  705. SetLastError(dwLastError);
  706. }
  707. }
  708. return nResult;
  709. }
  710. ISOLATION_AWARE_INLINE FARPROC WINAPI WinuserIsolationAwarePrivatetRgCebPnQQeRff_HfReQP_QYY(LPCSTR pszProcName)
  711. /* This function is shared by the other stubs in this header. */
  712. {
  713. static HMODULE s_module;
  714. const static IsolationAwarePrivatepBAFGnAG_zBqHyr_vAsB
  715. c = { IsolationAwarePrivatezlybNQyVOeNeln, IsolationAwarePrivatezlybNQyVOeNelJ, "User32.dll", L"User32.dll" };
  716. static IsolationAwarePrivatezHGnoyr_zBqHyr_vAsB m;
  717. return IsolationAwarePrivatezltRgCebPnQQeRff(&c, &m, pszProcName);
  718. }
  719. #endif /* ISOLATION_AWARE_USE_STATIC_LIBRARY */
  720. #define CreateDialogIndirectParamA IsolationAwareCreateDialogIndirectParamA
  721. #define CreateDialogIndirectParamW IsolationAwareCreateDialogIndirectParamW
  722. #define CreateDialogParamA IsolationAwareCreateDialogParamA
  723. #define CreateDialogParamW IsolationAwareCreateDialogParamW
  724. #define CreateWindowExA IsolationAwareCreateWindowExA
  725. #define CreateWindowExW IsolationAwareCreateWindowExW
  726. #define DialogBoxIndirectParamA IsolationAwareDialogBoxIndirectParamA
  727. #define DialogBoxIndirectParamW IsolationAwareDialogBoxIndirectParamW
  728. #define DialogBoxParamA IsolationAwareDialogBoxParamA
  729. #define DialogBoxParamW IsolationAwareDialogBoxParamW
  730. /* GetClassInfoA skipped, as it is a popular C++ member function name. */
  731. #define GetClassInfoExA IsolationAwareGetClassInfoExA
  732. #define GetClassInfoExW IsolationAwareGetClassInfoExW
  733. /* GetClassInfoW skipped, as it is a popular C++ member function name. */
  734. /* MessageBoxA skipped, as it is a popular C++ member function name. */
  735. #define MessageBoxExA IsolationAwareMessageBoxExA
  736. #define MessageBoxExW IsolationAwareMessageBoxExW
  737. #define MessageBoxIndirectA IsolationAwareMessageBoxIndirectA
  738. #define MessageBoxIndirectW IsolationAwareMessageBoxIndirectW
  739. /* MessageBoxW skipped, as it is a popular C++ member function name. */
  740. #define RegisterClassA IsolationAwareRegisterClassA
  741. #define RegisterClassExA IsolationAwareRegisterClassExA
  742. #define RegisterClassExW IsolationAwareRegisterClassExW
  743. #define RegisterClassW IsolationAwareRegisterClassW
  744. #define UnregisterClassA IsolationAwareUnregisterClassA
  745. #define UnregisterClassW IsolationAwareUnregisterClassW
  746. #endif /* ISOLATION_AWARE_ENABLED */
  747. #endif /* RC */
  748. #if defined(__cplusplus)
  749. } /* __cplusplus */
  750. #endif