mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-14 22:03:27 +01:00
add temporary registry keys
This commit is contained in:
parent
dfca31fab9
commit
79b8b4d083
@ -49,6 +49,7 @@
|
||||
<ClCompile Include="src\IDirect3D\IDirect3D7.c" />
|
||||
<ClCompile Include="src\IAMMediaStream\IAMMediaStream.c" />
|
||||
<ClCompile Include="src\IDirectDraw\IDirectDrawGammaControl.c" />
|
||||
<ClCompile Include="src\indeo.c" />
|
||||
<ClCompile Include="src\ini.c" />
|
||||
<ClCompile Include="src\utils.c" />
|
||||
<ClCompile Include="src\hook.c" />
|
||||
@ -84,6 +85,7 @@
|
||||
<ClInclude Include="inc\IDirect3D.h" />
|
||||
<ClInclude Include="inc\IAMMediaStream.h" />
|
||||
<ClInclude Include="inc\IDirectDrawGammaControl.h" />
|
||||
<ClInclude Include="inc\indeo.h" />
|
||||
<ClInclude Include="inc\ini.h" />
|
||||
<ClInclude Include="inc\patch.h" />
|
||||
<ClInclude Include="inc\utils.h" />
|
||||
|
@ -162,6 +162,9 @@
|
||||
<ClCompile Include="src\versionhelpers.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\indeo.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="inc\debug.h">
|
||||
@ -281,6 +284,9 @@
|
||||
<ClInclude Include="inc\versionhelpers.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="inc\indeo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="res.rc">
|
||||
|
7
inc/indeo.h
Normal file
7
inc/indeo.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef INDEO_H
|
||||
#define INDEO_H
|
||||
|
||||
void indeo_enable();
|
||||
void indeo_disable();
|
||||
|
||||
#endif
|
@ -9,6 +9,7 @@
|
||||
#include "debug.h"
|
||||
#include "config.h"
|
||||
#include "hook.h"
|
||||
#include "indeo.h"
|
||||
#include "versionhelpers.h"
|
||||
|
||||
|
||||
@ -120,6 +121,7 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||
set_aware();
|
||||
}
|
||||
|
||||
indeo_enable();
|
||||
timeBeginPeriod(1);
|
||||
hook_init();
|
||||
break;
|
||||
@ -133,6 +135,7 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||
|
||||
cfg_save();
|
||||
|
||||
indeo_disable();
|
||||
timeEndPeriod(1);
|
||||
dinput_hook_exit();
|
||||
hook_exit();
|
||||
|
61
src/indeo.c
Normal file
61
src/indeo.c
Normal file
@ -0,0 +1,61 @@
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
void indeo_enable()
|
||||
{
|
||||
HKEY hkey;
|
||||
LONG status =
|
||||
RegCreateKeyExA(
|
||||
HKEY_CURRENT_USER,
|
||||
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32",
|
||||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_WRITE | KEY_QUERY_VALUE,
|
||||
NULL,
|
||||
&hkey,
|
||||
NULL);
|
||||
|
||||
if (status == ERROR_SUCCESS)
|
||||
{
|
||||
LPCTSTR iv31 = "ir32_32.dll";
|
||||
RegSetValueExA(hkey, "vidc.iv31", 0, REG_SZ, iv31, strlen(iv31) + 1);
|
||||
|
||||
LPCTSTR iv32 = "ir32_32.dll";
|
||||
RegSetValueExA(hkey, "vidc.iv32", 0, REG_SZ, iv32, strlen(iv32) + 1);
|
||||
|
||||
LPCTSTR iv41 = "ir41_32.ax";
|
||||
RegSetValueExA(hkey, "vidc.iv41", 0, REG_SZ, iv41, strlen(iv41) + 1);
|
||||
|
||||
LPCTSTR iv50 = "ir50_32.dll";
|
||||
RegSetValueExA(hkey, "vidc.iv50", 0, REG_SZ, iv50, strlen(iv50) + 1);
|
||||
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
}
|
||||
|
||||
void indeo_disable()
|
||||
{
|
||||
HKEY hkey;
|
||||
LONG status =
|
||||
RegCreateKeyExA(
|
||||
HKEY_CURRENT_USER,
|
||||
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32",
|
||||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_WRITE | KEY_QUERY_VALUE,
|
||||
NULL,
|
||||
&hkey,
|
||||
NULL);
|
||||
|
||||
if (status == ERROR_SUCCESS)
|
||||
{
|
||||
RegDeleteValueA(hkey, "vidc.iv31");
|
||||
RegDeleteValueA(hkey, "vidc.iv32");
|
||||
RegDeleteValueA(hkey, "vidc.iv41");
|
||||
RegDeleteValueA(hkey, "vidc.iv50");
|
||||
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user