mirror of https://github.com/tongzx/nt5src
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.7 KiB
81 lines
1.7 KiB
/*++
|
|
|
|
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
|
|
);
|
|
|
|
|