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.

58 lines
1.2 KiB

  1. //
  2. // Enable driver verifier support for ntoskrnl
  3. // Copyright (c) Microsoft Corporation, 1999
  4. //
  5. //
  6. // module: resutil.cxx
  7. // author: DMihai
  8. // created: 04/19/99
  9. // description: resources manipulation routines
  10. //
  11. #include <windows.h>
  12. #include <tchar.h>
  13. #include "genutil.hxx"
  14. #include "resutil.hxx"
  15. //////////////////////////////////////////////////////////////////////
  16. BOOL
  17. GetStringFromResources(
  18. UINT uIdResource,
  19. TCHAR *strResult,
  20. int nBufferLen )
  21. {
  22. UINT LoadStringResult;
  23. LoadStringResult = LoadString (
  24. GetModuleHandle (NULL),
  25. uIdResource,
  26. strResult,
  27. nBufferLen );
  28. assert_ (LoadStringResult > 0);
  29. return (LoadStringResult > 0);
  30. }
  31. //////////////////////////////////////////////////////////////////////
  32. void
  33. PrintStringFromResources(
  34. UINT uIdResource)
  35. {
  36. TCHAR strStringFromResource[ 1024 ];
  37. BOOL bResult;
  38. bResult = GetStringFromResources(
  39. uIdResource,
  40. strStringFromResource,
  41. ARRAY_LEN( strStringFromResource ) );
  42. if( bResult == TRUE )
  43. {
  44. _putts( strStringFromResource );
  45. }
  46. }