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.

66 lines
2.3 KiB

  1. //+------------------------------------------------------------
  2. //
  3. // Copyright (C) 2000, Microsoft Corporation
  4. //
  5. // File: CodePageConvert.h
  6. //
  7. // Functions:
  8. // HrCodePageConvert
  9. // HrCodePageConvert
  10. // HrCodePageConvertFree
  11. // HrCodePageConvertInternal
  12. //
  13. // History:
  14. // aszafer 2000/03/29 created
  15. //-------------------------------------------------------------
  16. #ifndef _CODEPAGECONVERT_H_
  17. #define _CODEPAGECONVERT_H_
  18. #include "windows.h"
  19. #define TEMPBUFFER_WCHARS 316
  20. HRESULT HrCodePageConvert (
  21. IN UINT uiSourceCodePage, // Source code page
  22. IN LPSTR pszSourceString, // Source String
  23. IN UINT uiTargetCodePage, // Target code page
  24. OUT LPSTR pszTargetString, // p to prealloc buffer where target string is returned
  25. IN int cbTargetStringBuffer); // cbytes in prealloc buffer for target string
  26. HRESULT HrCodePageConvert (
  27. IN UINT uiSourceCodePage, // Source code page
  28. IN LPSTR pszSourceString, // Source string
  29. IN UINT uiTargetCodePage, // Target code page
  30. OUT LPSTR * ppszTargetString); // p to where target string is returned
  31. VOID HrCodePageConvertFree (LPSTR pszTargetString); //p to memory allocated by HrCodePageConvert
  32. HRESULT HrCodePageConvertInternal (
  33. IN UINT uiSourceCodePage, // source code page
  34. IN LPSTR pszSourceString, // source string
  35. IN UINT uiTargetCodePage, // target code page
  36. OUT LPSTR pszTargetString, // target string or NULL
  37. IN int cbTargetStringBuffer, // cb in target string or 0
  38. OUT LPSTR* ppszTargetString ); // NULL or p to where target string is returned
  39. HRESULT HrConvertToUnicodeWithAlloc(
  40. IN UINT uiSourceCodePage,
  41. IN LPSTR pszSourceString,
  42. OUT LPWSTR* ppwszTargetString);
  43. HRESULT HrConvertToUnicodeWithAlloc(
  44. IN UINT uiSourceCodePage,
  45. IN DWORD dwcbSourceString,
  46. IN LPSTR pszSourceString,
  47. OUT LPWSTR* ppwszTargetString);
  48. VOID CodePageConvertFree (
  49. IN LPWSTR pwszTargetString); //p to memory allocated by ConvertToUnicodeWithAlloc
  50. HRESULT wcsutf8cmpi(
  51. IN LPWSTR pwszStr1, // two strings to compare
  52. IN LPCSTR pszStr2);
  53. #endif //_CODEPAGECONVERT_H_