From 9cfe2d5384212c3a058ec6955056e4013f56fdc9 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 1 Nov 1998 14:02:57 +0000 Subject: [PATCH] Added stubs for user32,advapi32 functions. --- dlls/shell32/shellord.c | 11 ++++- include/wintypes.h | 2 + misc/crtdll.c | 93 +++++++++++++++++++++++++++++++++++++++-- misc/printdrv.c | 9 ++++ relay32/advapi32.spec | 18 +++++--- relay32/crtdll.spec | 8 ++-- relay32/mpr.spec | 3 ++ relay32/shell32.spec | 5 ++- relay32/user32.spec | 6 +-- relay32/winspool.spec | 2 +- win32/advapi.c | 67 +++++++++++++++++++++++++++++ windows/message.c | 18 ++++++++ windows/user.c | 42 +++++++++++++++++-- 13 files changed, 260 insertions(+), 24 deletions(-) diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index 2955a7b418..8bb02e0664 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -1557,10 +1557,19 @@ HRESULT WINAPI SHFlushClipboard() * SheGetDirW [SHELL32.281] * */ -HRESULT WINAPI SheGetDirW(LPWSTR u, LPWSTR v) +HRESULT WINAPI SheGetDir32W(LPWSTR u, LPWSTR v) { FIXME(shell,"%s %s stub\n",debugstr_w(u),debugstr_w(v) ); return 0; } + +/************************************************************************* + * SheChangeDirW [SHELL32.274] + * + */ +HRESULT WINAPI SheChangeDir32W(LPWSTR u) +{ FIXME(shell,"(%s),stub\n",debugstr_w(u)); + return 0; +} /************************************************************************* * StrRChrW [SHELL32.320] * diff --git a/include/wintypes.h b/include/wintypes.h index 4488051e8d..be62f60aed 100644 --- a/include/wintypes.h +++ b/include/wintypes.h @@ -170,6 +170,8 @@ DECLARE_HANDLE(HTASK); DECLARE_HANDLE(HWAVE); DECLARE_HANDLE(HWAVEIN); DECLARE_HANDLE(HWAVEOUT); +DECLARE_HANDLE(HWINSTA); +DECLARE_HANDLE(HDESK); DECLARE_HANDLE(HWND); DECLARE_HANDLE(HKL); DECLARE_HANDLE(HIC); diff --git a/misc/crtdll.c b/misc/crtdll.c index d174e710de..0dda1c5071 100644 --- a/misc/crtdll.c +++ b/misc/crtdll.c @@ -3,7 +3,7 @@ * * Implements C run-time functionality as known from UNIX. * - * Copyright 1996 Marcus Meissner + * Copyright 1996,1998 Marcus Meissner * Copyright 1996 Jukka Iivonen * Copyright 1997 Uwe Bonnes */ @@ -18,6 +18,11 @@ Unresolved issues Uwe Bonnes 970904: for Win32, based on lcc, from Jacob Navia */ +/* NOTE: This file also implements the wcs* functions. They _ARE_ in + * the newer Linux libcs, but use 4 byte wide characters, so are unusable, + * since we need 2 byte wide characters. - Marcus Meissner, 981031 + */ + /* FIXME: all the file handling is hopelessly broken -- AJ */ #include @@ -1720,6 +1725,40 @@ CHAR* __cdecl CRTDLL__getcwd(LPSTR buf, INT32 size) } +/********************************************************************* + * _getdcwd (CRTDLL.121) + */ +CHAR* __cdecl CRTDLL__getdcwd(INT32 drive,LPSTR buf, INT32 size) +{ + char test[1]; + int len; + + FIXME(crtdll,"(\"%c:\",%s,%d)\n",drive+'A',buf,size); + len = size; + if (!buf) { + if (size < 0) /* allocate as big as nescessary */ + len =GetCurrentDirectory32A(1,test) + 1; + if(!(buf = CRTDLL_malloc(len))) + { + /* set error to OutOfRange */ + return( NULL ); + } + } + size = len; + if(!(len =GetCurrentDirectory32A(len,buf))) + { + return NULL; + } + if (len > size) + { + /* set error to ERANGE */ + TRACE(crtdll,"buffer to small\n"); + return NULL; + } + return buf; + +} + /********************************************************************* * _getdrive (CRTDLL.124) * @@ -1740,6 +1779,16 @@ INT32 __cdecl CRTDLL__mkdir(LPCSTR newdir) return 0; } +/********************************************************************* + * remove (CRTDLL.448) + */ +INT32 __cdecl CRTDLL_remove(LPCSTR file) +{ + if (!DeleteFile32A(file)) + return -1; + return 0; +} + /********************************************************************* * _errno (CRTDLL.52) * Yes, this is a function. @@ -1933,5 +1982,43 @@ INT32 __cdecl CRTDLL__memicmp( * __dllonexit (CRTDLL.25) */ VOID __cdecl CRTDLL__dllonexit () -{ FIXME(crtdll,"stub\n"); - } +{ + FIXME(crtdll,"stub\n"); +} + +/********************************************************************* + * wcstok (CRTDLL.519) + * Like strtok, but for wide character strings. s is modified, yes. + */ +LPWSTR CRTDLL_wcstok(LPWSTR s,LPCWSTR delim) { + static LPWSTR nexttok = NULL; + LPWSTR x,ret; + + if (!s) + s = nexttok; + if (!s) + return NULL; + x = s; + while (*x && !CRTDLL_wcschr(delim,*x)) + x++; + ret = nexttok; + if (*x) { + *x='\0'; + nexttok = x+1; + } else + nexttok = NULL; + return ret; +} + +/********************************************************************* + * wcstol (CRTDLL.520) + * Like strtol, but for wide character strings. + */ +INT32 CRTDLL_wcstol(LPWSTR s,LPWSTR *end,INT32 base) { + LPSTR sA = HEAP_strdupWtoA(GetProcessHeap(),0,s),endA; + INT32 ret = strtol(sA,&endA,base); + + HeapFree(GetProcessHeap(),0,sA); + if (end) *end = s+(endA-sA); /* pointer magic checked. */ + return ret; +} diff --git a/misc/printdrv.c b/misc/printdrv.c index c5fa5c683e..9da69f110b 100644 --- a/misc/printdrv.c +++ b/misc/printdrv.c @@ -243,6 +243,15 @@ BOOL32 WINAPI OpenPrinter32A(LPSTR lpPrinterName,HANDLE32 *phPrinter, return FALSE; } +BOOL32 WINAPI OpenPrinter32W(LPWSTR lpPrinterName,HANDLE32 *phPrinter, + LPPRINTER_DEFAULTS32W pDefault) +{ + FIXME(print,"(%s,%p,%p):stub\n",debugstr_w(lpPrinterName), phPrinter, + pDefault); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + BOOL32 WINAPI EnumPrinters32A(DWORD dwType, LPSTR lpszName, DWORD dwLevel, LPBYTE lpbPrinters, DWORD cbBuf, LPDWORD lpdwNeeded, diff --git a/relay32/advapi32.spec b/relay32/advapi32.spec index ca2cf3cf9f..e9a9dedcd4 100644 --- a/relay32/advapi32.spec +++ b/relay32/advapi32.spec @@ -80,7 +80,7 @@ type win32 0076 stub InitiateSystemShutdownW 0077 stdcall IsTextUnicode(ptr long ptr) RtlIsTextUnicode 0078 stub IsValidAcl -0079 stub IsValidSecurityDescriptor +0079 stdcall IsValidSecurityDescriptor(ptr) IsValidSecurityDescriptor 0080 stdcall IsValidSid(ptr) IsValidSid 0081 stub LockServiceDatabase 0082 stub LogonUserA @@ -96,9 +96,9 @@ type win32 0092 stdcall LookupPrivilegeValueA(ptr ptr ptr) LookupPrivilegeValue32A 0093 stdcall LookupPrivilegeValueW(ptr ptr ptr) LookupPrivilegeValue32W 0094 stub MakeAbsoluteSD -0095 stub MakeSelfRelativeSD +0095 stdcall MakeSelfRelativeSD(ptr ptr ptr) MakeSelfRelativeSD 0096 stub MapGenericMask -0097 stub NotifyBootConfigStatus +0097 stdcall NotifyBootConfigStatus(long) NotifyBootConfigStatus 0098 stub NotifyChangeEventLog 0099 stub ObjectCloseAuditAlarmA 0100 stub ObjectCloseAuditAlarmW @@ -108,7 +108,7 @@ type win32 0104 stub ObjectPrivilegeAuditAlarmW 0105 stub OpenBackupEventLogA 0106 stub OpenBackupEventLogW -0107 stub OpenEventLogA +0107 stdcall OpenEventLogA(str str) OpenEventLog32A 0108 stub OpenEventLogW 0109 stdcall OpenProcessToken(long long ptr) OpenProcessToken 0110 stdcall OpenSCManagerA(ptr ptr long) OpenSCManager32A @@ -124,7 +124,7 @@ type win32 0120 stub QueryServiceLockStatusA 0121 stub QueryServiceLockStatusW 0122 stub QueryServiceObjectSecurity -0123 stub QueryServiceStatus +0123 stdcall QueryServiceStatus(long ptr) QueryServiceStatus 0124 stub ReadEventLogA 0125 stub ReadEventLogW 0126 stdcall RegCloseKey(long) RegCloseKey @@ -201,7 +201,7 @@ type win32 0197 stdcall StartServiceCtrlDispatcherW(ptr) StartServiceCtrlDispatcher32W 0198 stdcall StartServiceW(long long ptr) StartService32W 0199 stub UnlockServiceDatabase -0200 stub LsaOpenPolicy +0200 stdcall LsaOpenPolicy(long long long long) LsaOpenPolicy 0201 stub LsaLookupSids 0202 stub LsaFreeMemory 0203 stub LsaQueryInformationPolicy @@ -265,3 +265,9 @@ type win32 0261 stub ElfReportEventW 0262 stub ElfDeregisterEventSource 0263 stub ElfDeregisterEventSourceW +0264 stub I_ScSetServiceBit +0265 stdcall SynchronizeWindows31FilesAndWindowsNTRegistry(long long long long) SynchronizeWindows31FilesAndWindowsNTRegistry +0266 stdcall QueryWindows31FilesMigration(long) QueryWindows31FilesMigration +0267 stub LsaICLookupSids +0268 stub SystemFunction031 +0269 stub I_ScSetServiceBitsA diff --git a/relay32/crtdll.spec b/relay32/crtdll.spec index 99f967bb10..859ec7cead 100644 --- a/relay32/crtdll.spec +++ b/relay32/crtdll.spec @@ -122,7 +122,7 @@ type win32 118 stub _getch 119 stub _getche 120 cdecl _getcwd(ptr long) CRTDLL__getcwd -121 stub _getdcwd +121 cdecl _getdcwd(long ptr long) CRTDLL__getdcwd 122 stub _getdiskfree 123 stub _getdllprocaddr 124 cdecl _getdrive() CRTDLL__getdrive @@ -449,7 +449,7 @@ type win32 445 stub raise 446 cdecl rand() CRTDLL_rand 447 cdecl realloc(ptr long) CRTDLL_realloc -448 stub remove +448 cdecl remove(str) CRTDLL_remove 449 cdecl rename(str str) CRTDLL_rename 450 stub rewind 451 stub scanf @@ -520,8 +520,8 @@ type win32 516 cdecl wcsspn(wstr wstr) CRTDLL_wcsspn 517 cdecl wcsstr(wstr wstr) CRTDLL_wcsstr 518 stub wcstod -519 stub wcstok -520 stub wcstol +519 cdecl wcstok(wstr wstr) CRTDLL_wcstok +520 cdecl wcstol(wstr ptr long) CRTDLL_wcstol 521 cdecl wcstombs(ptr ptr long) CRTDLL_wcstombs 522 stub wcstoul 523 stub wcsxfrm diff --git a/relay32/mpr.spec b/relay32/mpr.spec index 51d20e82b3..eff7060a19 100644 --- a/relay32/mpr.spec +++ b/relay32/mpr.spec @@ -111,3 +111,6 @@ type win32 0106 stub WNetGetPropertyTextA 0107 stub WNetPropertyDialogA 0108 stub WNetGetDirectoryTypeA +0109 stub WNetFMXGetPermHelp +0110 stub WNetFMXEditPerm +0111 stub WNetFMXGetPermCaps diff --git a/relay32/shell32.spec b/relay32/shell32.spec index 5baea87107..5b815498be 100644 --- a/relay32/shell32.spec +++ b/relay32/shell32.spec @@ -280,14 +280,14 @@ init Shell32LibMain 271 stub SheChangeDirA 272 stub SheChangeDirExA 273 stub SheChangeDirExW - 274 stub SheChangeDirW + 274 stdcall SheChangeDirW(wstr) SheChangeDir32W 275 stub SheConvertPathW 276 stub SheFullPathA 277 stub SheFullPathW 278 stub SheGetCurDrive 279 stub SheGetDirA@8 280 stub SheGetDirExW@12 - 281 stdcall SheGetDirW (long long) SheGetDirW + 281 stdcall SheGetDirW (long long) SheGetDir32W 282 stub SheGetPathOffsetW 283 stub SheRemoveQuotesA 284 stub SheRemoveQuotesW @@ -376,3 +376,4 @@ init Shell32LibMain # later additions ... FIXME: incorrect ordinals 1218 stdcall SHGetSpecialFolderPathA(long long long long) SHGetSpecialFolderPath +1219 stub DoEnvironmentSubstW diff --git a/relay32/user32.spec b/relay32/user32.spec index 5d25bd4319..ebb8eeac3b 100644 --- a/relay32/user32.spec +++ b/relay32/user32.spec @@ -369,7 +369,7 @@ type win32 366 stdcall LoadImageW(long wstr long long long long) LoadImage32W 367 stub LoadKeyboardLayoutA 368 stub LoadKeyboardLayoutW -369 stub LoadLocalFonts +369 stdcall LoadLocalFonts() LoadLocalFonts 370 stdcall LoadMenuA(long str) LoadMenu32A 371 stdcall LoadMenuIndirectA(ptr) LoadMenuIndirect32A 372 stdcall LoadMenuIndirectW(ptr) LoadMenuIndirect32W @@ -423,7 +423,7 @@ type win32 420 stdcall PostMessageW(long long long long) PostMessage32W 421 stdcall PostQuitMessage(long) PostQuitMessage32 422 stdcall PostThreadMessageA(long long long long) PostThreadMessage32A -423 stub PostThreadMessageW +423 stdcall PostThreadMessageW(long long long long) PostThreadMessage32W 424 stdcall PtInRect(ptr long long) PtInRect32 425 stub QuerySendMessage 426 stdcall RedrawWindow(long ptr long long) RedrawWindow32 @@ -486,7 +486,7 @@ type win32 483 stdcall SetInternalWindowPos(long long ptr ptr) SetInternalWindowPos32 484 stdcall SetKeyboardState(ptr) SetKeyboardState 485 stdcall SetLastErrorEx(long long) SetLastErrorEx -486 stub SetLogonNotifyWindow +486 stdcall SetLogonNotifyWindow(long long) SetLogonNotifyWindow 487 stdcall SetMenu(long long) SetMenu32 488 stub SetMenuContextHelpId 489 stdcall SetMenuDefaultItem(long long long) SetMenuDefaultItem32 diff --git a/relay32/winspool.spec b/relay32/winspool.spec index b0f9f665fa..7de40087c4 100644 --- a/relay32/winspool.spec +++ b/relay32/winspool.spec @@ -97,7 +97,7 @@ type win32 194 stub GetPrinterW 195 stub InitializeDll 196 stdcall OpenPrinterA(str ptr ptr) OpenPrinter32A -197 stub OpenPrinterW +197 stdcall OpenPrinterW(wstr ptr ptr) OpenPrinter32W 198 stub PlayGdiScriptOnPrinterIC 199 stub PrinterMessageBoxA 200 stub PrinterMessageBoxW diff --git a/win32/advapi.c b/win32/advapi.c index 656a601f8f..49c93b7f70 100644 --- a/win32/advapi.c +++ b/win32/advapi.c @@ -428,3 +428,70 @@ HANDLE32 WINAPI RegisterEventSource32W( LPCWSTR lpUNCServerName, return 1; } +/****************************************************************************** + * QueryServiceStatus [ADVAPI32] + */ +BOOL32 WINAPI QueryServiceStatus(/*SC_HANDLE*/HANDLE32 hService,/*LPSERVICE_STATUS*/LPVOID lpservicestatus) { + FIXME(advapi,"(%d,%p),stub!\n",hService,lpservicestatus); + return TRUE; +} + +/****************************************************************************** + * IsValidSecurityDescriptor [ADVAPI32] + */ +BOOL32 WINAPI IsValidSecurityDescriptor(LPSECURITY_DESCRIPTOR lpsecdesc) { + FIXME(advapi,"(%p),stub!\n",lpsecdesc); + return TRUE; +} + +/****************************************************************************** + * MakeSelfRelativeSD [ADVAPI32] + */ +BOOL32 WINAPI MakeSelfRelativeSD( + LPSECURITY_DESCRIPTOR lpabssecdesc, + LPSECURITY_DESCRIPTOR lpselfsecdesc,LPDWORD lpbuflen +) { + FIXME(advapi,"(%p,%p,%p),stub!\n",lpabssecdesc,lpselfsecdesc,lpbuflen); + return TRUE; +} + +/****************************************************************************** + * QueryWindows31FilesMigration [ADVAPI32] + */ +BOOL32 WINAPI QueryWindows31FilesMigration(DWORD x1) { + FIXME(advapi,"(%ld),stub!\n",x1); + return TRUE; +} + +/****************************************************************************** + * SynchronizeWindows31FilesAndWindowsNTRegistry [ADVAPI32] + */ +BOOL32 WINAPI SynchronizeWindows31FilesAndWindowsNTRegistry(DWORD x1,DWORD x2,DWORD x3,DWORD x4) { + FIXME(advapi,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4); + return TRUE; +} + +/****************************************************************************** + * LsaOpenPolicy [ADVAPI32] + */ +BOOL32 WINAPI LsaOpenPolicy(DWORD x1,DWORD x2,DWORD x3,DWORD x4) { + FIXME(advapi,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4); + return 0xc0000000; /* generic error */ +} + +/****************************************************************************** + * NotifyBootConfigStatus [ADVAPI32] + */ +BOOL32 WINAPI NotifyBootConfigStatus(DWORD x1) { + FIXME(advapi,"(0x%08lx),stub!\n",x1); + return 1; +} + +/****************************************************************************** + * OpenEventLogA [ADVAPI32] + */ +HANDLE32 WINAPI OpenEventLog32A(LPCSTR uncname,LPCSTR source) { + FIXME(advapi,"(%s,%s),stub!\n",uncname,source); + return 0xcafe4242; +} + diff --git a/windows/message.c b/windows/message.c index 06c7819723..c42d49b0e0 100644 --- a/windows/message.c +++ b/windows/message.c @@ -1274,6 +1274,24 @@ BOOL32 WINAPI PostThreadMessage32A(DWORD idThread , UINT32 message, return PostAppMessage16(thdb->process->task, message, wParam, lParam); } +/********************************************************************** + * PostThreadMessage32W (USER32.423) + * + * BUGS + * + * Thread-local message queues are not supported. + * + */ +BOOL32 WINAPI PostThreadMessage32W(DWORD idThread , UINT32 message, + WPARAM32 wParam, LPARAM lParam ) +{ + THDB *thdb = THREAD_ID_TO_THDB(idThread); + if (!thdb || !thdb->process) return FALSE; + + FIXME(sendmsg, "(...): Should use thread-local message queue!\n"); + return PostAppMessage16(thdb->process->task, message, wParam, lParam); +} + /*********************************************************************** * SendMessage32A (USER32.454) */ diff --git a/windows/user.c b/windows/user.c index 75c2847a3e..a8563b955c 100644 --- a/windows/user.c +++ b/windows/user.c @@ -421,12 +421,18 @@ DWORD WINAPI UserSeeUserDo(WORD wReqType, WORD wParam1, WORD wParam2, WORD wPara } } +/*********************************************************************** + * RegisterLogonProcess (USER32.434) + */ DWORD WINAPI RegisterLogonProcess(HANDLE32 hprocess,BOOL32 x) { FIXME(win32,"(%d,%d),stub!\n",hprocess,x); return 1; } -HANDLE32 /* HWINSTA */ WINAPI CreateWindowStation32W( +/*********************************************************************** + * CreateWindowStation32W (USER32.86) + */ +HWINSTA32 WINAPI CreateWindowStation32W( LPWSTR winstation,DWORD res1,DWORD desiredaccess, LPSECURITY_ATTRIBUTES lpsa ) { @@ -436,11 +442,17 @@ HANDLE32 /* HWINSTA */ WINAPI CreateWindowStation32W( return 0xdeadcafe; } -BOOL32 WINAPI SetProcessWindowStation(/*HWINSTA*/ HANDLE32 hWinSta) { +/*********************************************************************** + * SetProcessWindowStation (USER32.496) + */ +BOOL32 WINAPI SetProcessWindowStation(HWINSTA32 hWinSta) { FIXME(win32,"(%d),stub!\n",hWinSta); return TRUE; } +/*********************************************************************** + * SetUserObjectSecurity (USER32.514) + */ BOOL32 WINAPI SetUserObjectSecurity( HANDLE32 hObj, /*LPSECURITY_INFORMATION*/LPVOID pSIRequested, @@ -450,7 +462,10 @@ BOOL32 WINAPI SetUserObjectSecurity( return TRUE; } -/*HDESK*/HANDLE32 WINAPI CreateDesktop32W( +/*********************************************************************** + * CreateDesktop32W (USER32.69) + */ +HDESK32 WINAPI CreateDesktop32W( LPWSTR lpszDesktop,LPWSTR lpszDevice,LPDEVMODE32W pDevmode, DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa ) { @@ -461,7 +476,26 @@ BOOL32 WINAPI SetUserObjectSecurity( return 0xcafedead; } +/*********************************************************************** + * SetWindowStationUser (USER32.521) + */ DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2) { - FIXME(win32,"(%d,%d),stub!\n",x1,x2); + FIXME(win32,"(%ld,%ld),stub!\n",x1,x2); return 1; } + +/*********************************************************************** + * SetLogonNotifyWindow (USER32.486) + */ +DWORD WINAPI SetLogonNotifyWindow(HWINSTA32 hwinsta,HWND32 hwnd) { + FIXME(win32,"(0x%lx,%ld),stub!\n",hwinsta,hwnd); + return 1; +} + +/*********************************************************************** + * LoadLocalFonts (USER32.486) + */ +VOID WINAPI LoadLocalFonts(VOID) { + /* are loaded. */ + return; +}