Skip to content
Snippets Groups Projects
Commit 04a8eda9 authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard
Browse files

Implemented old Win 2.x string functions.

parent cb4ff8c5
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment