Initial
This commit is contained in:
41
proto/mykernel.cpp
Normal file
41
proto/mykernel.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include <common/windows.hpp>
|
||||
#include <common/file.hpp>
|
||||
|
||||
int processCount=0;
|
||||
File outFile;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
__declspec(dllexport) FARPROC PASCAL GetProcAddress(HMODULE hModule,LPCSTR lpProcName);
|
||||
// __declspec(dllexport) HMODULE PASCAL GetModuleHandle(LPCTSTR lpModuleName);
|
||||
// __declspec(dllexport) HMODULE PASCAL LoadLibrary(LPCTSTR lpModuleName);
|
||||
}
|
||||
|
||||
BOOL WINAPI DLLMain(HINSTANCE hDLLInst,DWORD dwReason,LPVOID lpReserved)
|
||||
{
|
||||
switch(dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH :
|
||||
if(!processCount)outFile.open("mykernel.log","wb");
|
||||
outFile.writeLine("Process attach");
|
||||
outFile.flush();
|
||||
processCount++;
|
||||
break;
|
||||
case DLL_PROCESS_DETACH :
|
||||
if(processCount)outFile.writeLine("Process detach");
|
||||
if(--processCount<=0)outFile.close();
|
||||
break;
|
||||
case DLL_THREAD_ATTACH :
|
||||
break;
|
||||
case DLL_THREAD_DETACH :
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//FARPROC PASCAL GetProcAddress(HMODULE hModule,LPCSTR lpProcName)
|
||||
//{
|
||||
// return 0;
|
||||
//}
|
||||
Reference in New Issue
Block a user