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.

89 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. w3subs.hxx
  5. Abstract:
  6. This module provides the code for w3 subroutines.
  7. The main reason this code is in a separate file and directory is
  8. to avoid the precompiled header in w3/server, so INITGUID and
  9. UNICODE can be defined. This module declares CLSID_MSAdminBase_W and
  10. IID_IMSAdminBase_W.
  11. Author:
  12. Michael Thomas (michth) Feb-16-1998
  13. --*/
  14. #define INITGUID
  15. #define UNICODE
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #include <nt.h>
  20. #include <ntrtl.h>
  21. #include <nturtl.h>
  22. #include <windows.h>
  23. #ifdef __cplusplus
  24. };
  25. #endif
  26. #include <w3subs.hxx>
  27. #include "dbgutil.h"
  28. #include <ole2.h>
  29. #include <stdio.h>
  30. #include <iadmw.h>
  31. /*++
  32. Routine Description:
  33. Gets a resource string.
  34. Arguments:
  35. hInsance The instance or module handle to the dll conainint the resource.
  36. dwStringID The ID of the desired resource.
  37. wpszBuffer The buffer to store the string in.
  38. dwBufferLen The lenghth of wpszBuffer, in Unicode characters.
  39. Return Value:
  40. HRESULT - ERROR_SUCCESS
  41. Errors returned by LoadString converted to HRESULT
  42. --*/
  43. HRESULT
  44. GetUnicodeResourceString(HINSTANCE hInstance,
  45. DWORD dwStringID,
  46. LPWSTR wpszBuffer,
  47. DWORD dwBufferLen)
  48. {
  49. HRESULT hresReturn = ERROR_SUCCESS;
  50. if (LoadString(hInstance,
  51. dwStringID,
  52. wpszBuffer,
  53. dwBufferLen) == 0) {
  54. hresReturn = HRESULT_FROM_WIN32(GetLastError());
  55. }
  56. return hresReturn;
  57. }