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.

81 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. charset.h
  5. Abstract:
  6. Contains prototypes Unicode <-> Ansi/MBCS conversions (see charset.c)
  7. Author:
  8. Danilo Almeida (t-danal) 06-17-96
  9. Revision History:
  10. --*/
  11. #include <windows.h>
  12. //#include <memory.h>
  13. //
  14. // Memory allocation macros
  15. //
  16. #define \
  17. MyAllocMem( \
  18. Size, \
  19. pBuffer \
  20. ) \
  21. ( \
  22. (*pBuffer = (LPBYTE)AllocADsMem((DWORD)Size)) == NULL \
  23. ? \
  24. ERROR_NOT_ENOUGH_MEMORY \
  25. : \
  26. NO_ERROR \
  27. );
  28. #define \
  29. MyFreeMem( \
  30. Buffer \
  31. ) \
  32. ( \
  33. FreeADsMem((void *)Buffer) \
  34. );
  35. // Function prototypes
  36. UINT
  37. AllocAnsi(
  38. LPCWSTR pwszUnicode,
  39. LPSTR *ppszAnsi
  40. );
  41. VOID
  42. FreeAnsi(
  43. LPSTR pszAnsi
  44. );
  45. UINT
  46. AllocUnicode(
  47. LPCSTR pszAnsi,
  48. LPWSTR *ppwszUnicode
  49. );
  50. int
  51. AllocUnicode2(
  52. LPCSTR pszAnsi,
  53. int cch,
  54. LPWSTR *ppwszUnicode
  55. );
  56. VOID
  57. FreeUnicode(
  58. LPWSTR pwszUnicodeAllocated
  59. );