From: Robert Dickenson Date: Fri, 6 Dec 2002 13:14:14 +0000 (+0000) Subject: In search of meaningful error messages and some housekeeping on the stubs file. X-Git-Tag: ReactOS-0.1.0~262 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=accbf7c8963de4639bbf232c1e387a7fa89bbe60 In search of meaningful error messages and some housekeeping on the stubs file. svn path=/trunk/; revision=3825 --- diff --git a/reactos/lib/kernel32/.cvsignore b/reactos/lib/kernel32/.cvsignore index 1a9ed7bfc0c..4bddb3d0e16 100644 --- a/reactos/lib/kernel32/.cvsignore +++ b/reactos/lib/kernel32/.cvsignore @@ -1,6 +1,7 @@ kernel32.a kernel32.dll kernel32.nostrip.dll +kernel32.sym kernel32.lib kernel32.coff base.tmp diff --git a/reactos/lib/kernel32/makefile b/reactos/lib/kernel32/makefile index d88d2ec2189..4d8fe0936f8 100644 --- a/reactos/lib/kernel32/makefile +++ b/reactos/lib/kernel32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.53 2002/09/08 10:22:41 chorns Exp $ +# $Id: makefile,v 1.54 2002/12/06 13:14:13 robd Exp $ PATH_TO_TOP = ../.. @@ -31,9 +31,10 @@ SYNCH_OBJECTS = synch/critical.o synch/event.o synch/intrlck.o synch/mutex.o \ synch/sem.o synch/timer.o synch/wait.o MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o \ - misc/dllmain.o misc/comm.o \ + misc/dllmain.o misc/comm.o misc/errormsg.o \ misc/console.o misc/time.o misc/stubs.o misc/ldr.o misc/res.o \ - misc/debug.o misc/sysinfo.o misc/profile.o + misc/debug.o misc/sysinfo.o misc/profile.o \ + misc/mbchars.o misc/muldiv.o misc/getname.o FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \ file/iocompl.o file/volume.o file/deviceio.o file/dosdev.o \ diff --git a/reactos/lib/kernel32/misc/errormsg.c b/reactos/lib/kernel32/misc/errormsg.c new file mode 100644 index 00000000000..3ef02daf8e8 --- /dev/null +++ b/reactos/lib/kernel32/misc/errormsg.c @@ -0,0 +1,88 @@ +/* $Id: errormsg.c,v 1.1 2002/12/06 13:14:14 robd Exp $ + * + * reactos/lib/kernel32/misc/errormsg.c + * + */ +#include + +// #define NDEBUG +#include +#include + + +/* INTERNAL */ + + +/* EXPORTED */ + +DWORD +STDCALL +FormatMessageW( + DWORD dwFlags, + LPCVOID lpSource, + DWORD dwMessageId, + DWORD dwLanguageId, + LPWSTR lpBuffer, + DWORD nSize, + va_list* Arguments) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + + +DWORD +STDCALL +FormatMessageA( + DWORD dwFlags, + LPCVOID lpSource, + DWORD dwMessageId, + DWORD dwLanguageId, + LPSTR lpBuffer, + DWORD nSize, + va_list* Arguments) +{ + HLOCAL pBuf = NULL; + //LPSTR pBuf = NULL; + +#define MAX_MSG_STR_LEN 200 + + if (lpBuffer != NULL) { + + if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { + pBuf = LocalAlloc(LPTR, max(nSize, MAX_MSG_STR_LEN)); + if (pBuf == NULL) { + return 0; + } + *(LPSTR*)lpBuffer = pBuf; + } else { + pBuf = *(LPSTR*)lpBuffer; + } + + if (dwFlags & FORMAT_MESSAGE_FROM_STRING) { + } else { + } + +//FORMAT_MESSAGE_IGNORE_INSERTS +//FORMAT_MESSAGE_FROM_STRING +//FORMAT_MESSAGE_FROM_HMODULE +//FORMAT_MESSAGE_FROM_SYSTEM +//FORMAT_MESSAGE_ARGUMENT_ARRAY + + } +/* + if (FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + 0, + error, + MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), + (PTSTR)&msg, + 0, + NULL) + ) + */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + +/* EOF */ diff --git a/reactos/lib/kernel32/misc/getname.c b/reactos/lib/kernel32/misc/getname.c new file mode 100644 index 00000000000..034c67bca2a --- /dev/null +++ b/reactos/lib/kernel32/misc/getname.c @@ -0,0 +1,49 @@ +/* $Id: getname.c,v 1.1 2002/12/06 13:14:14 robd Exp $ + * + */ +#include + + +WINBOOL +STDCALL +GetComputerNameW(LPWSTR lpBuffer, LPDWORD nSize) +{ + WCHAR Name[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD Size = 0; + + /* + * FIXME: get the computer's name from the registry. + */ + lstrcpyW(Name, L"ROSHost"); /* <-- FIXME -- */ + Size = lstrlenW(Name) + 1; + if (Size > *nSize) { + *nSize = Size; + SetLastError(ERROR_BUFFER_OVERFLOW); + return FALSE; + } + lstrcpyW(lpBuffer, Name); + return TRUE; +} + + +WINBOOL +STDCALL +GetComputerNameA(LPSTR lpBuffer, LPDWORD nSize) +{ + WCHAR Name[MAX_COMPUTERNAME_LENGTH + 1]; + int i; + + if (FALSE == GetComputerNameW(Name, nSize)) { + return FALSE; + } + +/* FIXME --> */ +/* Use UNICODE to ANSI */ + for (i = 0; Name[i]; ++i) { + lpBuffer[i] = (CHAR)Name[i]; + } + lpBuffer[i] = '\0'; +/* FIXME <-- */ + + return TRUE; +} diff --git a/reactos/lib/kernel32/misc/mbchars.c b/reactos/lib/kernel32/misc/mbchars.c new file mode 100644 index 00000000000..ce261e68248 --- /dev/null +++ b/reactos/lib/kernel32/misc/mbchars.c @@ -0,0 +1,297 @@ +/* $Id: mbchars.c,v 1.1 2002/12/06 13:14:14 robd Exp $ + * + */ +#include + + +/********************************************************************** + * NAME PRIVATE + * IsInstalledCP@4 + * + * RETURN VALUE + * TRUE if CodePage is installed in the system. + */ +static +BOOL +STDCALL +IsInstalledCP(UINT CodePage) +{ + /* FIXME */ + return TRUE; +} + + +/********************************************************************** + * NAME EXPORTED + * MultiByteToWideChar@24 + * + * ARGUMENTS + * CodePage + * CP_ACP ANSI code page + * CP_MACCP Macintosh code page + * CP_OEMCP OEM code page + * (UINT) Any installed code page + * + * dwFlags + * MB_PRECOMPOSED + * MB_COMPOSITE + * MB_ERR_INVALID_CHARS + * MB_USEGLYPHCHARS + * + * lpMultiByteStr + * Input buffer; + * + * cchMultiByte + * Size of MultiByteStr, or -1 if MultiByteStr is + * NULL terminated; + * + * lpWideCharStr + * Output buffer; + * + * cchWideChar + * Size (in WCHAR unit) of WideCharStr, or 0 + * if the caller just wants to know how large + * WideCharStr should be for a successful + * conversion. + * + * RETURN VALUE + * 0 on error; otherwise the number of WCHAR written + * in the WideCharStr buffer. + * + * NOTE + * A raw converter for now. It assumes lpMultiByteStr is + * NEVER multi-byte (that is each input character is + * 8-bit ASCII) and is ALWAYS NULL terminated. + * FIXME-FIXME-FIXME-FIXME + */ +INT +STDCALL +MultiByteToWideChar( + UINT CodePage, + DWORD dwFlags, + LPCSTR lpMultiByteStr, + int cchMultiByte, + LPWSTR lpWideCharStr, + int cchWideChar) +{ + int InStringLength = 0; + PCHAR r; + PWCHAR w; + int cchConverted; + + /* + * Check the parameters. + */ + if (/* --- CODE PAGE --- */ + ( (CP_ACP != CodePage) + && (CP_MACCP != CodePage) + && (CP_OEMCP != CodePage) + && (FALSE == IsInstalledCP(CodePage)) ) + /* --- FLAGS --- */ + || (dwFlags & ~(MB_PRECOMPOSED | MB_COMPOSITE | + MB_ERR_INVALID_CHARS | MB_USEGLYPHCHARS)) + /* --- INPUT BUFFER --- */ + || (NULL == lpMultiByteStr) ) + { + SetLastError (ERROR_INVALID_PARAMETER); + return 0; + } + /* + * Compute the input buffer length. + */ + if (-1 == cchMultiByte) + { + InStringLength = lstrlen(lpMultiByteStr) + 1; + } + else + { + InStringLength = cchMultiByte; + } + /* + * Does caller query for output + * buffer size? + */ + if (0 == cchWideChar) + { + SetLastError(ERROR_SUCCESS); + return InStringLength; + } + /* + * Is space provided for the translated + * string enough? + */ + if (cchWideChar < InStringLength) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return 0; + } + /* + * Raw 8- to 16-bit conversion. + */ + for (cchConverted = 0, + r = (PCHAR)lpMultiByteStr, + w = (PWCHAR)lpWideCharStr; + + cchConverted < InStringLength; + + r++, + w++, + cchConverted++) + { + *w = (WCHAR)*r; + } + /* + * Return how many characters we + * wrote in the output buffer. + */ + SetLastError(ERROR_SUCCESS); + return cchConverted; +} + + +/********************************************************************** + * NAME EXPORTED + * WideCharToMultiByte@32 + * + * Not yet implemented complete (without NLS so far) + * + * ARGUMENTS + * CodePage + * CP_ACP ANSI code page + * CP_MACCP Macintosh code page + * CP_OEMCP OEM code page + * CP_SYMBOL Symbol code page (42) + * CP_THREAD_ACP Current thread's ANSI code page + * CP_UTF7 Translate using UTF-7 + * CP_UTF8 Translate using UTF-8 + * (UINT) Any installed code page + * + * dwFlags + * WC_NO_BEST_FIT_CHARS + * WC_COMPOSITECHECK Convert composite characters to precomposed characters. + * WC_DISCARDNS Discard nonspacing characters during conversion. + * WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior. + * WC_DEFAULTCHAR Replace exceptions with the default character during conversion. + * + * lpWideCharStr + * Points to the wide-character string to be converted. + * + * cchWideChar + * Size (in WCHAR unit) of WideCharStr, or 0 + * if the caller just wants to know how large + * WideCharStr should be for a successful + * conversion. + * lpMultiByteStr + * Points to the buffer to receive the translated string. + * cchMultiByte + * Specifies the size in bytes of the buffer pointed to by the + * lpMultiByteStr parameter. If this value is zero, the function + * returns the number of bytes required for the buffer. + * lpDefaultChar + * Points to the character used if a wide character cannot be + * represented in the specified code page. If this parameter is + * NULL, a system default value is used. + FIXME: ignored + * lpUsedDefaultChar + * Points to a flag that indicates whether a default character was used. + * This parameter may be NULL. + FIXME: allways set to FALSE. + * + * + * + * RETURN VALUE + * 0 on error; otherwise the number of bytes written + * in the lpMultiByteStr buffer. Or the number of + * bytes needed for the lpMultiByteStr buffer if cchMultiByte is zero. + * + * NOTE + * A raw converter for now. It just cuts off the upper 9 Bit. + * So the MBCS-string does not contain any LeadCharacters + * FIXME - FIXME - FIXME - FIXME + */ + +int +STDCALL +WideCharToMultiByte( + UINT CodePage, + DWORD dwFlags, + LPCWSTR lpWideCharStr, + int cchWideChar, + LPSTR lpMultiByteStr, + int cchMultiByte, + LPCSTR lpDefaultChar, + LPBOOL lpUsedDefaultChar + ) +{ + int wi, di; // wide counter, dbcs byte count + + /* + * Check the parameters. + */ + if ( /* --- CODE PAGE --- */ + ( (CP_ACP != CodePage) + && (CP_MACCP != CodePage) + && (CP_OEMCP != CodePage) + && (CP_SYMBOL != CodePage) + && (CP_THREAD_ACP != CodePage) + && (CP_UTF7 != CodePage) + && (CP_UTF8 != CodePage) + && (FALSE == IsInstalledCP (CodePage)) + ) + /* --- FLAGS --- */ + || (dwFlags & ~(/*WC_NO_BEST_FIT_CHARS + |*/ WC_COMPOSITECHECK + | WC_DISCARDNS + | WC_SEPCHARS + | WC_DEFAULTCHAR + ) + ) + /* --- INPUT BUFFER --- */ + || (NULL == lpWideCharStr) + ) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + // for now, make no difference but only convert cut the characters to 7Bit + if (cchWideChar == -1) // assume its a 0-terminated str + { // and determine its length + for (cchWideChar=0; lpWideCharStr[cchWideChar]!=0; cchWideChar++) + cchWideChar++; + } + + // user wants to determine needed space + if (cchMultiByte == 0) + { + SetLastError(ERROR_SUCCESS); + return cchWideChar; // FIXME: determine correct. + } + // the lpWideCharStr is cchWideChar characters long. + for (wi=0, di=0; wi127) ) + { + lpMultiByteStr[di]= + *lpUsedDefaultChar = TRUE; + + }*/ + // FIXME + // just cut off the upper 9 Bit, since vals>=128 mean LeadByte. + lpMultiByteStr[di] = lpWideCharStr[wi] & 0x007F; + } + // has MultiByte exceeded but Wide is still in the string? + if (wi < cchWideChar && di >= cchMultiByte) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return 0; + } + // else return # of bytes wirtten to MBCSbuffer (di) + SetLastError(ERROR_SUCCESS); + // FIXME: move that elsewhere + if (lpUsedDefaultChar != NULL) *lpUsedDefaultChar = FALSE; + return di; +} + +/* EOF */ diff --git a/reactos/lib/kernel32/misc/muldiv.c b/reactos/lib/kernel32/misc/muldiv.c new file mode 100644 index 00000000000..67cff5846ee --- /dev/null +++ b/reactos/lib/kernel32/misc/muldiv.c @@ -0,0 +1,61 @@ +/* $Id: muldiv.c,v 1.1 2002/12/06 13:14:14 robd Exp $ + * + */ +#include + + +/*********************************************************************** + * MulDiv (KERNEL32.@) + * RETURNS + * Result of multiplication and division + * -1: Overflow occurred or Divisor was 0 + */ + +//FIXME! move to correct file +INT STDCALL MulDiv( + INT nMultiplicand, + INT nMultiplier, + INT nDivisor) +{ +#if SIZEOF_LONG_LONG >= 8 + long long ret; + + if (!nDivisor) return -1; + + /* We want to deal with a positive divisor to simplify the logic. */ + if (nDivisor < 0) + { + nMultiplicand = - nMultiplicand; + nDivisor = -nDivisor; + } + + /* If the result is positive, we "add" to round. else, we subtract to round. */ + if ( ( (nMultiplicand < 0) && (nMultiplier < 0) ) || + ( (nMultiplicand >= 0) && (nMultiplier >= 0) ) ) + ret = (((long long)nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor; + else + ret = (((long long)nMultiplicand * nMultiplier) - (nDivisor/2)) / nDivisor; + + if ((ret > 2147483647) || (ret < -2147483647)) return -1; + return ret; +#else + if (!nDivisor) return -1; + + /* We want to deal with a positive divisor to simplify the logic. */ + if (nDivisor < 0) + { + nMultiplicand = - nMultiplicand; + nDivisor = -nDivisor; + } + + /* If the result is positive, we "add" to round. else, we subtract to round. */ + if ( ( (nMultiplicand < 0) && (nMultiplier < 0) ) || + ( (nMultiplicand >= 0) && (nMultiplier >= 0) ) ) + return ((nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor; + + return ((nMultiplicand * nMultiplier) - (nDivisor/2)) / nDivisor; + +#endif +} + + diff --git a/reactos/lib/kernel32/misc/stubs.c b/reactos/lib/kernel32/misc/stubs.c index 658078b9bf2..c5ca73fe468 100644 --- a/reactos/lib/kernel32/misc/stubs.c +++ b/reactos/lib/kernel32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.36 2002/10/29 04:05:26 mdill Exp $ +/* $Id: stubs.c,v 1.37 2002/12/06 13:14:14 robd Exp $ * * KERNEL32.DLL stubs (unimplemented functions) * Remove from this file, if you implement them. @@ -10,8 +10,8 @@ BOOL STDCALL IsProcessorFeaturePresent( DWORD ProcessorFeature ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } @@ -19,75 +19,75 @@ BOOL STDCALL BaseAttachCompleteThunk (VOID) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } BOOL STDCALL CmdBatNotification ( - DWORD Unknown - ) + DWORD Unknown + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } int STDCALL CompareStringA ( - LCID Locale, - DWORD dwCmpFlags, - LPCSTR lpString1, - int cchCount1, - LPCSTR lpString2, - int cchCount2 - ) + LCID Locale, + DWORD dwCmpFlags, + LPCSTR lpString1, + int cchCount1, + LPCSTR lpString2, + int cchCount2 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL CompareStringW ( - LCID Locale, - DWORD dwCmpFlags, - LPCWSTR lpString1, - int cchCount1, - LPCWSTR lpString2, - int cchCount2 - ) + LCID Locale, + DWORD dwCmpFlags, + LPCWSTR lpString1, + int cchCount1, + LPCWSTR lpString2, + int cchCount2 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } LCID STDCALL ConvertDefaultLocale ( - LCID Locale - ) + LCID Locale + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } DWORD STDCALL CreateVirtualBuffer ( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2 - ) + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } @@ -100,231 +100,187 @@ EnumCalendarInfoW ( CALTYPE CalType ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } - WINBOOL STDCALL EnumCalendarInfoA ( - CALINFO_ENUMPROC lpCalInfoEnumProc, - LCID Locale, - CALID Calendar, - CALTYPE CalType - ) + CALINFO_ENUMPROC lpCalInfoEnumProc, + LCID Locale, + CALID Calendar, + CALTYPE CalType + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL EnumDateFormatsW ( - DATEFMT_ENUMPROC lpDateFmtEnumProc, - LCID Locale, - DWORD dwFlags - ) + DATEFMT_ENUMPROC lpDateFmtEnumProc, + LCID Locale, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL EnumDateFormatsA ( - DATEFMT_ENUMPROC lpDateFmtEnumProc, - LCID Locale, - DWORD dwFlags - ) + DATEFMT_ENUMPROC lpDateFmtEnumProc, + LCID Locale, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } - - WINBOOL STDCALL EnumSystemCodePagesW ( - CODEPAGE_ENUMPROC lpCodePageEnumProc, - DWORD dwFlags - ) + CODEPAGE_ENUMPROC lpCodePageEnumProc, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL EnumSystemCodePagesA ( - CODEPAGE_ENUMPROC lpCodePageEnumProc, - DWORD dwFlags - ) + CODEPAGE_ENUMPROC lpCodePageEnumProc, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL EnumSystemLocalesW ( - LOCALE_ENUMPROC lpLocaleEnumProc, - DWORD dwFlags - ) + LOCALE_ENUMPROC lpLocaleEnumProc, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL EnumSystemLocalesA ( - LOCALE_ENUMPROC lpLocaleEnumProc, - DWORD dwFlags - ) + LOCALE_ENUMPROC lpLocaleEnumProc, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL EnumTimeFormatsW ( - TIMEFMT_ENUMPROC lpTimeFmtEnumProc, - LCID Locale, - DWORD dwFlags - ) + TIMEFMT_ENUMPROC lpTimeFmtEnumProc, + LCID Locale, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL EnumTimeFormatsA ( - TIMEFMT_ENUMPROC lpTimeFmtEnumProc, - LCID Locale, - DWORD dwFlags - ) + TIMEFMT_ENUMPROC lpTimeFmtEnumProc, + LCID Locale, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } - - - - - DWORD STDCALL ExitVDM ( - DWORD Unknown0, - DWORD Unknown1 - ) + DWORD Unknown0, + DWORD Unknown1 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } - - BOOL STDCALL ExtendVirtualBuffer ( - DWORD Unknown0, - DWORD Unknown1 - ) + DWORD Unknown0, + DWORD Unknown1 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } int STDCALL FoldStringW ( - DWORD dwMapFlags, - LPCWSTR lpSrcStr, - int cchSrc, - LPWSTR lpDestStr, - int cchDest - ) + DWORD dwMapFlags, + LPCWSTR lpSrcStr, + int cchSrc, + LPWSTR lpDestStr, + int cchDest + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL FoldStringA ( - DWORD dwMapFlags, - LPCSTR lpSrcStr, - int cchSrc, - LPSTR lpDestStr, - int cchDest - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -DWORD -STDCALL -FormatMessageW ( - DWORD dwFlags, - LPCVOID lpSource, - DWORD dwMessageId, - DWORD dwLanguageId, - LPWSTR lpBuffer, - DWORD nSize, - va_list * Arguments - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -DWORD -STDCALL -FormatMessageA ( - DWORD dwFlags, - LPCVOID lpSource, - DWORD dwMessageId, - DWORD dwLanguageId, - LPSTR lpBuffer, - DWORD nSize, - va_list * Arguments - ) + DWORD dwMapFlags, + LPCSTR lpSrcStr, + int cchSrc, + LPSTR lpDestStr, + int cchDest + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } BOOL STDCALL FreeVirtualBuffer ( - HANDLE hVirtualBuffer - ) + HANDLE hVirtualBuffer + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } @@ -332,241 +288,179 @@ UINT STDCALL GetACP (VOID) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } + WINBOOL STDCALL GetBinaryTypeW ( - LPCWSTR lpApplicationName, - LPDWORD lpBinaryType - ) + LPCWSTR lpApplicationName, + LPDWORD lpBinaryType + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL GetBinaryTypeA ( - LPCSTR lpApplicationName, - LPDWORD lpBinaryType - ) + LPCSTR lpApplicationName, + LPDWORD lpBinaryType + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL GetCPInfo ( - UINT a0, - LPCPINFO a1 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - - - -WINBOOL -STDCALL -GetComputerNameW ( - LPWSTR lpBuffer, - LPDWORD nSize - ) -{ - WCHAR Name [MAX_COMPUTERNAME_LENGTH + 1]; - DWORD Size = 0; - - /* - * FIXME: get the computer's name from - * the registry. - */ - lstrcpyW( Name, L"ROSHost" ); /* <-- FIXME -- */ - Size = lstrlenW(Name) + 1; - if (Size > *nSize) - { - *nSize = Size; - SetLastError(ERROR_BUFFER_OVERFLOW); - return FALSE; - } - lstrcpyW( lpBuffer, Name ); - return TRUE; -} - - -WINBOOL -STDCALL -GetComputerNameA ( - LPSTR lpBuffer, - LPDWORD nSize - ) + UINT a0, + LPCPINFO a1 + ) { - WCHAR Name [MAX_COMPUTERNAME_LENGTH + 1]; - int i; - - if (FALSE == GetComputerNameW( - Name, - nSize - )) - { - return FALSE; - } -/* FIXME --> */ -/* Use UNICODE to ANSI */ - for ( i=0; Name[i]; ++i ) - { - lpBuffer[i] = (CHAR) Name[i]; - } - lpBuffer[i] = '\0'; -/* FIXME <-- */ - return TRUE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } - - int STDCALL GetCurrencyFormatW ( - LCID Locale, - DWORD dwFlags, - LPCWSTR lpValue, - CONST CURRENCYFMT * lpFormat, - LPWSTR lpCurrencyStr, - int cchCurrency - ) + LCID Locale, + DWORD dwFlags, + LPCWSTR lpValue, + CONST CURRENCYFMT * lpFormat, + LPWSTR lpCurrencyStr, + int cchCurrency + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL GetCurrencyFormatA ( - LCID Locale, - DWORD dwFlags, - LPCSTR lpValue, - CONST CURRENCYFMT * lpFormat, - LPSTR lpCurrencyStr, - int cchCurrency - ) + LCID Locale, + DWORD dwFlags, + LPCSTR lpValue, + CONST CURRENCYFMT * lpFormat, + LPSTR lpCurrencyStr, + int cchCurrency + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } - - - int STDCALL GetDateFormatW ( - LCID Locale, - DWORD dwFlags, - CONST SYSTEMTIME * lpDate, - LPCWSTR lpFormat, - LPWSTR lpDateStr, - int cchDate - ) + LCID Locale, + DWORD dwFlags, + CONST SYSTEMTIME * lpDate, + LPCWSTR lpFormat, + LPWSTR lpDateStr, + int cchDate + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL GetDateFormatA ( - LCID Locale, - DWORD dwFlags, - CONST SYSTEMTIME * lpDate, - LPCSTR lpFormat, - LPSTR lpDateStr, - int cchDate - ) + LCID Locale, + DWORD dwFlags, + CONST SYSTEMTIME * lpDate, + LPCSTR lpFormat, + LPSTR lpDateStr, + int cchDate + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL GetLocaleInfoW ( - LCID Locale, - LCTYPE LCType, - LPWSTR lpLCData, - int cchData - ) + LCID Locale, + LCTYPE LCType, + LPWSTR lpLCData, + int cchData + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL GetLocaleInfoA ( - LCID Locale, - LCTYPE LCType, - LPSTR lpLCData, - int cchData - ) + LCID Locale, + LCTYPE LCType, + LPSTR lpLCData, + int cchData + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } DWORD STDCALL GetNextVDMCommand ( - DWORD Unknown0 - ) + DWORD Unknown0 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL GetNumberFormatW ( - LCID Locale, - DWORD dwFlags, - LPCWSTR lpValue, - CONST NUMBERFMT * lpFormat, - LPWSTR lpNumberStr, - int cchNumber - ) + LCID Locale, + DWORD dwFlags, + LPCWSTR lpValue, + CONST NUMBERFMT * lpFormat, + LPWSTR lpNumberStr, + int cchNumber + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL GetNumberFormatA ( - LCID Locale, - DWORD dwFlags, - LPCSTR lpValue, - CONST NUMBERFMT * lpFormat, - LPSTR lpNumberStr, - int cchNumber - ) + LCID Locale, + DWORD dwFlags, + LPCSTR lpValue, + CONST NUMBERFMT * lpFormat, + LPSTR lpNumberStr, + int cchNumber + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } @@ -574,67 +468,67 @@ UINT STDCALL GetOEMCP (VOID) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 437; /* FIXME: call csrss.exe */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 437; /* FIXME: call csrss.exe */ } WINBOOL STDCALL GetStringTypeExW ( - LCID Locale, - DWORD dwInfoType, - LPCWSTR lpSrcStr, - int cchSrc, - LPWORD lpCharType - ) + LCID Locale, + DWORD dwInfoType, + LPCWSTR lpSrcStr, + int cchSrc, + LPWORD lpCharType + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL GetStringTypeExA ( - LCID Locale, - DWORD dwInfoType, - LPCSTR lpSrcStr, - int cchSrc, - LPWORD lpCharType - ) + LCID Locale, + DWORD dwInfoType, + LPCSTR lpSrcStr, + int cchSrc, + LPWORD lpCharType + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL GetStringTypeW ( - DWORD dwInfoType, - LPCWSTR lpSrcStr, - int cchSrc, - LPWORD lpCharType - ) + DWORD dwInfoType, + LPCWSTR lpSrcStr, + int cchSrc, + LPWORD lpCharType + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL GetStringTypeA ( - LCID Locale, - DWORD dwInfoType, - LPCSTR lpSrcStr, - int cchSrc, - LPWORD lpCharType - ) + LCID Locale, + DWORD dwInfoType, + LPCSTR lpSrcStr, + int cchSrc, + LPWORD lpCharType + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } @@ -642,12 +536,12 @@ LCID STDCALL GetSystemDefaultLCID (VOID) { - /* FIXME: ??? */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return MAKELCID( - LANG_ENGLISH, - SORT_DEFAULT - ); + /* FIXME: ??? */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return MAKELCID( + LANG_ENGLISH, + SORT_DEFAULT + ); } @@ -655,23 +549,23 @@ LANGID STDCALL GetSystemDefaultLangID (VOID) { - /* FIXME: ??? */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return MAKELANGID( - LANG_ENGLISH, - SUBLANG_ENGLISH_US - ); + /* FIXME: ??? */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return MAKELANGID( + LANG_ENGLISH, + SUBLANG_ENGLISH_US + ); } DWORD STDCALL GetSystemPowerStatus ( - DWORD Unknown0 - ) + DWORD Unknown0 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } @@ -679,68 +573,70 @@ LCID STDCALL GetThreadLocale (VOID) { - /* FIXME: ??? */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return MAKELCID( - LANG_ENGLISH, - SORT_DEFAULT - ); + /* FIXME: ??? */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return MAKELCID( + LANG_ENGLISH, + SORT_DEFAULT + ); } + WINBOOL STDCALL GetThreadPriorityBoost ( - HANDLE hThread, - DWORD dwSelector, - LPLDT_ENTRY lpSelectorEntry - ) + HANDLE hThread, + DWORD dwSelector, + LPLDT_ENTRY lpSelectorEntry + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } + WINBOOL STDCALL GetThreadSelectorEntry ( - HANDLE hThread, - DWORD dwSelector, - LPLDT_ENTRY lpSelectorEntry - ) + HANDLE hThread, + DWORD dwSelector, + LPLDT_ENTRY lpSelectorEntry + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } int STDCALL GetTimeFormatW ( - LCID Locale, - DWORD dwFlags, - CONST SYSTEMTIME * lpTime, - LPCWSTR lpFormat, - LPWSTR lpTimeStr, - int cchTime - ) + LCID Locale, + DWORD dwFlags, + CONST SYSTEMTIME * lpTime, + LPCWSTR lpFormat, + LPWSTR lpTimeStr, + int cchTime + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL GetTimeFormatA ( - LCID Locale, - DWORD dwFlags, - CONST SYSTEMTIME * lpTime, - LPCSTR lpFormat, - LPSTR lpTimeStr, - int cchTime - ) + LCID Locale, + DWORD dwFlags, + CONST SYSTEMTIME * lpTime, + LPCSTR lpFormat, + LPSTR lpTimeStr, + int cchTime + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } @@ -748,12 +644,12 @@ LCID STDCALL GetUserDefaultLCID (VOID) { - /* FIXME: ??? */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return MAKELCID( - LANG_ENGLISH, - SORT_DEFAULT - ); + /* FIXME: ??? */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return MAKELCID( + LANG_ENGLISH, + SORT_DEFAULT + ); } @@ -761,400 +657,190 @@ LANGID STDCALL GetUserDefaultLangID (VOID) { - /* FIXME: ??? */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return MAKELANGID( - LANG_ENGLISH, - SUBLANG_ENGLISH_US - ); + /* FIXME: ??? */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return MAKELANGID( + LANG_ENGLISH, + SUBLANG_ENGLISH_US + ); } DWORD STDCALL GetVDMCurrentDirectories ( - DWORD Unknown0, - DWORD Unknown1 - ) + DWORD Unknown0, + DWORD Unknown1 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } WINBOOL STDCALL IsDBCSLeadByte ( - BYTE TestChar - ) + BYTE TestChar + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL IsDBCSLeadByteEx ( - UINT CodePage, - BYTE TestChar - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/********************************************************************** - * NAME PRIVATE - * IsInstalledCP@4 - * - * RETURN VALUE - * TRUE if CodePage is installed in the system. - */ -static -BOOL -STDCALL -IsInstalledCP ( - UINT CodePage - ) + UINT CodePage, + BYTE TestChar + ) { - /* FIXME */ - return TRUE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL IsValidCodePage ( - UINT CodePage - ) + UINT CodePage + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL IsValidLocale ( - LCID Locale, - DWORD dwFlags - ) + LCID Locale, + DWORD dwFlags + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } int STDCALL LCMapStringA ( - LCID Locale, - DWORD dwMapFlags, - LPCSTR lpSrcStr, - int cchSrc, - LPSTR lpDestStr, - int cchDest - ) + LCID Locale, + DWORD dwMapFlags, + LPCSTR lpSrcStr, + int cchSrc, + LPSTR lpDestStr, + int cchDest + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } int STDCALL LCMapStringW ( - LCID Locale, - DWORD dwMapFlags, - LPCWSTR lpSrcStr, - int cchSrc, - LPWSTR lpDestStr, - int cchDest - ) + LCID Locale, + DWORD dwMapFlags, + LPCWSTR lpSrcStr, + int cchSrc, + LPWSTR lpDestStr, + int cchDest + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } DWORD STDCALL LoadModule ( - LPCSTR lpModuleName, - LPVOID lpParameterBlock - ) + LPCSTR lpModuleName, + LPVOID lpParameterBlock + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/*********************************************************************** - * MulDiv (KERNEL32.@) - * RETURNS - * Result of multiplication and division - * -1: Overflow occurred or Divisor was 0 - */ - -//FIXME! move to correct file -INT STDCALL MulDiv( - INT nMultiplicand, - INT nMultiplier, - INT nDivisor) -{ -#if SIZEOF_LONG_LONG >= 8 - long long ret; - - if (!nDivisor) return -1; - - /* We want to deal with a positive divisor to simplify the logic. */ - if (nDivisor < 0) - { - nMultiplicand = - nMultiplicand; - nDivisor = -nDivisor; - } - - /* If the result is positive, we "add" to round. else, we subtract to round. */ - if ( ( (nMultiplicand < 0) && (nMultiplier < 0) ) || - ( (nMultiplicand >= 0) && (nMultiplier >= 0) ) ) - ret = (((long long)nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor; - else - ret = (((long long)nMultiplicand * nMultiplier) - (nDivisor/2)) / nDivisor; - - if ((ret > 2147483647) || (ret < -2147483647)) return -1; - return ret; -#else - if (!nDivisor) return -1; - - /* We want to deal with a positive divisor to simplify the logic. */ - if (nDivisor < 0) - { - nMultiplicand = - nMultiplicand; - nDivisor = -nDivisor; - } - - /* If the result is positive, we "add" to round. else, we subtract to round. */ - if ( ( (nMultiplicand < 0) && (nMultiplier < 0) ) || - ( (nMultiplicand >= 0) && (nMultiplier >= 0) ) ) - return ((nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor; - - return ((nMultiplicand * nMultiplier) - (nDivisor/2)) / nDivisor; - -#endif -} - - -/********************************************************************** - * NAME EXPORTED - * MultiByteToWideChar@24 - * - * ARGUMENTS - * CodePage - * CP_ACP ANSI code page - * CP_MACCP Macintosh code page - * CP_OEMCP OEM code page - * (UINT) Any installed code page - * - * dwFlags - * MB_PRECOMPOSED - * MB_COMPOSITE - * MB_ERR_INVALID_CHARS - * MB_USEGLYPHCHARS - * - * lpMultiByteStr - * Input buffer; - * - * cchMultiByte - * Size of MultiByteStr, or -1 if MultiByteStr is - * NULL terminated; - * - * lpWideCharStr - * Output buffer; - * - * cchWideChar - * Size (in WCHAR unit) of WideCharStr, or 0 - * if the caller just wants to know how large - * WideCharStr should be for a successful - * conversion. - * - * RETURN VALUE - * 0 on error; otherwise the number of WCHAR written - * in the WideCharStr buffer. - * - * NOTE - * A raw converter for now. It assumes lpMultiByteStr is - * NEVER multi-byte (that is each input character is - * 8-bit ASCII) and is ALWAYS NULL terminated. - * FIXME-FIXME-FIXME-FIXME - */ -INT -STDCALL -MultiByteToWideChar ( - UINT CodePage, - DWORD dwFlags, - LPCSTR lpMultiByteStr, - int cchMultiByte, - LPWSTR lpWideCharStr, - int cchWideChar - ) -{ - int InStringLength = 0; - PCHAR r; - PWCHAR w; - int cchConverted; - - /* - * Check the parameters. - */ - if ( /* --- CODE PAGE --- */ - ( (CP_ACP != CodePage) - && (CP_MACCP != CodePage) - && (CP_OEMCP != CodePage) - && (FALSE == IsInstalledCP (CodePage)) - ) - /* --- FLAGS --- */ - || (dwFlags & ~(MB_PRECOMPOSED - | MB_COMPOSITE - | MB_ERR_INVALID_CHARS - | MB_USEGLYPHCHARS - ) - ) - /* --- INPUT BUFFER --- */ - || (NULL == lpMultiByteStr) - ) - { - SetLastError (ERROR_INVALID_PARAMETER); - return 0; - } - /* - * Compute the input buffer length. - */ - if (-1 == cchMultiByte) - { - InStringLength = lstrlen (lpMultiByteStr) + 1; - } - else - { - InStringLength = cchMultiByte; - } - /* - * Does caller query for output - * buffer size? - */ - if (0 == cchWideChar) - { - SetLastError (ERROR_SUCCESS); - return InStringLength; - } - /* - * Is space provided for the translated - * string enough? - */ - if (cchWideChar < InStringLength) - { - SetLastError (ERROR_INSUFFICIENT_BUFFER); - return 0; - } - /* - * Raw 8- to 16-bit conversion. - */ - for ( cchConverted = 0, - r = (PCHAR) lpMultiByteStr, - w = (PWCHAR) lpWideCharStr; - - cchConverted < InStringLength; - - r++, - w++, - cchConverted++ - ) - { - *w = (WCHAR) *r; - } - /* - * Return how many characters we - * wrote in the output buffer. - */ - SetLastError (ERROR_SUCCESS); - return cchConverted; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } WINBOOL STDCALL QueryPerformanceCounter ( - LARGE_INTEGER * lpPerformanceCount - ) + LARGE_INTEGER * lpPerformanceCount + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL QueryPerformanceFrequency ( - LARGE_INTEGER * lpFrequency - ) + LARGE_INTEGER * lpFrequency + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL RegisterConsoleVDM ( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2, - DWORD Unknown3, - DWORD Unknown4, - DWORD Unknown5, - DWORD Unknown6, - DWORD Unknown7, - DWORD Unknown8, - DWORD Unknown9, - DWORD Unknown10 - ) + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2, + DWORD Unknown3, + DWORD Unknown4, + DWORD Unknown5, + DWORD Unknown6, + DWORD Unknown7, + DWORD Unknown8, + DWORD Unknown9, + DWORD Unknown10 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL RegisterWowBaseHandlers ( - DWORD Unknown0 - ) + DWORD Unknown0 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL RegisterWowExec ( - DWORD Unknown0 - ) + DWORD Unknown0 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL SetComputerNameA ( - LPCSTR lpComputerName - ) + LPCSTR lpComputerName + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } @@ -1164,312 +850,159 @@ SetComputerNameW ( LPCWSTR lpComputerName ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL SetLocaleInfoA ( - LCID Locale, - LCTYPE LCType, - LPCSTR lpLCData - ) + LCID Locale, + LCTYPE LCType, + LPCSTR lpLCData + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL SetLocaleInfoW ( - LCID Locale, - LCTYPE LCType, - LPCWSTR lpLCData - ) + LCID Locale, + LCTYPE LCType, + LPCWSTR lpLCData + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } WINBOOL STDCALL SetSystemPowerState ( - DWORD Unknown0, - DWORD Unknown1 - ) + DWORD Unknown0, + DWORD Unknown1 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } + WINBOOL STDCALL SetThreadIdealProcessor(VOID) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } WINBOOL STDCALL SetThreadLocale ( - LCID Locale - ) + LCID Locale + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } + WINBOOL STDCALL SetThreadPriorityBoost(VOID) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } + WINBOOL STDCALL SetVDMCurrentDirectories ( - DWORD Unknown0, - DWORD Unknown1 - ) + DWORD Unknown0, + DWORD Unknown1 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; } DWORD STDCALL TrimVirtualBuffer ( - DWORD Unknown0 - ) + DWORD Unknown0 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } DWORD STDCALL VDMConsoleOperation ( - DWORD Unknown0, - DWORD Unknown1 - ) + DWORD Unknown0, + DWORD Unknown1 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } DWORD STDCALL VDMOperationStarted ( - DWORD Unknown0 - ) + DWORD Unknown0 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } DWORD STDCALL VerLanguageNameA ( - DWORD wLang, - LPSTR szLang, - DWORD nSize - ) + DWORD wLang, + LPSTR szLang, + DWORD nSize + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } DWORD STDCALL VerLanguageNameW ( - DWORD wLang, - LPWSTR szLang, - DWORD nSize - ) + DWORD wLang, + LPWSTR szLang, + DWORD nSize + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } DWORD STDCALL VirtualBufferExceptionHandler ( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2 - ) + DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2 + ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } - -/********************************************************************** - * NAME EXPORTED - * MultiByteToWideChar@32 - * - * Not yet implemented complete (without NLS so far) - * - * ARGUMENTS - * CodePage - * CP_ACP ANSI code page - * CP_MACCP Macintosh code page - * CP_OEMCP OEM code page - * CP_SYMBOL Symbol code page (42) - * CP_THREAD_ACP Current thread's ANSI code page - * CP_UTF7 Translate using UTF-7 - * CP_UTF8 Translate using UTF-8 - * (UINT) Any installed code page - * - * dwFlags - * WC_NO_BEST_FIT_CHARS - * WC_COMPOSITECHECK Convert composite characters to precomposed characters. - * WC_DISCARDNS Discard nonspacing characters during conversion. - * WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior. - * WC_DEFAULTCHAR Replace exceptions with the default character during conversion. - * - * lpWideCharStr - * Points to the wide-character string to be converted. - * - * cchWideChar - * Size (in WCHAR unit) of WideCharStr, or 0 - * if the caller just wants to know how large - * WideCharStr should be for a successful - * conversion. - * lpMultiByteStr - * Points to the buffer to receive the translated string. - * cchMultiByte - * Specifies the size in bytes of the buffer pointed to by the - * lpMultiByteStr parameter. If this value is zero, the function - * returns the number of bytes required for the buffer. - * lpDefaultChar - * Points to the character used if a wide character cannot be - * represented in the specified code page. If this parameter is - * NULL, a system default value is used. - FIXME: ignored - * lpUsedDefaultChar - * Points to a flag that indicates whether a default character was used. - * This parameter may be NULL. - FIXME: allways set to FALSE. - * - * - * - * RETURN VALUE - * 0 on error; otherwise the number of bytes written - * in the lpMultiByteStr buffer. Or the number of - * bytes needed for the lpMultiByteStr buffer if cchMultiByte is zero. - * - * NOTE - * A raw converter for now. It just cuts off the upper 9 Bit. - * So the MBCS-string does not contain any LeadCharacters - * FIXME - FIXME - FIXME - FIXME - */ - -int -STDCALL -WideCharToMultiByte ( - UINT CodePage, - DWORD dwFlags, - LPCWSTR lpWideCharStr, - int cchWideChar, - LPSTR lpMultiByteStr, - int cchMultiByte, - LPCSTR lpDefaultChar, - LPBOOL lpUsedDefaultChar - ) -{ - int wi, di; // wide counter, dbcs byte count - - /* - * Check the parameters. - */ - if ( /* --- CODE PAGE --- */ - ( (CP_ACP != CodePage) - && (CP_MACCP != CodePage) - && (CP_OEMCP != CodePage) - && (CP_SYMBOL != CodePage) - && (CP_THREAD_ACP != CodePage) - && (CP_UTF7 != CodePage) - && (CP_UTF8 != CodePage) - && (FALSE == IsInstalledCP (CodePage)) - ) - /* --- FLAGS --- */ - || (dwFlags & ~(/*WC_NO_BEST_FIT_CHARS - |*/ WC_COMPOSITECHECK - | WC_DISCARDNS - | WC_SEPCHARS - | WC_DEFAULTCHAR - ) - ) - /* --- INPUT BUFFER --- */ - || (NULL == lpWideCharStr) - ) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - // for now, make no difference but only convert cut the characters to 7Bit - if( cchWideChar == -1 ) // assume its a 0-terminated str - { // and determine its length - for( cchWideChar=0; lpWideCharStr[cchWideChar]!=0; cchWideChar++) - cchWideChar++; - } - - // user wants to determine needed space - if( cchMultiByte == 0 ) - { - SetLastError(ERROR_SUCCESS); - return cchWideChar; // FIXME: determine correct. - } - // the lpWideCharStr is cchWideChar characters long. - for( wi=0, di=0; wi127) ) - { - lpMultiByteStr[di]= - *lpUsedDefaultChar = TRUE; - - }*/ - // FIXME - // just cut off the upper 9 Bit, since vals>=128 mean LeadByte. - lpMultiByteStr[di] = lpWideCharStr[wi] & 0x007F; - } - // has MultiByte exceeded but Wide is still in the string? - if( wi < cchWideChar && di >= cchMultiByte) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return 0; - } - // else return # of bytes wirtten to MBCSbuffer (di) - SetLastError(ERROR_SUCCESS); - // FIXME: move that elsewhere - if( lpUsedDefaultChar!=NULL ) *lpUsedDefaultChar=FALSE; - return di; -} - - - - - - - - - - - /* EOF */