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.

791 lines
30 KiB

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