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.

44 lines
1.3 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright � Microsoft Corporation. All rights reserved.
  4. //
  5. // CreateMutexAsProcess.h
  6. //
  7. // Purpose: Create a mutex NOT using impersonation
  8. //
  9. //***************************************************************************
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #ifndef _CREATE_PROCESS_AS_MUTEX_
  14. #define _CREATE_PROCESS_AS_MUTEX_
  15. ///////////////////////////////////////////////////////////////////
  16. // Creates a specified mutex under the process account context.
  17. //
  18. // Uses construction/destruction semantics - just declare one
  19. // on the stack, scoped around the area where you are making
  20. // calls that could cause the deadlock;
  21. //////////////////////////////////////////////////////////////////
  22. class POLARITY CreateMutexAsProcess
  23. {
  24. public:
  25. CreateMutexAsProcess(const WCHAR *cszMutexName);
  26. ~CreateMutexAsProcess();
  27. private:
  28. HANDLE m_hMutex;
  29. };
  30. // This Mutex should be instanciated around any calls to
  31. // LookupAccountSid, LookupAccountName,
  32. //
  33. #define SECURITYAPIMUTEXNAME L"Cimom NT Security API protector"
  34. // Used by provider.cpp
  35. #define WBEMPROVIDERSTATICMUTEX L"WBEMPROVIDERSTATICMUTEX"
  36. // Used by all perfmon routines.
  37. #define WBEMPERFORMANCEDATAMUTEX L"WbemPerformanceDataMutex"
  38. #endif