Skip to content

Commit

Permalink
Add changes to allow Qt Creator 7.0.1 MinGW to run on Windows 7
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianadam committed May 9, 2022
1 parent 79934bf commit f6d577b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.15)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>: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)
19 changes: 13 additions & 6 deletions api-ms-win-core-synch-l1-2-0.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <Windows.h>
#include <string.h>
#define DLLAPI __declspec(dllexport)

typedef struct _ADDR_CVAR_ASSOC {
volatile VOID *Address;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -104,7 +103,7 @@ DLLAPI BOOL WINAPI WaitOnAddress(
return ReturnValue;
}

DLLAPI void WINAPI WakeByAddressAll(
void WINAPI WakeByAddressAll(
_In_ PVOID Address)
{
SIZE_T idxAddrCVarAssoc;
Expand All @@ -120,7 +119,7 @@ DLLAPI void WINAPI WakeByAddressAll(
return;
}

DLLAPI void WINAPI WakeByAddressSingle(
void WINAPI WakeByAddressSingle(
_In_ PVOID Address)
{
SIZE_T idxAddrCVarAssoc;
Expand All @@ -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")
Expand All @@ -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")
#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")
19 changes: 19 additions & 0 deletions dxgi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <Windows.h>

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")

0 comments on commit f6d577b

Please sign in to comment.