Added basic working stubs of new Windows 2000 API functions.

This commit is contained in:
David Elliott 2000-10-29 01:24:54 +00:00 committed by Alexandre Julliard
parent 16e92eb3c3
commit 44f84b55f3
13 changed files with 149 additions and 0 deletions

View File

@ -191,6 +191,7 @@ import ntdll.dll
@ stdcall RegLoadKeyA(long str str) RegLoadKeyA @ stdcall RegLoadKeyA(long str str) RegLoadKeyA
@ stdcall RegLoadKeyW(long wstr wstr) RegLoadKeyW @ stdcall RegLoadKeyW(long wstr wstr) RegLoadKeyW
@ stdcall RegNotifyChangeKeyValue(long long long long long) RegNotifyChangeKeyValue @ stdcall RegNotifyChangeKeyValue(long long long long long) RegNotifyChangeKeyValue
@ stdcall RegOpenCurrentUser(long ptr) RegOpenCurrentUser
@ stdcall RegOpenKeyA(long str ptr) RegOpenKeyA @ stdcall RegOpenKeyA(long str ptr) RegOpenKeyA
@ stdcall RegOpenKeyExA(long str long long ptr) RegOpenKeyExA @ stdcall RegOpenKeyExA(long str long long ptr) RegOpenKeyExA
@ stdcall RegOpenKeyExW(long wstr long long ptr) RegOpenKeyExW @ stdcall RegOpenKeyExW(long wstr long long ptr) RegOpenKeyExW

View File

@ -248,6 +248,19 @@ DWORD WINAPI RegOpenKeyA( HKEY hkey, LPCSTR name, LPHKEY retkey )
} }
/******************************************************************************
* RegOpenCurrentUser [ADVAPI32]
* FIXME: This function is supposed to retrieve a handle to the
* HKEY_CURRENT_USER for the user the current thread is impersonating.
* Since Wine does not currently allow threads to impersonate other users,
* this stub should work fine.
*/
DWORD WINAPI RegOpenCurrentUser( REGSAM access, PHKEY retkey )
{
return RegOpenKeyExA( HKEY_CURRENT_USER, "", 0, access, retkey );
}
/****************************************************************************** /******************************************************************************
* RegEnumKeyExW [ADVAPI32.139] * RegEnumKeyExW [ADVAPI32.139]

View File

@ -928,3 +928,10 @@ import ntdll.dll
#1599 wrong ordinal (249 in Win32s's W32SCOMB.DLL) ! #1599 wrong ordinal (249 in Win32s's W32SCOMB.DLL) !
1599 stdcall Get16DLLAddress(long str) Get16DLLAddress 1599 stdcall Get16DLLAddress(long str) Get16DLLAddress
# Windows 2000, Terminal Server 4.0 SP4 functions
@ stdcall GetSystemWindowsDirectoryA(ptr long) GetSystemWindowsDirectoryA
@ stdcall GetSystemWindowsDirectoryW(ptr long) GetSystemWindowsDirectoryW
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) InitializeCriticalSectionAndSpinCount
@ stdcall SetCriticalSectionSpinCount(ptr long) SetCriticalSectionSpinCount
@ stdcall ProcessIdToSessionId(long ptr) ProcessIdToSessionId

View File

@ -148,6 +148,20 @@ NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit )
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
/***********************************************************************
* RtlInitializeCriticalSectionAndSpinCount (NTDLL.@)
* The InitializeCriticalSectionAndSpinCount (KERNEL32) function is
* available on NT4SP3 or later, and Win98 or later.
* I am assuming that this is the correct definition given the MSDN
* docs for the kernel32 functions.
*/
NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION *crit, DWORD spincount )
{
if(spincount) FIXME("critsection=%p: spincount=%ld not supported\n", crit, spincount);
crit->SpinCount = spincount;
return RtlInitializeCriticalSection( crit );
}
/*********************************************************************** /***********************************************************************
* RtlDeleteCriticalSection (NTDLL.@) * RtlDeleteCriticalSection (NTDLL.@)

View File

@ -411,6 +411,7 @@ type win32
@ stdcall RtlInitializeBitMap(long long long) RtlInitializeBitMap @ stdcall RtlInitializeBitMap(long long long) RtlInitializeBitMap
@ stub RtlInitializeContext @ stub RtlInitializeContext
@ stdcall RtlInitializeCriticalSection(ptr) RtlInitializeCriticalSection @ stdcall RtlInitializeCriticalSection(ptr) RtlInitializeCriticalSection
@ stdcall RtlInitializeCriticalSectionAndSpinCount(ptr long) RtlInitializeCriticalSectionAndSpinCount
@ stdcall RtlInitializeGenericTable() RtlInitializeGenericTable @ stdcall RtlInitializeGenericTable() RtlInitializeGenericTable
@ stub RtlInitializeRXact @ stub RtlInitializeRXact
@ stdcall RtlInitializeResource(ptr) RtlInitializeResource @ stdcall RtlInitializeResource(ptr) RtlInitializeResource
@ -887,6 +888,7 @@ type win32
@ cdecl _strnicmp(str str long) strncasecmp @ cdecl _strnicmp(str str long) strncasecmp
@ cdecl _strupr(str) _strupr @ cdecl _strupr(str) _strupr
@ cdecl _ultoa(long ptr long) _ultoa @ cdecl _ultoa(long ptr long) _ultoa
@ stub _ultow
@ cdecl _vsnprintf(ptr long ptr ptr) vsnprintf @ cdecl _vsnprintf(ptr long ptr ptr) vsnprintf
@ cdecl _wcsicmp(wstr wstr) NTDLL__wcsicmp @ cdecl _wcsicmp(wstr wstr) NTDLL__wcsicmp
@ cdecl _wcslwr(wstr) NTDLL__wcslwr @ cdecl _wcslwr(wstr) NTDLL__wcslwr
@ -936,6 +938,7 @@ type win32
@ cdecl strrchr(str long) strrchr @ cdecl strrchr(str long) strrchr
@ cdecl strspn(str str) strspn @ cdecl strspn(str str) strspn
@ cdecl strstr(str str) strstr @ cdecl strstr(str str) strstr
@ cdecl strtol(str ptr long) strtol
@ varargs swprintf(wstr wstr) wsprintfW @ varargs swprintf(wstr wstr) wsprintfW
@ stub tan @ stub tan
@ cdecl tolower(long) tolower @ cdecl tolower(long) tolower

View File

@ -642,3 +642,7 @@ import ntdll.dll
@ stdcall RegisterDeviceNotificationA(long ptr long) RegisterDeviceNotificationA @ stdcall RegisterDeviceNotificationA(long ptr long) RegisterDeviceNotificationA
@ stub RegisterDeviceNotificationW @ stub RegisterDeviceNotificationW
@ stub UnregisterDeviceNotification @ stub UnregisterDeviceNotification
# win98/win2k
@ stdcall GetClipboardSequenceNumber () GetClipboardSequenceNumber
@ stdcall AllowSetForegroundWindow (long) AllowSetForegroundWindow
@ stdcall LockSetForegroundWindow (long) LockSetForegroundWindow

View File

@ -282,6 +282,24 @@ UINT WINAPI GetWindowsDirectoryW( LPWSTR path, UINT count )
} }
/***********************************************************************
* GetSystemWindowsDirectoryA (KERNEL32) W2K, TS4.0SP4
*/
UINT WINAPI GetSystemWindowsDirectoryA( LPSTR path, UINT count )
{
return GetWindowsDirectoryA( path, count );
}
/***********************************************************************
* GetSystemWindowsDirectoryW (KERNEL32) W2K, TS4.0SP4
*/
UINT WINAPI GetSystemWindowsDirectoryW( LPWSTR path, UINT count )
{
return GetWindowsDirectoryW( path, count );
}
/*********************************************************************** /***********************************************************************
* GetSystemDirectory16 (KERNEL.135) * GetSystemDirectory16 (KERNEL.135)
*/ */

View File

@ -897,6 +897,7 @@ NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG); NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit ); NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit );
NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION *crit, DWORD spincount );
NTSTATUS WINAPI RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit ); NTSTATUS WINAPI RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit );
NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit ); NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit );
NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit ); NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit );

View File

@ -248,6 +248,19 @@ DWORD WINAPI RegOpenKeyA( HKEY hkey, LPCSTR name, LPHKEY retkey )
} }
/******************************************************************************
* RegOpenCurrentUser [ADVAPI32]
* FIXME: This function is supposed to retrieve a handle to the
* HKEY_CURRENT_USER for the user the current thread is impersonating.
* Since Wine does not currently allow threads to impersonate other users,
* this stub should work fine.
*/
DWORD WINAPI RegOpenCurrentUser( REGSAM access, PHKEY retkey )
{
return RegOpenKeyExA( HKEY_CURRENT_USER, "", 0, access, retkey );
}
/****************************************************************************** /******************************************************************************
* RegEnumKeyExW [ADVAPI32.139] * RegEnumKeyExW [ADVAPI32.139]

View File

@ -27,6 +27,29 @@ void WINAPI InitializeCriticalSection( CRITICAL_SECTION *crit )
if (ret) RtlRaiseStatus( ret ); if (ret) RtlRaiseStatus( ret );
} }
/***********************************************************************
* InitializeCriticalSectionAndSpinCount (KERNEL32)
*/
BOOL WINAPI InitializeCriticalSectionAndSpinCount( CRITICAL_SECTION *crit, DWORD spincount )
{
NTSTATUS ret = RtlInitializeCriticalSectionAndSpinCount( crit, spincount );
if (ret) RtlRaiseStatus( ret );
return !ret;
}
/***********************************************************************
* SetCriticalSectionSpinCount (KERNEL32)
* This function is available on NT4SP3 or later, but not Win98
* It is SMP related
*/
DWORD WINAPI SetCriticalSectionSpinCount( CRITICAL_SECTION *crit, DWORD spincount )
{
ULONG_PTR oldspincount = crit->SpinCount;
if(spincount) FIXME("critsection=%p: spincount=%ld not supported\n", crit, spincount);
crit->SpinCount = spincount;
return oldspincount;
}
/*********************************************************************** /***********************************************************************
* MakeCriticalSectionGlobal (KERNEL32.515) * MakeCriticalSectionGlobal (KERNEL32.515)
*/ */

View File

@ -844,6 +844,20 @@ HANDLE WINAPI GetCurrentThread(void)
} }
/***********************************************************************
* ProcessIdToSessionId (KERNEL32)
* This function is available on Terminal Server 4SP4 and Windows 2000
*/
BOOL WINAPI ProcessIdToSessionId( DWORD procid, DWORD *sessionid_ptr )
{
/* According to MSDN, if the calling process is not in a terminal
* services environment, then the sessionid returned is zero.
*/
*sessionid_ptr = 0;
return TRUE;
}
#ifdef __i386__ #ifdef __i386__
/* void WINAPI SetLastError( DWORD error ); */ /* void WINAPI SetLastError( DWORD error ); */

View File

@ -1297,3 +1297,19 @@ INT WINAPI GetPriorityClipboardFormat( UINT *lpPriorityList, INT nCount )
return -1; return -1;
} }
/**************************************************************************
* GetClipboardSequenceNumber (USER32)
* Supported on Win2k/Win98
* MSDN: Windows clipboard code keeps a serial number for the clipboard
* for each window station. The number is incremented whenever the
* contents change or are emptied.
* If you do not have WINSTA_ACCESSCLIPBOARD then the function returns 0
*/
DWORD WINAPI GetClipboardSequenceNumber(VOID)
{
FIXME("Returning 0, see windows/clipboard.c\n");
/* FIXME: Use serial numbers */
return 0;
}

View File

@ -985,6 +985,28 @@ BOOL WINAPI SetForegroundWindow( HWND hwnd )
} }
/*******************************************************************
* AllowSetForegroundWindow (USER32)
*/
BOOL WINAPI AllowSetForegroundWindow( DWORD procid )
{
/* FIXME: If Win98/2000 style SetForegroundWindow behavior is
* implemented, then fix this function. */
return TRUE;
}
/*******************************************************************
* LockSetForegroundWindow (USER32)
*/
BOOL WINAPI LockSetForegroundWindow( UINT lockcode )
{
/* FIXME: If Win98/2000 style SetForegroundWindow behavior is
* implemented, then fix this function. */
return TRUE;
}
/******************************************************************* /*******************************************************************
* GetShellWindow16 (USER.600) * GetShellWindow16 (USER.600)
*/ */