diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..714b79e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) + +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + +project(windows7) + +add_library(api-ms-win-core-synch-l1-2-0 SHARED api-ms-win-core-synch-l1-2-0.c) +install(TARGETS api-ms-win-core-synch-l1-2-0) + +add_library(dxgi SHARED dxgi.c) +install(TARGETS dxgi) diff --git a/api-ms-win-core-synch-l1-2-0.c b/api-ms-win-core-synch-l1-2-0.c index dd2781b..72ff4e7 100644 --- a/api-ms-win-core-synch-l1-2-0.c +++ b/api-ms-win-core-synch-l1-2-0.c @@ -1,6 +1,5 @@ #include #include -#define DLLAPI __declspec(dllexport) typedef struct _ADDR_CVAR_ASSOC { volatile VOID *Address; @@ -42,7 +41,7 @@ static BOOL CompareVolatileMemory(const volatile void *A1, const void *A2, size_ } } -DLLAPI BOOL WINAPI WaitOnAddress( +BOOL WINAPI WaitOnAddress( _In_ volatile VOID *Address, _In_ PVOID CompareAddress, _In_ SIZE_T AddressSize, @@ -104,7 +103,7 @@ DLLAPI BOOL WINAPI WaitOnAddress( return ReturnValue; } -DLLAPI void WINAPI WakeByAddressAll( +void WINAPI WakeByAddressAll( _In_ PVOID Address) { SIZE_T idxAddrCVarAssoc; @@ -120,7 +119,7 @@ DLLAPI void WINAPI WakeByAddressAll( return; } -DLLAPI void WINAPI WakeByAddressSingle( +void WINAPI WakeByAddressSingle( _In_ PVOID Address) { SIZE_T idxAddrCVarAssoc; @@ -136,8 +135,12 @@ DLLAPI void WINAPI WakeByAddressSingle( return; } +#pragma comment(linker, "/export:WaitOnAddress") +#pragma comment(linker, "/export:WakeByAddressAll") +#pragma comment(linker, "/export:WakeByAddressSingle") + #pragma comment(linker, "/export:CancelWaitableTimer=kernel32.CancelWaitableTimer") -#pragma comment(linker, "/export:CreateEventA=kernel32.CreateEventA") +#pragma comment(linker, "/export:CreateEventW=kernel32.CreateEventW") #pragma comment(linker, "/export:EnterCriticalSection=kernel32.EnterCriticalSection") #pragma comment(linker, "/export:InitializeConditionVariable=kernel32.InitializeConditionVariable") #pragma comment(linker, "/export:InitializeCriticalSection=kernel32.InitializeCriticalSection") @@ -149,4 +152,8 @@ DLLAPI void WINAPI WakeByAddressSingle( #pragma comment(linker, "/export:Sleep=kernel32.Sleep") #pragma comment(linker, "/export:SleepConditionVariableCS=kernel32.SleepConditionVariableCS") #pragma comment(linker, "/export:TryEnterCriticalSection=kernel32.TryEnterCriticalSection") -#pragma comment(linker, "/export:WakeAllConditionVariable=kernel32.WakeAllConditionVariable") \ No newline at end of file +#pragma comment(linker, "/export:WakeAllConditionVariable=kernel32.WakeAllConditionVariable") +#pragma comment(linker, "/export:ReleaseSemaphore=kernel32.ReleaseSemaphore") +#pragma comment(linker, "/export:WaitForMultipleObjectsEx=kernel32.WaitForMultipleObjectsEx") +#pragma comment(linker, "/export:WaitForSingleObject=kernel32.WaitForSingleObject") +#pragma comment(linker, "/export:WaitForSingleObjectEx=kernel32.WaitForSingleObjectEx") diff --git a/dxgi.c b/dxgi.c new file mode 100644 index 0000000..f0245d7 --- /dev/null +++ b/dxgi.c @@ -0,0 +1,19 @@ +#include + +HRESULT CreateDXGIFactory2( + UINT Flags, + REFIID riid, + void **ppFactory) +{ + return E_FAIL; +} + +HRESULT CreateDXGIFactory1( + REFIID riid, + void **ppFactory) +{ + return E_FAIL; +} + +#pragma comment(linker, "/export:CreateDXGIFactory1") +#pragma comment(linker, "/export:CreateDXGIFactory2")