Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
795 B

  1. #include <windows.h>
  2. #include <stdlib.h>
  3. int
  4. _cdecl
  5. main(
  6. int argc,
  7. char *argv[]
  8. )
  9. {
  10. FARPROC lpProc;
  11. HMODULE hLib = NULL;
  12. BOOL Result = FALSE;
  13. //
  14. // load the client-side user-mode PnP manager DLL
  15. //
  16. hLib = LoadLibrary(TEXT("cfgmgr32.dll"));
  17. if (hLib != NULL) {
  18. lpProc = GetProcAddress( hLib, "CMP_Report_LogOn" );
  19. if (lpProc != NULL) {
  20. //
  21. // Ping the user-mode pnp manager -
  22. // pass the private id as a parameter
  23. //
  24. Result = (lpProc)(0x07020420, GetCurrentProcessId()) ? TRUE : FALSE;
  25. }
  26. FreeLibrary( hLib );
  27. }
  28. if (Result)
  29. return 0;
  30. else
  31. return 1 ;
  32. }