Skip to content

Commit 6b25a8a

Browse files
committed
Fix core library
1 parent 27da9bb commit 6b25a8a

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

TOVR/C++/TOVR/TOVR.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ DLLEXPORT DWORD __stdcall SetControllerData(__in INT dwIndex, __in DWORD MotorSp
4646
DLLEXPORT DWORD __stdcall SetCentering(__in int dwIndex);
4747

4848
HMODULE hDll;
49-
bool Init = false;
5049

5150
void DriverAttach() {
5251
CRegKey key;
@@ -90,29 +89,27 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReser
9089
{
9190
switch (ul_reason_for_call)
9291
{
93-
case DLL_PROCESS_ATTACH: //DriverAttach();
92+
case DLL_PROCESS_ATTACH: {
93+
DriverAttach();
94+
break;
95+
}
9496

9597
case DLL_PROCESS_DETACH: {
9698
if (hDll != NULL) {
9799
FreeLibrary(hDll);
98100
hDll = nullptr;
99101
}
102+
break;
100103
}
101104

102105
//case DLL_THREAD_ATTACH:
103106
//case DLL_THREAD_DETACH:
104-
break;
105107
}
106108
return TRUE;
107109
}
108110

109111
DLLEXPORT DWORD __stdcall GetHMDData(__out THMD* myHMD)
110112
{
111-
112-
if (Init == false) { //Temporary solution, DllMain is not called
113-
Init = true;
114-
DriverAttach();
115-
}
116113

117114
if (hDll != NULL) {
118115
return DriverGetHMDData(myHMD);

0 commit comments

Comments
 (0)