Reactos
at master 74 lines 1.4 kB view raw
1/* 2 * PROJECT: ReactOS Process Status Helper Library 3 * LICENSE: MIT (https://spdx.org/licenses/MIT) 4 * PURPOSE: PSAPI Win2k3 style entrypoint 5 * COPYRIGHT: Copyright 2013 Pierre Schweitzer <pierre@reactos.org> 6 */ 7 8#include <stdarg.h> 9 10#define WIN32_NO_STATUS 11#include <windef.h> 12#include <winbase.h> 13#define NTOS_MODE_USER 14#include <ndk/psfuncs.h> 15#include <ndk/rtlfuncs.h> 16 17#include <psapi.h> 18 19#define NDEBUG 20#include <debug.h> 21 22static 23VOID 24NTAPI 25PsParseCommandLine(VOID) 26{ 27 UNIMPLEMENTED; 28} 29 30static 31VOID 32NTAPI 33PsInitializeAndStartProfile(VOID) 34{ 35 UNIMPLEMENTED; 36} 37 38static 39VOID 40NTAPI 41PsStopAndAnalyzeProfile(VOID) 42{ 43 UNIMPLEMENTED; 44} 45 46/* 47 * @implemented 48 */ 49BOOLEAN 50WINAPI 51DllMain(HINSTANCE hDllHandle, 52 DWORD nReason, 53 LPVOID Reserved) 54{ 55 switch(nReason) 56 { 57 case DLL_PROCESS_ATTACH: 58 DisableThreadLibraryCalls(hDllHandle); 59 if (NtCurrentPeb()->ProcessParameters->Flags & RTL_USER_PROCESS_PARAMETERS_PROFILE_USER) 60 { 61 PsParseCommandLine(); 62 PsInitializeAndStartProfile(); 63 } 64 break; 65 66 case DLL_PROCESS_DETACH: 67 if (NtCurrentPeb()->ProcessParameters->Flags & RTL_USER_PROCESS_PARAMETERS_PROFILE_USER) 68 { 69 PsStopAndAnalyzeProfile(); 70 } 71 break; 72 } 73 return TRUE; 74}