1 /* $Id: stubs.c,v 1.34 2002/09/27 15:29:03 hbirr Exp $
3 * KERNEL32.DLL stubs (unimplemented functions)
4 * Remove from this file, if you implement them.
12 BaseAttachCompleteThunk (VOID
)
14 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
25 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
41 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
57 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
64 ConvertDefaultLocale (
68 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
81 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
89 CALINFO_ENUMPROC lpCalInfoEnumProc
,
95 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
104 CALINFO_ENUMPROC lpCalInfoEnumProc
,
110 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
118 DATEFMT_ENUMPROC lpDateFmtEnumProc
,
123 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
131 DATEFMT_ENUMPROC lpDateFmtEnumProc
,
136 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
145 EnumSystemCodePagesW (
146 CODEPAGE_ENUMPROC lpCodePageEnumProc
,
150 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
157 EnumSystemCodePagesA (
158 CODEPAGE_ENUMPROC lpCodePageEnumProc
,
162 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
170 LOCALE_ENUMPROC lpLocaleEnumProc
,
174 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
182 LOCALE_ENUMPROC lpLocaleEnumProc
,
186 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
194 TIMEFMT_ENUMPROC lpTimeFmtEnumProc
,
199 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
207 TIMEFMT_ENUMPROC lpTimeFmtEnumProc
,
212 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
229 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
238 ExtendVirtualBuffer (
243 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
258 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
273 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
290 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
307 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
315 HANDLE hVirtualBuffer
318 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
327 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
334 LPCWSTR lpApplicationName
,
338 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
346 LPCSTR lpApplicationName
,
350 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
362 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
376 WCHAR Name
[MAX_COMPUTERNAME_LENGTH
+ 1];
380 * FIXME: get the computer's name from
383 lstrcpyW( Name
, L
"ROSHost" ); /* <-- FIXME -- */
384 Size
= lstrlenW(Name
) + 1;
388 SetLastError(ERROR_BUFFER_OVERFLOW
);
391 lstrcpyW( lpBuffer
, Name
);
403 WCHAR Name
[MAX_COMPUTERNAME_LENGTH
+ 1];
406 if (FALSE
== GetComputerNameW(
414 /* Use UNICODE to ANSI */
415 for ( i
=0; Name
[i
]; ++i
)
417 lpBuffer
[i
] = (CHAR
) Name
[i
];
433 CONST CURRENCYFMT
* lpFormat
,
434 LPWSTR lpCurrencyStr
,
438 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
449 CONST CURRENCYFMT
* lpFormat
,
454 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
467 CONST SYSTEMTIME
* lpDate
,
473 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
483 CONST SYSTEMTIME
* lpDate
,
489 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
503 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
517 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
528 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
539 CONST NUMBERFMT
* lpFormat
,
544 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
555 CONST NUMBERFMT
* lpFormat
,
560 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
569 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
570 return 437; /* FIXME: call csrss.exe */
584 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
599 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
613 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
628 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
635 GetSystemDefaultLCID (VOID
)
638 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
648 GetSystemDefaultLangID (VOID
)
651 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
661 GetSystemPowerStatus (
665 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
672 GetThreadLocale (VOID
)
675 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
684 GetThreadPriorityBoost (
687 LPLDT_ENTRY lpSelectorEntry
690 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
696 GetThreadSelectorEntry (
699 LPLDT_ENTRY lpSelectorEntry
702 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
712 CONST SYSTEMTIME
* lpTime
,
718 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
728 CONST SYSTEMTIME
* lpTime
,
734 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
741 GetUserDefaultLCID (VOID
)
744 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
754 GetUserDefaultLangID (VOID
)
757 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
767 GetVDMCurrentDirectories (
772 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
783 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
795 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
800 /**********************************************************************
805 * TRUE if CodePage is installed in the system.
825 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
837 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
853 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
869 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
878 LPVOID lpParameterBlock
881 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
886 /***********************************************************************
887 * MulDiv (KERNEL32.@)
889 * Result of multiplication and division
890 * -1: Overflow occurred or Divisor was 0
893 //FIXME! move to correct file
899 #if SIZEOF_LONG_LONG >= 8
902 if (!nDivisor
) return -1;
904 /* We want to deal with a positive divisor to simplify the logic. */
907 nMultiplicand
= - nMultiplicand
;
908 nDivisor
= -nDivisor
;
911 /* If the result is positive, we "add" to round. else, we subtract to round. */
912 if ( ( (nMultiplicand
< 0) && (nMultiplier
< 0) ) ||
913 ( (nMultiplicand
>= 0) && (nMultiplier
>= 0) ) )
914 ret
= (((long long)nMultiplicand
* nMultiplier
) + (nDivisor
/2)) / nDivisor
;
916 ret
= (((long long)nMultiplicand
* nMultiplier
) - (nDivisor
/2)) / nDivisor
;
918 if ((ret
> 2147483647) || (ret
< -2147483647)) return -1;
921 if (!nDivisor
) return -1;
923 /* We want to deal with a positive divisor to simplify the logic. */
926 nMultiplicand
= - nMultiplicand
;
927 nDivisor
= -nDivisor
;
930 /* If the result is positive, we "add" to round. else, we subtract to round. */
931 if ( ( (nMultiplicand
< 0) && (nMultiplier
< 0) ) ||
932 ( (nMultiplicand
>= 0) && (nMultiplier
>= 0) ) )
933 return ((nMultiplicand
* nMultiplier
) + (nDivisor
/2)) / nDivisor
;
935 return ((nMultiplicand
* nMultiplier
) - (nDivisor
/2)) / nDivisor
;
941 /**********************************************************************
943 * MultiByteToWideChar@24
947 * CP_ACP ANSI code page
948 * CP_MACCP Macintosh code page
949 * CP_OEMCP OEM code page
950 * (UINT) Any installed code page
955 * MB_ERR_INVALID_CHARS
962 * Size of MultiByteStr, or -1 if MultiByteStr is
969 * Size (in WCHAR unit) of WideCharStr, or 0
970 * if the caller just wants to know how large
971 * WideCharStr should be for a successful
975 * 0 on error; otherwise the number of WCHAR written
976 * in the WideCharStr buffer.
979 * A raw converter for now. It assumes lpMultiByteStr is
980 * NEVER multi-byte (that is each input character is
981 * 8-bit ASCII) and is ALWAYS NULL terminated.
982 * FIXME-FIXME-FIXME-FIXME
986 MultiByteToWideChar (
989 LPCSTR lpMultiByteStr
,
991 LPWSTR lpWideCharStr
,
995 int InStringLength
= 0;
1001 * Check the parameters.
1003 if ( /* --- CODE PAGE --- */
1004 ( (CP_ACP
!= CodePage
)
1005 && (CP_MACCP
!= CodePage
)
1006 && (CP_OEMCP
!= CodePage
)
1007 && (FALSE
== IsInstalledCP (CodePage
))
1010 || (dwFlags
& ~(MB_PRECOMPOSED
1012 | MB_ERR_INVALID_CHARS
1016 /* --- INPUT BUFFER --- */
1017 || (NULL
== lpMultiByteStr
)
1020 SetLastError (ERROR_INVALID_PARAMETER
);
1024 * Compute the input buffer length.
1026 if (-1 == cchMultiByte
)
1028 InStringLength
= lstrlen (lpMultiByteStr
) + 1;
1032 InStringLength
= cchMultiByte
;
1035 * Does caller query for output
1038 if (0 == cchWideChar
)
1040 SetLastError (ERROR_SUCCESS
);
1041 return InStringLength
;
1044 * Is space provided for the translated
1047 if (cchWideChar
< InStringLength
)
1049 SetLastError (ERROR_INSUFFICIENT_BUFFER
);
1053 * Raw 8- to 16-bit conversion.
1055 for ( cchConverted
= 0,
1056 r
= (PCHAR
) lpMultiByteStr
,
1057 w
= (PWCHAR
) lpWideCharStr
;
1059 cchConverted
< InStringLength
;
1069 * Return how many characters we
1070 * wrote in the output buffer.
1072 SetLastError (ERROR_SUCCESS
);
1073 return cchConverted
;
1079 QueryPerformanceCounter (
1080 LARGE_INTEGER
* lpPerformanceCount
1083 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1090 QueryPerformanceFrequency (
1091 LARGE_INTEGER
* lpFrequency
1094 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1101 RegisterConsoleVDM (
1115 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1122 RegisterWowBaseHandlers (
1126 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1137 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1145 LPCSTR lpComputerName
1148 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1156 LPCWSTR lpComputerName
1159 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1172 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1185 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1192 SetSystemPowerState (
1197 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1203 SetThreadIdealProcessor(VOID
)
1205 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1215 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1221 SetThreadPriorityBoost(VOID
)
1223 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1229 SetVDMCurrentDirectories (
1234 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1245 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1252 VDMConsoleOperation (
1257 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1264 VDMOperationStarted (
1268 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1281 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1294 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1301 VirtualBufferExceptionHandler (
1307 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1312 /**********************************************************************
1314 * MultiByteToWideChar@32
1316 * Not yet implemented complete (without NLS so far)
1320 * CP_ACP ANSI code page
1321 * CP_MACCP Macintosh code page
1322 * CP_OEMCP OEM code page
1323 * CP_SYMBOL Symbol code page (42)
1324 * CP_THREAD_ACP Current thread's ANSI code page
1325 * CP_UTF7 Translate using UTF-7
1326 * CP_UTF8 Translate using UTF-8
1327 * (UINT) Any installed code page
1330 * WC_NO_BEST_FIT_CHARS
1331 * WC_COMPOSITECHECK Convert composite characters to precomposed characters.
1332 * WC_DISCARDNS Discard nonspacing characters during conversion.
1333 * WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior.
1334 * WC_DEFAULTCHAR Replace exceptions with the default character during conversion.
1337 * Points to the wide-character string to be converted.
1340 * Size (in WCHAR unit) of WideCharStr, or 0
1341 * if the caller just wants to know how large
1342 * WideCharStr should be for a successful
1345 * Points to the buffer to receive the translated string.
1347 * Specifies the size in bytes of the buffer pointed to by the
1348 * lpMultiByteStr parameter. If this value is zero, the function
1349 * returns the number of bytes required for the buffer.
1351 * Points to the character used if a wide character cannot be
1352 * represented in the specified code page. If this parameter is
1353 * NULL, a system default value is used.
1356 * Points to a flag that indicates whether a default character was used.
1357 * This parameter may be NULL.
1358 FIXME: allways set to FALSE.
1363 * 0 on error; otherwise the number of bytes written
1364 * in the lpMultiByteStr buffer. Or the number of
1365 * bytes needed for the lpMultiByteStr buffer if cchMultiByte is zero.
1368 * A raw converter for now. It just cuts off the upper 9 Bit.
1369 * So the MBCS-string does not contain any LeadCharacters
1370 * FIXME - FIXME - FIXME - FIXME
1375 WideCharToMultiByte (
1378 LPCWSTR lpWideCharStr
,
1380 LPSTR lpMultiByteStr
,
1382 LPCSTR lpDefaultChar
,
1383 LPBOOL lpUsedDefaultChar
1386 int wi
, di
; // wide counter, dbcs byte count
1388 // for now, make no difference but only convert cut the characters to 7Bit
1391 case CP_ACP
: //ANSI code page
1392 case CP_MACCP
: //Macintosh code page
1393 case CP_OEMCP
: //OEM code page
1394 case CP_SYMBOL
: //Symbol code page (42)
1395 case CP_THREAD_ACP
: //ACP Current thread's ANSI code page
1396 case CP_UTF7
: //Translate using UTF-7
1397 case CP_UTF8
: //Translate using UTF-8
1398 if( cchWideChar
== -1 ) // assume its a 0-terminated str
1399 { // and determine its length
1400 for( cchWideChar
=0; lpWideCharStr
[cchWideChar
]!=0; )
1404 // user wants to determine needed space
1405 if( cchMultiByte
== 0 )
1407 SetLastError(ERROR_SUCCESS
);
1408 return cchWideChar
; // FIXME: determine correct.
1410 // the lpWideCharStr is cchWideChar characters long.
1411 for( wi
=0, di
=0; wi
<cchWideChar
&& di
<cchMultiByte
; ++wi
)
1413 // Flag and a not displayable char FIXME
1414 /*if( (dwFlags&WC_NO_BEST_FIT_CHARS) && (lpWideCharStr[wi] >127) )
1417 *lpUsedDefaultChar = TRUE;
1421 // just cut off the upper 9 Bit, since vals>=128 mean LeadByte.
1422 lpMultiByteStr
[di
] = lpWideCharStr
[wi
] & 0x007F;
1425 // has MultiByte exceeded but Wide is still in the string?
1426 if( wi
< cchWideChar
&& di
>= cchMultiByte
)
1428 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
1431 // else return # of bytes wirtten to MBCSbuffer (di)
1432 SetLastError(ERROR_SUCCESS
);
1433 // FIXME: move that elsewhere
1434 if( lpUsedDefaultChar
!=NULL
) *lpUsedDefaultChar
=FALSE
;
1438 SetLastError(ERROR_INVALID_PARAMETER
);
1442 SetLastError(ERROR_INVALID_PARAMETER
);