Created
November 6, 2009 00:31
-
-
Save cotsog/227555 to your computer and use it in GitHub Desktop.
Apply this patch to ATL 7.1 bundled with the Windows Driver Kit to be able to compile Google Chrome with Visaul C++ 2008 Express Edition. See http://bit.ly/30slOj for more details.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- C:/Documents and Settings/user/Desktop/atlstdthunk.h Wed Oct 21 21:29:23 2009 | |
+++ C:/WinDDK/6001.18002/inc/crt/atl71/atlstdthunk.h Wed Oct 21 21:28:19 2009 | |
@@ -40,8 +40,8 @@ | |
// Thunks for __stdcall member functions | |
#if defined(_M_IX86) | |
-PVOID __stdcall __AllocStdCallThunk(VOID); | |
-VOID __stdcall __FreeStdCallThunk(PVOID); | |
+void* __stdcall __AllocStdCallThunk(); | |
+void __stdcall __FreeStdCallThunk(void* ptr); | |
#pragma pack(push,1) | |
struct _stdcallthunk | |
@@ -76,9 +76,23 @@ | |
} | |
}; | |
#pragma pack(pop) | |
+ | |
+inline void* __stdcall __AllocStdCallThunk() | |
+{ | |
+ LPVOID mem = VirtualAlloc(0, sizeof(_stdcallthunk), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); | |
+ if (!mem) return 0; | |
+ return mem; | |
+} | |
+ | |
+inline void __stdcall __FreeStdCallThunk(void* ptr) | |
+{ | |
+ if (!ptr) return; | |
+ VirtualFree(ptr, 0, MEM_RELEASE); | |
+} | |
+ | |
#elif defined(_M_AMD64) | |
-PVOID __AllocStdCallThunk(VOID); | |
-VOID __FreeStdCallThunk(PVOID); | |
+void* __AllocStdCallThunk(); | |
+void __FreeStdCallThunk(void* ptr); | |
#pragma pack(push,2) | |
struct _stdcallthunk | |
{ | |
@@ -112,6 +126,20 @@ | |
} | |
}; | |
#pragma pack(pop) | |
+ | |
+inline void* __AllocStdCallThunk() | |
+{ | |
+ LPVOID mem = VirtualAlloc(0, sizeof(_stdcallthunk), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); | |
+ if (!mem) return 0; | |
+ return mem; | |
+} | |
+ | |
+inline void __FreeStdCallThunk(void* ptr) | |
+{ | |
+ if (!ptr) return; | |
+ VirtualFree(ptr, 0, MEM_RELEASE); | |
+} | |
+ | |
#elif defined (_M_ALPHA) | |
// For ALPHA we will stick the this pointer into a0, which is where | |
// the HWND is. However, we don't actually need the HWND so this is OK. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment