windows-nt/Source/XPSP1/NT/inetsrv/iis/admin/adsi/adsiis/charset.hxx
2020-09-26 16:20:57 +08:00

82 lines
1.7 KiB
C++

/*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
charset.h
Abstract:
Contains prototypes Unicode <-> Ansi/MBCS conversions (see charset.c)
Author:
Danilo Almeida (t-danal) 06-17-96
Revision History:
--*/
#include <windows.h>
//#include <memory.h>
//
// Memory allocation macros
//
#define \
AllocMem( \
Size, \
pBuffer \
) \
( \
(*pBuffer = (LPBYTE)AllocADsMem((DWORD)Size)) == NULL \
? \
ERROR_NOT_ENOUGH_MEMORY \
: \
NO_ERROR \
);
#define \
FreeMem( \
Buffer \
) \
( \
FreeADsMem((void *)Buffer) \
);
// Function prototypes
UINT
AllocAnsi(
LPCWSTR pwszUnicode,
LPSTR *ppszAnsi
);
VOID
FreeAnsi(
LPSTR pszAnsi
);
UINT
AllocUnicode(
LPCSTR pszAnsi,
LPWSTR *ppwszUnicode
);
int
AllocUnicode2(
LPCSTR pszAnsi,
int cch,
LPWSTR *ppwszUnicode
);
VOID
FreeUnicode(
LPWSTR pwszUnicodeAllocated
);