From 30b8d5cc4512b4c07a8e3116e2b35ad2625eeca7 Mon Sep 17 00:00:00 2001 From: Robert Dickenson Date: Thu, 12 Dec 2002 04:53:23 +0000 Subject: [PATCH] Fixed "kernel32_test codepage" conformance test: C:\reactos\bin>kernel32_test codepage codepage: 2 tests executed, 0 marked as todo, 0 failures. Plus a bit of cvsignoring and #ifdef's in stubs for trying to build with the ole2nls module. svn path=/trunk/; revision=3871 --- reactos/lib/advapi32/.cvsignore | 1 + reactos/lib/fmifs/.cvsignore | 1 + reactos/lib/gdi32/.cvsignore | 1 + reactos/lib/kernel32/misc/mbchars.c | 23 +++++--- reactos/lib/kernel32/misc/stubs.c | 92 +++++++++++++++++------------ reactos/lib/msvcrt/.cvsignore | 5 ++ reactos/lib/ntdll/.cvsignore | 1 + 7 files changed, 78 insertions(+), 46 deletions(-) diff --git a/reactos/lib/advapi32/.cvsignore b/reactos/lib/advapi32/.cvsignore index 1909dfe4d1f..7089dde4c6e 100644 --- a/reactos/lib/advapi32/.cvsignore +++ b/reactos/lib/advapi32/.cvsignore @@ -2,6 +2,7 @@ advapi32.a advapi32.dll advapi32.nostrip.dll advapi32.lib +advapi32.sym advapi32.coff base.tmp junk.tmp diff --git a/reactos/lib/fmifs/.cvsignore b/reactos/lib/fmifs/.cvsignore index 1776ec4abe6..933a47317f3 100644 --- a/reactos/lib/fmifs/.cvsignore +++ b/reactos/lib/fmifs/.cvsignore @@ -1,6 +1,7 @@ fmifs.coff fmifs.dll fmifs.nostrip.dll +fmifs.sym *.o *.obj *.d diff --git a/reactos/lib/gdi32/.cvsignore b/reactos/lib/gdi32/.cvsignore index 16ed0b5338e..765c9c848e5 100644 --- a/reactos/lib/gdi32/.cvsignore +++ b/reactos/lib/gdi32/.cvsignore @@ -1,4 +1,5 @@ gdi32.coff +gdi32.sym gdi32.dll gdi32.nostrip.dll *.o diff --git a/reactos/lib/kernel32/misc/mbchars.c b/reactos/lib/kernel32/misc/mbchars.c index ce261e68248..dc46c734829 100644 --- a/reactos/lib/kernel32/misc/mbchars.c +++ b/reactos/lib/kernel32/misc/mbchars.c @@ -1,4 +1,4 @@ -/* $Id: mbchars.c,v 1.1 2002/12/06 13:14:14 robd Exp $ +/* $Id: mbchars.c,v 1.2 2002/12/12 04:53:23 robd Exp $ * */ #include @@ -99,7 +99,8 @@ MultiByteToWideChar( /* * Compute the input buffer length. */ - if (-1 == cchMultiByte) + //if (-1 == cchMultiByte) + if (cchMultiByte < 0) { InStringLength = lstrlen(lpMultiByteStr) + 1; } @@ -113,7 +114,7 @@ MultiByteToWideChar( */ if (0 == cchWideChar) { - SetLastError(ERROR_SUCCESS); + //SetLastError(ERROR_SUCCESS); /* according to wine tests this shouldn't be touched on success. return InStringLength; } /* @@ -144,7 +145,7 @@ MultiByteToWideChar( * Return how many characters we * wrote in the output buffer. */ - SetLastError(ERROR_SUCCESS); + //SetLastError(ERROR_SUCCESS); /* according to wine tests this shouldn't be touched on success. return cchConverted; } @@ -255,16 +256,20 @@ WideCharToMultiByte( } // for now, make no difference but only convert cut the characters to 7Bit - if (cchWideChar == -1) // assume its a 0-terminated str + //if (cchWideChar == -1) // assume its a 0-terminated str + if (cchWideChar < 0) // assume its a 0-terminated str { // and determine its length - for (cchWideChar=0; lpWideCharStr[cchWideChar]!=0; cchWideChar++) - cchWideChar++; +// for (cchWideChar=0; lpWideCharStr[cchWideChar]!=0; cchWideChar++) +// cchWideChar++; + for (cchWideChar = 0; lpWideCharStr[cchWideChar] != 0; cchWideChar++) { + } + cchWideChar++; // length includes the null terminator } // user wants to determine needed space if (cchMultiByte == 0) { - SetLastError(ERROR_SUCCESS); + //SetLastError(ERROR_SUCCESS); /* according to wine tests this shouldn't be touched on success. return cchWideChar; // FIXME: determine correct. } // the lpWideCharStr is cchWideChar characters long. @@ -288,7 +293,7 @@ WideCharToMultiByte( return 0; } // else return # of bytes wirtten to MBCSbuffer (di) - SetLastError(ERROR_SUCCESS); + //SetLastError(ERROR_SUCCESS); /* according to wine tests this shouldn't be touched on success. // FIXME: move that elsewhere if (lpUsedDefaultChar != NULL) *lpUsedDefaultChar = FALSE; return di; diff --git a/reactos/lib/kernel32/misc/stubs.c b/reactos/lib/kernel32/misc/stubs.c index c5ca73fe468..025c3883c3e 100644 --- a/reactos/lib/kernel32/misc/stubs.c +++ b/reactos/lib/kernel32/misc/stubs.c @@ -1,10 +1,11 @@ -/* $Id: stubs.c,v 1.37 2002/12/06 13:14:14 robd Exp $ +/* $Id: stubs.c,v 1.38 2002/12/12 04:53:23 robd Exp $ * * KERNEL32.DLL stubs (unimplemented functions) * Remove from this file, if you implement them. */ #include +#define _OLE2NLS_IN_BUILD_ BOOL STDCALL @@ -168,6 +169,7 @@ EnumSystemCodePagesA ( return FALSE; } +#ifndef _OLE2NLS_IN_BUILD_ WINBOOL STDCALL @@ -192,6 +194,7 @@ EnumSystemLocalesA ( return FALSE; } +#endif WINBOOL STDCALL @@ -283,6 +286,7 @@ FreeVirtualBuffer ( return FALSE; } +#ifndef _OLE2NLS_IN_BUILD_ UINT STDCALL @@ -292,6 +296,7 @@ GetACP (VOID) return 0; } +#endif WINBOOL STDCALL @@ -316,6 +321,7 @@ GetBinaryTypeA ( return FALSE; } +#ifndef _OLE2NLS_IN_BUILD_ WINBOOL STDCALL @@ -328,6 +334,7 @@ GetCPInfo ( return 0; } +#endif int STDCALL @@ -360,6 +367,7 @@ GetCurrencyFormatA ( return 0; } +#ifndef _OLE2NLS_IN_BUILD_ int STDCALL @@ -557,6 +565,7 @@ GetSystemDefaultLangID (VOID) ); } +#endif DWORD STDCALL @@ -568,6 +577,7 @@ GetSystemPowerStatus ( return 0; } +#ifndef _OLE2NLS_IN_BUILD_ LCID STDCALL @@ -581,6 +591,7 @@ GetThreadLocale (VOID) ); } +#endif WINBOOL STDCALL @@ -639,6 +650,7 @@ GetTimeFormatA ( return 0; } +#ifndef _OLE2NLS_IN_BUILD_ LCID STDCALL @@ -665,6 +677,7 @@ GetUserDefaultLangID (VOID) ); } +#endif DWORD STDCALL @@ -677,6 +690,7 @@ GetVDMCurrentDirectories ( return 0; } +#ifndef _OLE2NLS_IN_BUILD_ WINBOOL STDCALL @@ -755,6 +769,7 @@ LCMapStringW ( return 0; } +#endif DWORD STDCALL @@ -855,32 +870,6 @@ SetComputerNameW ( } -WINBOOL -STDCALL -SetLocaleInfoA ( - LCID Locale, - LCTYPE LCType, - LPCSTR lpLCData - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -WINBOOL -STDCALL -SetLocaleInfoW ( - LCID Locale, - LCTYPE LCType, - LPCWSTR lpLCData - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - WINBOOL STDCALL SetSystemPowerState ( @@ -901,16 +890,6 @@ SetThreadIdealProcessor(VOID) return 0; } -WINBOOL -STDCALL -SetThreadLocale ( - LCID Locale - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - WINBOOL STDCALL @@ -966,6 +945,44 @@ VDMOperationStarted ( return 0; } +#ifndef _OLE2NLS_IN_BUILD_ + +WINBOOL +STDCALL +SetLocaleInfoA ( + LCID Locale, + LCTYPE LCType, + LPCSTR lpLCData + ) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +WINBOOL +STDCALL +SetLocaleInfoW ( + LCID Locale, + LCTYPE LCType, + LPCWSTR lpLCData + ) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +WINBOOL +STDCALL +SetThreadLocale ( + LCID Locale + ) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + DWORD STDCALL @@ -992,6 +1009,7 @@ VerLanguageNameW ( return 0; } +#endif DWORD STDCALL diff --git a/reactos/lib/msvcrt/.cvsignore b/reactos/lib/msvcrt/.cvsignore index 014791142f4..ac9ff257359 100644 --- a/reactos/lib/msvcrt/.cvsignore +++ b/reactos/lib/msvcrt/.cvsignore @@ -4,3 +4,8 @@ msvcrt.nostrip.dll *.d *.o *.sym +*.dsp +*.dsw +*.ncb +*.opt +*.txt diff --git a/reactos/lib/ntdll/.cvsignore b/reactos/lib/ntdll/.cvsignore index 7945d949d72..79f29e2c5c7 100644 --- a/reactos/lib/ntdll/.cvsignore +++ b/reactos/lib/ntdll/.cvsignore @@ -3,6 +3,7 @@ junk.tmp napi.asm napi.c ntdll.lib +ntdll.sym ntdll.coff ntdll.dll ntdll.nostrip.dll -- 2.17.1