Skip to content

Commit

Permalink
Oh Yeah Yeah
Browse files Browse the repository at this point in the history
  • Loading branch information
freedom7341 committed Jul 25, 2024
1 parent 7fd104b commit 35640b9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CscdCfg/CscdCfg.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -109,6 +110,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -125,6 +127,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -141,6 +144,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
3 changes: 3 additions & 0 deletions CscdCom/build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mc -U error.mc
rc -r error.rc
link -dll -noentry -out:error.dll error.res
Binary file added CscdCom/error.dll
Binary file not shown.
4 changes: 3 additions & 1 deletion CscdCom/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ For information relating to the error files,
see:
https://learn.microsoft.com/en-us/windows/win3
2/services/the-complete-service-sample
under "Building the Service."
under "Building the Service."

Run build.cmd to build the error message DLL and files
4 changes: 4 additions & 0 deletions CscdSvc/CscdSvc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -109,6 +110,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -125,6 +127,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -141,6 +144,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
5 changes: 5 additions & 0 deletions CscdSvc/hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ __declspec(dllexport) BOOL CALLBACK InstallUserHook()
WCHAR szFullPath[MAX_PATH];
USERAPIHOOKINFO uah;

MessageBox(NULL, L"test", L"InstallUserHook called", MB_OK);
OutputDebugString(L"InstallUserHook called\n");

// Get the module
g_hModule = GetModuleHandle(NULL);

// Get our current directory and filename
GetModuleFileName(g_hModule, szFullPath, ARRAYSIZE(szFullPath));

Expand Down Expand Up @@ -150,6 +154,7 @@ __declspec(dllexport) BOOL CALLBACK InitUserHook(UAPIHK State, PUSERAPIHOOK puah
\* * * */
__declspec(dllexport) BOOL CALLBACK RemoveUserHook(VOID)
{
MessageBox(NULL, L"test", L"RemoveUserHook called", MB_OK);
return UnregisterUserApiHookDelay();
}

Expand Down

0 comments on commit 35640b9

Please sign in to comment.