1 /* $Id: stubs.c,v 1.32 2002/09/08 10:22:45 chorns 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
);
685 GetThreadSelectorEntry (
688 LPLDT_ENTRY lpSelectorEntry
691 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
701 CONST SYSTEMTIME
* lpTime
,
707 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
717 CONST SYSTEMTIME
* lpTime
,
723 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
730 GetUserDefaultLCID (VOID
)
733 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
743 GetUserDefaultLangID (VOID
)
746 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
756 GetVDMCurrentDirectories (
761 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
772 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
784 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
789 /**********************************************************************
794 * TRUE if CodePage is installed in the system.
814 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
826 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
842 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
858 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
867 LPVOID lpParameterBlock
870 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
875 /***********************************************************************
876 * MulDiv (KERNEL32.@)
878 * Result of multiplication and division
879 * -1: Overflow occurred or Divisor was 0
882 //FIXME! move to correct file
888 #if SIZEOF_LONG_LONG >= 8
891 if (!nDivisor
) return -1;
893 /* We want to deal with a positive divisor to simplify the logic. */
896 nMultiplicand
= - nMultiplicand
;
897 nDivisor
= -nDivisor
;
900 /* If the result is positive, we "add" to round. else, we subtract to round. */
901 if ( ( (nMultiplicand
< 0) && (nMultiplier
< 0) ) ||
902 ( (nMultiplicand
>= 0) && (nMultiplier
>= 0) ) )
903 ret
= (((long long)nMultiplicand
* nMultiplier
) + (nDivisor
/2)) / nDivisor
;
905 ret
= (((long long)nMultiplicand
* nMultiplier
) - (nDivisor
/2)) / nDivisor
;
907 if ((ret
> 2147483647) || (ret
< -2147483647)) return -1;
910 if (!nDivisor
) return -1;
912 /* We want to deal with a positive divisor to simplify the logic. */
915 nMultiplicand
= - nMultiplicand
;
916 nDivisor
= -nDivisor
;
919 /* If the result is positive, we "add" to round. else, we subtract to round. */
920 if ( ( (nMultiplicand
< 0) && (nMultiplier
< 0) ) ||
921 ( (nMultiplicand
>= 0) && (nMultiplier
>= 0) ) )
922 return ((nMultiplicand
* nMultiplier
) + (nDivisor
/2)) / nDivisor
;
924 return ((nMultiplicand
* nMultiplier
) - (nDivisor
/2)) / nDivisor
;
930 /**********************************************************************
932 * MultiByteToWideChar@24
936 * CP_ACP ANSI code page
937 * CP_MACCP Macintosh code page
938 * CP_OEMCP OEM code page
939 * (UINT) Any installed code page
944 * MB_ERR_INVALID_CHARS
951 * Size of MultiByteStr, or -1 if MultiByteStr is
958 * Size (in WCHAR unit) of WideCharStr, or 0
959 * if the caller just wants to know how large
960 * WideCharStr should be for a successful
964 * 0 on error; otherwise the number of WCHAR written
965 * in the WideCharStr buffer.
968 * A raw converter for now. It assumes lpMultiByteStr is
969 * NEVER multi-byte (that is each input character is
970 * 8-bit ASCII) and is ALWAYS NULL terminated.
971 * FIXME-FIXME-FIXME-FIXME
975 MultiByteToWideChar (
978 LPCSTR lpMultiByteStr
,
980 LPWSTR lpWideCharStr
,
984 int InStringLength
= 0;
985 BOOL InIsNullTerminated
= TRUE
;
991 * Check the parameters.
993 if ( /* --- CODE PAGE --- */
994 ( (CP_ACP
!= CodePage
)
995 && (CP_MACCP
!= CodePage
)
996 && (CP_OEMCP
!= CodePage
)
997 && (FALSE
== IsInstalledCP (CodePage
))
1000 || (dwFlags
^ ( MB_PRECOMPOSED
1002 | MB_ERR_INVALID_CHARS
1006 /* --- INPUT BUFFER --- */
1007 || (NULL
== lpMultiByteStr
)
1010 SetLastError (ERROR_INVALID_PARAMETER
);
1014 * Compute the input buffer length.
1016 if (-1 == cchMultiByte
)
1018 InStringLength
= lstrlen (lpMultiByteStr
);
1022 InIsNullTerminated
= FALSE
;
1023 InStringLength
= cchMultiByte
;
1026 * Does caller query for output
1029 if (0 == cchWideChar
)
1031 SetLastError (ERROR_SUCCESS
);
1032 return InStringLength
;
1035 * Is space provided for the translated
1038 if (cchWideChar
< InStringLength
)
1040 SetLastError (ERROR_INSUFFICIENT_BUFFER
);
1044 * Raw 8- to 16-bit conversion.
1046 for ( cchConverted
= 0,
1047 r
= (PCHAR
) lpMultiByteStr
,
1048 w
= (PWCHAR
) lpWideCharStr
;
1050 ((*r
) && (cchConverted
< cchWideChar
));
1059 * Is the input string NULL terminated?
1061 if (TRUE
== InIsNullTerminated
)
1067 * Return how many characters we
1068 * wrote in the output buffer.
1070 SetLastError (ERROR_SUCCESS
);
1071 return cchConverted
;
1077 QueryPerformanceCounter (
1078 LARGE_INTEGER
* lpPerformanceCount
1081 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1088 QueryPerformanceFrequency (
1089 LARGE_INTEGER
* lpFrequency
1092 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1099 RegisterConsoleVDM (
1113 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1120 RegisterWowBaseHandlers (
1124 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1135 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1143 LPCSTR lpComputerName
1146 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1154 LPCWSTR lpComputerName
1157 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1170 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1183 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1190 SetSystemPowerState (
1195 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1206 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1213 SetVDMCurrentDirectories (
1218 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1229 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1236 VDMConsoleOperation (
1241 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1248 VDMOperationStarted (
1252 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1265 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1278 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1285 VirtualBufferExceptionHandler (
1291 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1296 /**********************************************************************
1298 * MultiByteToWideChar@32
1300 * Not yet implemented complete (without NLS so far)
1304 * CP_ACP ANSI code page
1305 * CP_MACCP Macintosh code page
1306 * CP_OEMCP OEM code page
1307 * CP_SYMBOL Symbol code page (42)
1308 * CP_THREAD_ACP Current thread's ANSI code page
1309 * CP_UTF7 Translate using UTF-7
1310 * CP_UTF8 Translate using UTF-8
1311 * (UINT) Any installed code page
1314 * WC_NO_BEST_FIT_CHARS
1315 * WC_COMPOSITECHECK Convert composite characters to precomposed characters.
1316 * WC_DISCARDNS Discard nonspacing characters during conversion.
1317 * WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior.
1318 * WC_DEFAULTCHAR Replace exceptions with the default character during conversion.
1321 * Points to the wide-character string to be converted.
1324 * Size (in WCHAR unit) of WideCharStr, or 0
1325 * if the caller just wants to know how large
1326 * WideCharStr should be for a successful
1329 * Points to the buffer to receive the translated string.
1331 * Specifies the size in bytes of the buffer pointed to by the
1332 * lpMultiByteStr parameter. If this value is zero, the function
1333 * returns the number of bytes required for the buffer.
1335 * Points to the character used if a wide character cannot be
1336 * represented in the specified code page. If this parameter is
1337 * NULL, a system default value is used.
1340 * Points to a flag that indicates whether a default character was used.
1341 * This parameter may be NULL.
1342 FIXME: allways set to FALSE.
1347 * 0 on error; otherwise the number of bytes written
1348 * in the lpMultiByteStr buffer. Or the number of
1349 * bytes needed for the lpMultiByteStr buffer if cchMultiByte is zero.
1352 * A raw converter for now. It just cuts off the upper 9 Bit.
1353 * So the MBCS-string does not contain any LeadCharacters
1354 * FIXME - FIXME - FIXME - FIXME
1359 WideCharToMultiByte (
1362 LPCWSTR lpWideCharStr
,
1364 LPSTR lpMultiByteStr
,
1366 LPCSTR lpDefaultChar
,
1367 LPBOOL lpUsedDefaultChar
1370 int wi
, di
; // wide counter, dbcs byte count
1372 // for now, make no difference but only convert cut the characters to 7Bit
1375 case CP_ACP
: //ANSI code page
1376 case CP_MACCP
: //Macintosh code page
1377 case CP_OEMCP
: //OEM code page
1378 case CP_SYMBOL
: //Symbol code page (42)
1379 case CP_THREAD_ACP
: //ACP Current thread's ANSI code page
1380 case CP_UTF7
: //Translate using UTF-7
1381 case CP_UTF8
: //Translate using UTF-8
1382 if( cchWideChar
== -1 ) // assume its a 0-terminated str
1383 { // and determine its length
1384 for( cchWideChar
=0; lpWideCharStr
[cchWideChar
]!=0; )
1388 // user wants to determine needed space
1389 if( cchMultiByte
== 0 )
1391 SetLastError(ERROR_SUCCESS
);
1392 return cchWideChar
; // FIXME: determine correct.
1394 // the lpWideCharStr is cchWideChar characters long.
1395 for( wi
=0, di
=0; wi
<cchWideChar
&& di
<cchMultiByte
; ++wi
)
1397 // Flag and a not displayable char FIXME
1398 /*if( (dwFlags&WC_NO_BEST_FIT_CHARS) && (lpWideCharStr[wi] >127) )
1401 *lpUsedDefaultChar = TRUE;
1405 // just cut off the upper 9 Bit, since vals>=128 mean LeadByte.
1406 lpMultiByteStr
[di
] = lpWideCharStr
[wi
] & 0x007F;
1409 // has MultiByte exceeded but Wide is still in the string?
1410 if( wi
< cchWideChar
&& di
>= cchMultiByte
)
1412 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
1415 // else return # of bytes wirtten to MBCSbuffer (di)
1416 SetLastError(ERROR_SUCCESS
);
1417 // FIXME: move that elsewhere
1418 if( lpUsedDefaultChar
!=NULL
) *lpUsedDefaultChar
=FALSE
;
1422 SetLastError(ERROR_INVALID_PARAMETER
);
1426 SetLastError(ERROR_INVALID_PARAMETER
);