1 /* $Id: stubs.c,v 1.31 2002/09/07 15:12:27 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
);
88 CALINFO_ENUMPROCW lpCalInfoEnumProc
,
94 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
103 CALINFO_ENUMPROCA lpCalInfoEnumProc
,
109 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
117 DATEFMT_ENUMPROCW lpDateFmtEnumProc
,
122 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
130 DATEFMT_ENUMPROC lpDateFmtEnumProc
,
135 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
144 EnumSystemCodePagesW (
145 CODEPAGE_ENUMPROCW lpCodePageEnumProc
,
149 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
156 EnumSystemCodePagesA (
157 CODEPAGE_ENUMPROCA lpCodePageEnumProc
,
161 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
169 LOCALE_ENUMPROCW lpLocaleEnumProc
,
173 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
181 LOCALE_ENUMPROCA lpLocaleEnumProc
,
185 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
193 TIMEFMT_ENUMPROCW lpTimeFmtEnumProc
,
198 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
206 TIMEFMT_ENUMPROC lpTimeFmtEnumProc
,
211 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
228 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
237 ExtendVirtualBuffer (
242 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
257 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
272 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
289 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
306 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
314 HANDLE hVirtualBuffer
317 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
326 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
333 LPCWSTR lpApplicationName
,
337 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
345 LPCSTR lpApplicationName
,
349 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
361 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
375 WCHAR Name
[MAX_COMPUTERNAME_LENGTH
+ 1];
379 * FIXME: get the computer's name from
382 lstrcpyW( Name
, L
"ROSHost" ); /* <-- FIXME -- */
383 Size
= lstrlenW(Name
) + 1;
387 SetLastError(ERROR_BUFFER_OVERFLOW
);
390 lstrcpyW( lpBuffer
, Name
);
402 WCHAR Name
[MAX_COMPUTERNAME_LENGTH
+ 1];
405 if (FALSE
== GetComputerNameW(
413 /* Use UNICODE to ANSI */
414 for ( i
=0; Name
[i
]; ++i
)
416 lpBuffer
[i
] = (CHAR
) Name
[i
];
431 CONST CURRENCYFMTW
* lpFormat
,
432 LPWSTR lpCurrencyStr
,
436 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
447 CONST CURRENCYFMTA
* lpFormat
,
452 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
465 CONST SYSTEMTIME
* lpDate
,
471 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
481 CONST SYSTEMTIME
* lpDate
,
487 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
501 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
515 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
526 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
537 CONST NUMBERFMTW
* lpFormat
,
542 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
553 CONST NUMBERFMTA
* lpFormat
,
558 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
567 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
568 return 437; /* FIXME: call csrss.exe */
582 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
597 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
611 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
626 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
633 GetSystemDefaultLCID (VOID
)
636 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
646 GetSystemDefaultLangID (VOID
)
649 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
659 GetSystemPowerStatus (
660 LPSYSTEM_POWER_STATUS lpSystemPowerStatus
663 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
670 GetThreadLocale (VOID
)
673 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
683 GetThreadSelectorEntry (
686 LPLDT_ENTRY lpSelectorEntry
689 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
699 CONST SYSTEMTIME
* lpTime
,
705 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
715 CONST SYSTEMTIME
* lpTime
,
721 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
728 GetUserDefaultLCID (VOID
)
731 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
741 GetUserDefaultLangID (VOID
)
744 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
754 GetVDMCurrentDirectories (
759 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
770 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
782 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
787 /**********************************************************************
792 * TRUE if CodePage is installed in the system.
812 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
824 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
840 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
856 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
865 LPVOID lpParameterBlock
868 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
873 /***********************************************************************
874 * MulDiv (KERNEL32.@)
876 * Result of multiplication and division
877 * -1: Overflow occurred or Divisor was 0
880 //FIXME! move to correct file
886 #if SIZEOF_LONG_LONG >= 8
889 if (!nDivisor
) return -1;
891 /* We want to deal with a positive divisor to simplify the logic. */
894 nMultiplicand
= - nMultiplicand
;
895 nDivisor
= -nDivisor
;
898 /* If the result is positive, we "add" to round. else, we subtract to round. */
899 if ( ( (nMultiplicand
< 0) && (nMultiplier
< 0) ) ||
900 ( (nMultiplicand
>= 0) && (nMultiplier
>= 0) ) )
901 ret
= (((long long)nMultiplicand
* nMultiplier
) + (nDivisor
/2)) / nDivisor
;
903 ret
= (((long long)nMultiplicand
* nMultiplier
) - (nDivisor
/2)) / nDivisor
;
905 if ((ret
> 2147483647) || (ret
< -2147483647)) return -1;
908 if (!nDivisor
) return -1;
910 /* We want to deal with a positive divisor to simplify the logic. */
913 nMultiplicand
= - nMultiplicand
;
914 nDivisor
= -nDivisor
;
917 /* If the result is positive, we "add" to round. else, we subtract to round. */
918 if ( ( (nMultiplicand
< 0) && (nMultiplier
< 0) ) ||
919 ( (nMultiplicand
>= 0) && (nMultiplier
>= 0) ) )
920 return ((nMultiplicand
* nMultiplier
) + (nDivisor
/2)) / nDivisor
;
922 return ((nMultiplicand
* nMultiplier
) - (nDivisor
/2)) / nDivisor
;
928 /**********************************************************************
930 * MultiByteToWideChar@24
934 * CP_ACP ANSI code page
935 * CP_MACCP Macintosh code page
936 * CP_OEMCP OEM code page
937 * (UINT) Any installed code page
942 * MB_ERR_INVALID_CHARS
949 * Size of MultiByteStr, or -1 if MultiByteStr is
956 * Size (in WCHAR unit) of WideCharStr, or 0
957 * if the caller just wants to know how large
958 * WideCharStr should be for a successful
962 * 0 on error; otherwise the number of WCHAR written
963 * in the WideCharStr buffer.
966 * A raw converter for now. It assumes lpMultiByteStr is
967 * NEVER multi-byte (that is each input character is
968 * 8-bit ASCII) and is ALWAYS NULL terminated.
969 * FIXME-FIXME-FIXME-FIXME
973 MultiByteToWideChar (
976 LPCSTR lpMultiByteStr
,
978 LPWSTR lpWideCharStr
,
982 int InStringLength
= 0;
983 BOOL InIsNullTerminated
= TRUE
;
989 * Check the parameters.
991 if ( /* --- CODE PAGE --- */
992 ( (CP_ACP
!= CodePage
)
993 && (CP_MACCP
!= CodePage
)
994 && (CP_OEMCP
!= CodePage
)
995 && (FALSE
== IsInstalledCP (CodePage
))
998 || (dwFlags
^ ( MB_PRECOMPOSED
1000 | MB_ERR_INVALID_CHARS
1004 /* --- INPUT BUFFER --- */
1005 || (NULL
== lpMultiByteStr
)
1008 SetLastError (ERROR_INVALID_PARAMETER
);
1012 * Compute the input buffer length.
1014 if (-1 == cchMultiByte
)
1016 InStringLength
= lstrlen (lpMultiByteStr
);
1020 InIsNullTerminated
= FALSE
;
1021 InStringLength
= cchMultiByte
;
1024 * Does caller query for output
1027 if (0 == cchWideChar
)
1029 SetLastError (ERROR_SUCCESS
);
1030 return InStringLength
;
1033 * Is space provided for the translated
1036 if (cchWideChar
< InStringLength
)
1038 SetLastError (ERROR_INSUFFICIENT_BUFFER
);
1042 * Raw 8- to 16-bit conversion.
1044 for ( cchConverted
= 0,
1045 r
= (PCHAR
) lpMultiByteStr
,
1046 w
= (PWCHAR
) lpWideCharStr
;
1048 ((*r
) && (cchConverted
< cchWideChar
));
1057 * Is the input string NULL terminated?
1059 if (TRUE
== InIsNullTerminated
)
1065 * Return how many characters we
1066 * wrote in the output buffer.
1068 SetLastError (ERROR_SUCCESS
);
1069 return cchConverted
;
1075 QueryPerformanceCounter (
1076 LARGE_INTEGER
* lpPerformanceCount
1079 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1086 QueryPerformanceFrequency (
1087 LARGE_INTEGER
* lpFrequency
1090 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1097 RegisterConsoleVDM (
1111 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1118 RegisterWowBaseHandlers (
1122 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1133 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1141 LPCSTR lpComputerName
1144 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1152 LPCWSTR lpComputerName
1155 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1168 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1181 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1189 SetSystemPowerState (
1194 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1205 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1212 SetVDMCurrentDirectories (
1217 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1228 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1235 VDMConsoleOperation (
1240 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1247 VDMOperationStarted (
1251 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1264 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1277 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1284 VirtualBufferExceptionHandler (
1290 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1295 /**********************************************************************
1297 * MultiByteToWideChar@32
1299 * Not yet implemented complete (without NLS so far)
1303 * CP_ACP ANSI code page
1304 * CP_MACCP Macintosh code page
1305 * CP_OEMCP OEM code page
1306 * CP_SYMBOL Symbol code page (42)
1307 * CP_THREAD_ACP Current thread's ANSI code page
1308 * CP_UTF7 Translate using UTF-7
1309 * CP_UTF8 Translate using UTF-8
1310 * (UINT) Any installed code page
1313 * WC_NO_BEST_FIT_CHARS
1314 * WC_COMPOSITECHECK Convert composite characters to precomposed characters.
1315 * WC_DISCARDNS Discard nonspacing characters during conversion.
1316 * WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior.
1317 * WC_DEFAULTCHAR Replace exceptions with the default character during conversion.
1320 * Points to the wide-character string to be converted.
1323 * Size (in WCHAR unit) of WideCharStr, or 0
1324 * if the caller just wants to know how large
1325 * WideCharStr should be for a successful
1328 * Points to the buffer to receive the translated string.
1330 * Specifies the size in bytes of the buffer pointed to by the
1331 * lpMultiByteStr parameter. If this value is zero, the function
1332 * returns the number of bytes required for the buffer.
1334 * Points to the character used if a wide character cannot be
1335 * represented in the specified code page. If this parameter is
1336 * NULL, a system default value is used.
1339 * Points to a flag that indicates whether a default character was used.
1340 * This parameter may be NULL.
1341 FIXME: allways set to FALSE.
1346 * 0 on error; otherwise the number of bytes written
1347 * in the lpMultiByteStr buffer. Or the number of
1348 * bytes needed for the lpMultiByteStr buffer if cchMultiByte is zero.
1351 * A raw converter for now. It just cuts off the upper 9 Bit.
1352 * So the MBCS-string does not contain any LeadCharacters
1353 * FIXME - FIXME - FIXME - FIXME
1358 WideCharToMultiByte (
1361 LPCWSTR lpWideCharStr
,
1363 LPSTR lpMultiByteStr
,
1365 LPCSTR lpDefaultChar
,
1366 LPBOOL lpUsedDefaultChar
1369 int wi
, di
; // wide counter, dbcs byte count
1371 // for now, make no difference but only convert cut the characters to 7Bit
1374 case CP_ACP
: //ANSI code page
1375 case CP_MACCP
: //Macintosh code page
1376 case CP_OEMCP
: //OEM code page
1377 case CP_SYMBOL
: //Symbol code page (42)
1378 case CP_THREAD_ACP
: //ACP Current thread's ANSI code page
1379 case CP_UTF7
: //Translate using UTF-7
1380 case CP_UTF8
: //Translate using UTF-8
1381 if( cchWideChar
== -1 ) // assume its a 0-terminated str
1382 { // and determine its length
1383 for( cchWideChar
=0; lpWideCharStr
[cchWideChar
]!=0; )
1387 // user wants to determine needed space
1388 if( cchMultiByte
== 0 )
1390 SetLastError(ERROR_SUCCESS
);
1391 return cchWideChar
; // FIXME: determine correct.
1393 // the lpWideCharStr is cchWideChar characters long.
1394 for( wi
=0, di
=0; wi
<cchWideChar
&& di
<cchMultiByte
; ++wi
)
1396 // Flag and a not displayable char FIXME
1397 /*if( (dwFlags&WC_NO_BEST_FIT_CHARS) && (lpWideCharStr[wi] >127) )
1400 *lpUsedDefaultChar = TRUE;
1404 // just cut off the upper 9 Bit, since vals>=128 mean LeadByte.
1405 lpMultiByteStr
[di
] = lpWideCharStr
[wi
] & 0x007F;
1408 // has MultiByte exceeded but Wide is still in the string?
1409 if( wi
< cchWideChar
&& di
>= cchMultiByte
)
1411 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
1414 // else return # of bytes wirtten to MBCSbuffer (di)
1415 SetLastError(ERROR_SUCCESS
);
1416 // FIXME: move that elsewhere
1417 if( lpUsedDefaultChar
!=NULL
) *lpUsedDefaultChar
=FALSE
;
1421 SetLastError(ERROR_INVALID_PARAMETER
);
1425 SetLastError(ERROR_INVALID_PARAMETER
);