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.

32 lines
827 B

  1. //+-------------------------------------------------------------------------
  2. // Microsoft Windows
  3. //
  4. // Copyright (C) Microsoft Corporation, 1995 - 1999
  5. //
  6. // File: pkicrit.cpp
  7. //
  8. // Contents: PKI CriticalSection Functions
  9. //
  10. // Functions: Pki_InitializeCriticalSection
  11. //
  12. // History: 23-Aug-99 philh created
  13. //--------------------------------------------------------------------------
  14. #include "global.hxx"
  15. BOOL
  16. WINAPI
  17. Pki_InitializeCriticalSection(
  18. OUT LPCRITICAL_SECTION lpCriticalSection
  19. )
  20. {
  21. __try {
  22. InitializeCriticalSection(lpCriticalSection);
  23. } __except(EXCEPTION_EXECUTE_HANDLER) {
  24. memset(lpCriticalSection, 0, sizeof(*lpCriticalSection));
  25. SetLastError(GetExceptionCode());
  26. return FALSE;
  27. }
  28. return TRUE;
  29. }