Source code of Windows XP (NT5)
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.

61 lines
1.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: spcmem.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _SPCMEM_H
  11. #define _SPCMEM_H
  12. #if defined(__cplusplus) && defined(TRYTHROW)
  13. class PkiError {
  14. public:
  15. PkiError(HRESULT err = E_UNEXPECTED)
  16. { pkiError = err; }
  17. HRESULT pkiError;
  18. };
  19. #else
  20. typedef struct _PkiError {
  21. HRESULT pkiError;
  22. } PkiError;
  23. #endif
  24. #if defined(DBG) && defined(__cplusplus) && defined(TRYTHROW)
  25. #define PKITRY try
  26. #define PKITHROW(x) throw PkiError(x); //
  27. #define PKICATCH(x) catch (PkiError x)
  28. #define PKIEND //
  29. #else
  30. #define PKITRY HRESULT _tpkiError;
  31. #define PKITHROW(x) {_tpkiError = x; goto PKIERROR;} //
  32. #define PKICATCH(x) goto PKICONT; PKIERROR: { PkiError x; x.pkiError = _tpkiError;
  33. #define PKIEND } PKICONT: //
  34. #endif
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. // Internal memory manager for calls.
  39. typedef LPVOID (WINAPI *AllocMem)(ULONG);
  40. typedef VOID (WINAPI *FreeMem)(LPVOID);
  41. typedef struct _SpcAlloc {
  42. AllocMem Alloc;
  43. FreeMem Free;
  44. } SpcAlloc, *PSpcAlloc;
  45. HRESULT WINAPI SpcInitializeStdAsn(); // Initialize to ASN and standard C allocators
  46. #ifdef __cplusplus
  47. } /* extern "C" */
  48. #endif
  49. #endif