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.

71 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1994-1995 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. safewrap.hxx
  6. Abstract:
  7. This defines safe-wrappers for various system APIs.
  8. Author:
  9. Mark Lawrence (MLawrenc)
  10. Revision History:
  11. --*/
  12. #ifndef _SAFEWRAP_HXX_
  13. #define _SAFEWRAP_HXX_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. HINSTANCE
  18. LoadLibraryFromSystem32(
  19. IN LPCTSTR lpLibFileName
  20. );
  21. HRESULT
  22. SafeRegQueryValueAsStringPointer(
  23. IN HKEY hKey,
  24. IN PCWSTR pValueName,
  25. OUT PWSTR *ppszString,
  26. IN DWORD cchHint OPTIONAL
  27. );
  28. #ifdef __cplusplus
  29. }; // extern "C"
  30. HRESULT
  31. CheckAndNullTerminateRegistryBuffer(
  32. IN PWSTR pszBuffer,
  33. IN UINT cchBuffer,
  34. IN UINT cchRegBuffer,
  35. OUT BOOL *pbTruncated,
  36. OUT BOOL *pbNullInRegistry
  37. );
  38. HRESULT
  39. TestNullTerminateRegistryBuffer(
  40. VOID
  41. );
  42. HRESULT
  43. SubTestVariations(
  44. IN HKEY hKey,
  45. IN PCWSTR pszValue,
  46. IN PCWSTR pWriteBuffer,
  47. IN UINT cchBuffer,
  48. IN PCWSTR pszCompareString,
  49. IN HRESULT hrExpected
  50. );
  51. #endif // #ifdef __cplusplus
  52. #endif // #ifndef _SAFEWRAP_HXX_