mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
Implemented old Win 2.x string functions.
This commit is contained in:
parent
cb4ff8c51e
commit
04a8eda985
@ -83,10 +83,10 @@ owner kernel32
|
||||
75 stub OpenPathName
|
||||
76 stub DeletePathName
|
||||
# Reserved*: old Win 2.x functions now moved to USER (Win 3.0+)
|
||||
77 stub Reserved1 #AnsiNext16
|
||||
78 stub Reserved2 #AnsiPrev16
|
||||
79 stub Reserved3 #AnsiUpper16
|
||||
80 stub Reserved4 #AnsiLower16
|
||||
77 pascal Reserved1(segptr) KERNEL_AnsiNext16
|
||||
78 pascal Reserved2(segptr segptr) KERNEL_AnsiPrev16
|
||||
79 pascal Reserved3(segstr) KERNEL_AnsiUpper16
|
||||
80 pascal Reserved4(segstr) KERNEL_AnsiLower16
|
||||
81 pascal16 _lclose(word) _lclose16
|
||||
82 pascal16 _lread(word segptr word) WIN16_lread
|
||||
83 pascal16 _lcreat(str word) _lcreat16
|
||||
|
@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "winbase.h"
|
||||
#include "wine/winbase16.h"
|
||||
@ -111,3 +112,50 @@ BOOL WINAPI MAIN_KernelInit( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
* Entry point for kernel functions that do nothing.
|
||||
*/
|
||||
LONG WINAPI KERNEL_nop(void) { return 0; }
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* Win 2.x string functions now moved to USER
|
||||
*
|
||||
* We rather want to implement them here instead of doing Callouts
|
||||
*/
|
||||
SEGPTR WINAPI KERNEL_AnsiNext16(SEGPTR current)
|
||||
{
|
||||
return (*(char *)PTR_SEG_TO_LIN(current)) ? current + 1 : current;
|
||||
}
|
||||
|
||||
SEGPTR WINAPI KERNEL_AnsiPrev16( SEGPTR start, SEGPTR current )
|
||||
{
|
||||
return (current==start)?start:current-1;
|
||||
}
|
||||
|
||||
SEGPTR WINAPI KERNEL_AnsiUpper16( SEGPTR strOrChar )
|
||||
{
|
||||
/* uppercase only one char if strOrChar < 0x10000 */
|
||||
if (HIWORD(strOrChar))
|
||||
{
|
||||
char *s = PTR_SEG_TO_LIN(strOrChar);
|
||||
while (*s) {
|
||||
*s = toupper(*s);
|
||||
s++;
|
||||
}
|
||||
return strOrChar;
|
||||
}
|
||||
else return toupper((char)strOrChar);
|
||||
}
|
||||
|
||||
SEGPTR WINAPI KERNEL_AnsiLower16( SEGPTR strOrChar )
|
||||
{
|
||||
/* lowercase only one char if strOrChar < 0x10000 */
|
||||
if (HIWORD(strOrChar))
|
||||
{
|
||||
char *s = PTR_SEG_TO_LIN(strOrChar);
|
||||
while (*s) {
|
||||
*s = tolower(*s);
|
||||
s++;
|
||||
}
|
||||
return strOrChar;
|
||||
}
|
||||
else return tolower((char)strOrChar);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user