- Use LANGID instead of LCID.
- Move LANGID and language macros into the host typedefs header.
- Remove dead code.
svn path=/trunk/; revision=47018
typedef INT NTSTATUS, POOL_TYPE;
typedef LONG HRESULT;
typedef ULONG_PTR SIZE_T, *PSIZE_T;
+typedef WORD LANGID;
#define MAXUSHORT USHRT_MAX
#define RtlCopyMemory(Destination, Source, Length) memcpy(Destination, Source, Length)
#define RtlMoveMemory(Destination, Source, Length) memmove(Destination, Source, Length)
+#define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p))
+#define PRIMARYLANGID(l) ((WORD)(l)&0x3ff)
+#define SUBLANGID(l) ((WORD)(l)>>10)
+#define SUBLANG_NEUTRAL 0x00
+
/* Prevent inclusion of some other headers */
#define __INTERNAL_DEBUG
#define RTL_H
typedef char TCHAR, *PTCHAR, *PTSTR;
typedef const TCHAR *PCTSTR;
-typedef WORD LCID;
#define _T(x) x
#define _tcsicmp strcasecmp
#define IS_TEXT_UNICODE_NOT_UNICODE_MASK 3840
#define IS_TEXT_UNICODE_NOT_ASCII_MASK 61440
-#define SUBLANG_NEUTRAL 0
-#define PRIMARYLANGID(lgid) ((WORD)(lgid) & 0x3ff)
-#define MAKELANGID(p, s) ((((WORD)(s)) << 10) | (WORD)(p))
-
-
#else /* ! defined(INFLIB_HOST) */
/* ReactOS definitions */
DPRINT("Value name: %S\n", ValueName);
- if (Inf->LocaleId != 0)
+ if (Inf->LanguageId != 0)
{
swprintf(StringLangId,
L"Strings.%04hx",
- Inf->LocaleId);
+ Inf->LanguageId);
Status = InfpFindFirstLine(Inf,
StringLangId,
{
swprintf(StringLangId,
L"Strings.%04hx",
- MAKELANGID(PRIMARYLANGID(Inf->LocaleId), SUBLANG_NEUTRAL));
+ MAKELANGID(PRIMARYLANGID(Inf->LanguageId), SUBLANG_NEUTRAL));
Status = InfpFindFirstLine(Inf,
StringLangId,
extern int InfHostOpenBufferedFile(PHINF InfHandle,
void *Buffer,
ULONG BufferSize,
- LCID LocaleId,
+ LANGID LanguageId,
ULONG *ErrorLine);
extern int InfHostOpenFile(PHINF InfHandle,
const CHAR *FileName,
- LCID LocaleId,
+ LANGID LanguageId,
ULONG *ErrorLine);
extern int InfHostWriteFile(HINF InfHandle,
const CHAR *FileName,
InfHostOpenBufferedFile(PHINF InfHandle,
void *Buffer,
ULONG BufferSize,
- LCID LocaleId,
+ LANGID LanguageId,
ULONG *ErrorLine)
{
INFSTATUS Status;
ZEROMEMORY(Cache,
sizeof(INFCACHE));
- Cache->LocaleId = LocaleId;
+ Cache->LanguageId = LanguageId;
+ /* Parse the inf buffer */
if (!RtlIsTextUnicode(FileBuffer, (INT)FileBufferSize, NULL))
{
// static const BYTE utf8_bom[3] = { 0xef, 0xbb, 0xbf };
new_buff = MALLOC(FileBufferSize * sizeof(WCHAR));
if (new_buff != NULL)
{
-// DWORD len = MultiByteToWideChar( codepage, 0, (char *)FileBuffer + offset,
-// FileBufferSize - offset, new_buff, FileBufferSize);
-
ULONG len;
Status = RtlMultiByteToUnicodeN(new_buff,
FileBufferSize * sizeof(WCHAR),
ErrorLine);
}
- /* Parse the inf buffer */
-// Status = InfpParseBuffer (Cache,
-// FileBuffer,
-// FileBuffer + BufferSize,
-// ErrorLine);
if (!INF_SUCCESS(Status))
{
FREE(Cache);
int
InfHostOpenFile(PHINF InfHandle,
const CHAR *FileName,
- LCID LocaleId,
+ LANGID LanguageId,
ULONG *ErrorLine)
{
FILE *File;
ZEROMEMORY(Cache,
sizeof(INFCACHE));
- Cache->LocaleId = LocaleId;
+ Cache->LanguageId = LanguageId;
/* Parse the inf buffer */
if (!RtlIsTextUnicode(FileBuffer, (INT)FileBufferLength, NULL))
new_buff = MALLOC(FileBufferLength * sizeof(WCHAR));
if (new_buff != NULL)
{
-// DWORD len = MultiByteToWideChar( codepage, 0, (char *)FileBuffer + offset,
-// FileLength - offset, new_buff, FileLength);
-
ULONG len;
Status = RtlMultiByteToUnicodeN(new_buff,
FileBufferLength * sizeof(WCHAR),
ErrorLine);
}
-// Status = InfpParseBuffer (Cache,
-// FileBuffer,
-// FileBuffer + FileLength,
-// ErrorLine);
if (!INF_SUCCESS(Status))
{
FREE(Cache);
typedef struct _INFCACHE
{
- LCID LocaleId;
+ LANGID LanguageId;
PINFCACHESECTION FirstSection;
PINFCACHESECTION LastSection;
extern NTSTATUS InfOpenBufferedFile(PHINF InfHandle,
PVOID Buffer,
ULONG BufferSize,
- LCID LocaleId,
+ LANGID LanguageId,
PULONG ErrorLine);
extern NTSTATUS InfOpenFile(PHINF InfHandle,
PUNICODE_STRING FileName,
- LCID LocaleId,
+ LANGID LanguageId,
PULONG ErrorLine);
extern NTSTATUS InfWriteFile(HINF InfHandle,
PUNICODE_STRING FileName,
InfOpenBufferedFile(PHINF InfHandle,
PVOID Buffer,
ULONG BufferSize,
- LCID LocaleId,
+ LANGID LanguageId,
PULONG ErrorLine)
{
INFSTATUS Status;
ZEROMEMORY(Cache,
sizeof(INFCACHE));
- Cache->LocaleId = LocaleId;
+ Cache->LanguageId = LanguageId;
+ /* Parse the inf buffer */
if (!RtlIsTextUnicode(FileBuffer, FileBufferSize, NULL))
{
// static const BYTE utf8_bom[3] = { 0xef, 0xbb, 0xbf };
new_buff = MALLOC(FileBufferSize * sizeof(WCHAR));
if (new_buff != NULL)
{
-// DWORD len = MultiByteToWideChar( codepage, 0, (char *)FileBuffer + offset,
-// FileBufferSize - offset, new_buff, FileBufferSize);
-
ULONG len;
Status = RtlMultiByteToUnicodeN(new_buff,
FileBufferSize * sizeof(WCHAR),
NTSTATUS
InfOpenFile(PHINF InfHandle,
PUNICODE_STRING FileName,
- LCID LocaleId,
+ LANGID LanguageId,
PULONG ErrorLine)
{
OBJECT_ATTRIBUTES ObjectAttributes;
ZEROMEMORY(Cache,
sizeof(INFCACHE));
- Cache->LocaleId = LocaleId;
+ Cache->LanguageId = LanguageId;
/* Parse the inf buffer */
if (!RtlIsTextUnicode(FileBuffer, FileBufferLength, NULL))
new_buff = MALLOC(FileBufferLength * sizeof(WCHAR));
if (new_buff != NULL)
{
-// DWORD len = MultiByteToWideChar( codepage, 0, (char *)FileBuffer + offset,
-// FileLength - offset, new_buff, FileLength);
-
ULONG len;
Status = RtlMultiByteToUnicodeN(new_buff,
FileBufferLength * sizeof(WCHAR),