Commit 44f84b55 authored by David Elliott's avatar David Elliott Committed by Alexandre Julliard

Added basic working stubs of new Windows 2000 API functions.

parent 16e92eb3
......@@ -191,6 +191,7 @@ import ntdll.dll
@ stdcall RegLoadKeyA(long str str) RegLoadKeyA
@ stdcall RegLoadKeyW(long wstr wstr) RegLoadKeyW
@ stdcall RegNotifyChangeKeyValue(long long long long long) RegNotifyChangeKeyValue
@ stdcall RegOpenCurrentUser(long ptr) RegOpenCurrentUser
@ stdcall RegOpenKeyA(long str ptr) RegOpenKeyA
@ stdcall RegOpenKeyExA(long str long long ptr) RegOpenKeyExA
@ stdcall RegOpenKeyExW(long wstr long long ptr) RegOpenKeyExW
......
......@@ -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]
......
......@@ -928,3 +928,10 @@ import ntdll.dll
#1599 wrong ordinal (249 in Win32s's W32SCOMB.DLL) !
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
......@@ -148,6 +148,20 @@ NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit )
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.@)
......
......@@ -411,6 +411,7 @@ type win32
@ stdcall RtlInitializeBitMap(long long long) RtlInitializeBitMap
@ stub RtlInitializeContext
@ stdcall RtlInitializeCriticalSection(ptr) RtlInitializeCriticalSection
@ stdcall RtlInitializeCriticalSectionAndSpinCount(ptr long) RtlInitializeCriticalSectionAndSpinCount
@ stdcall RtlInitializeGenericTable() RtlInitializeGenericTable
@ stub RtlInitializeRXact
@ stdcall RtlInitializeResource(ptr) RtlInitializeResource
......@@ -887,6 +888,7 @@ type win32
@ cdecl _strnicmp(str str long) strncasecmp
@ cdecl _strupr(str) _strupr
@ cdecl _ultoa(long ptr long) _ultoa
@ stub _ultow
@ cdecl _vsnprintf(ptr long ptr ptr) vsnprintf
@ cdecl _wcsicmp(wstr wstr) NTDLL__wcsicmp
@ cdecl _wcslwr(wstr) NTDLL__wcslwr
......@@ -936,6 +938,7 @@ type win32
@ cdecl strrchr(str long) strrchr
@ cdecl strspn(str str) strspn
@ cdecl strstr(str str) strstr
@ cdecl strtol(str ptr long) strtol
@ varargs swprintf(wstr wstr) wsprintfW
@ stub tan
@ cdecl tolower(long) tolower
......
......@@ -642,3 +642,7 @@ import ntdll.dll
@ stdcall RegisterDeviceNotificationA(long ptr long) RegisterDeviceNotificationA
@ stub RegisterDeviceNotificationW
@ stub UnregisterDeviceNotification
# win98/win2k
@ stdcall GetClipboardSequenceNumber () GetClipboardSequenceNumber
@ stdcall AllowSetForegroundWindow (long) AllowSetForegroundWindow
@ stdcall LockSetForegroundWindow (long) LockSetForegroundWindow
......@@ -283,6 +283,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)
*/
UINT16 WINAPI GetSystemDirectory16( LPSTR path, UINT16 count )
......
......@@ -897,6 +897,7 @@ NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
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 RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit );
NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit );
......
......@@ -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]
......
......@@ -28,6 +28,29 @@ void WINAPI InitializeCriticalSection( CRITICAL_SECTION *crit )
}
/***********************************************************************
* 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)
*/
void WINAPI MakeCriticalSectionGlobal( CRITICAL_SECTION *crit )
......
......@@ -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__
/* void WINAPI SetLastError( DWORD error ); */
......
......@@ -1297,3 +1297,19 @@ INT WINAPI GetPriorityClipboardFormat( UINT *lpPriorityList, INT nCount )
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;
}
......@@ -986,6 +986,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)
*/
HWND16 WINAPI GetShellWindow16(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment