sync trunk HEAD (r50626)

svn path=/branches/cmake-bringup/; revision=50635
This commit is contained in:
Timo Kreuzer 2011-02-09 15:56:57 +00:00
commit 89fbead325
32 changed files with 1401 additions and 138 deletions

View file

@ -54,9 +54,9 @@ if(NOT CMAKE_CROSSCOMPILING)
add_subdirectory(lib)
if(NOT MSVC)
export(TARGETS widl nci gendib cabman cdmake mkhive spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
export(TARGETS widl gendib cabman cdmake mkhive spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
else()
export(TARGETS nci gendib cabman cdmake mkhive spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
export(TARGETS gendib cabman cdmake mkhive spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
endif()
else()
@ -185,40 +185,6 @@ else()
add_subdirectory(ntoskrnl)
add_subdirectory(subsystems)
# nci generated intermediate files
list(APPEND nci_output
${REACTOS_BINARY_DIR}/ntoskrnl/include/internal/napi.h
${REACTOS_BINARY_DIR}/subsystems/win32/win32k/include/napi.h
${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S
${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S
${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)
list(APPEND nci_folders
${CMAKE_CURRENT_BINARY_DIR}/dll/ntdll/def
${CMAKE_CURRENT_BINARY_DIR}/lib/ntdllsys/ntdll
${CMAKE_CURRENT_BINARY_DIR}/lib/win32ksys
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl/include/internal
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl/ex
${CMAKE_CURRENT_BINARY_DIR}/subsystems/win32/win32k/include)
file(MAKE_DIRECTORY ${nci_folders})
add_custom_command(
OUTPUT ${nci_output}
COMMAND native-nci -arch ${ARCH} ${REACTOS_SOURCE_DIR}/ntoskrnl/sysfuncs.lst ${REACTOS_SOURCE_DIR}/subsystems/win32/win32k/w32ksvc.db ${nci_output}
DEPENDS native-nci ${nci_folders})
set_source_files_properties(${nci_output} PROPERTIES GENERATED TRUE)
add_custom_target(ntdll_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S)
add_custom_target(win32k_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S)
add_custom_target(ntsys_pspec ALL DEPENDS ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)
add_custom_target(kernel_napi ALL DEPENDS ${REACTOS_BINARY_DIR}/ntoskrnl/include/internal/napi.h)
add_custom_target(subsystem_napi ALL DEPENDS ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/include/napi.h)
add_custom_target(kernel_zw ALL DEPENDS ${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S)
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/include/reactos)
add_custom_target(buildno_header ALL DEPENDS ${REACTOS_BINARY_DIR}/include/reactos/buildno.h)

View file

@ -890,7 +890,7 @@ CabinetExtractFile(PCAB_SEARCH Search)
RtlInitAnsiString(&AnsiString, Search->File->FileName);
wcscpy(DestName, DestPath);
UnicodeString.MaximumLength = sizeof(DestName) - wcslen(DestName);
UnicodeString.MaximumLength = sizeof(DestName) - wcslen(DestName) * sizeof(WCHAR);
UnicodeString.Buffer = DestName + wcslen(DestName);
UnicodeString.Length = 0;
RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, FALSE);

View file

@ -97,7 +97,7 @@ HKCU,"Control Panel\Desktop","ScreenSaverIsSecure",2,"1"
HKCU,"Control Panel\Desktop","ScreenSaveTimeOut",0,"600"
HKCU,"Control Panel\Desktop","WaitToKillAppTimeout",2,"20000"
HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,""
HKCU,"Control Panel\Desktop","FontSmoothing",2,"0"
HKCU,"Control Panel\Desktop","FontSmoothing",0,"0"
HKCU,"Control Panel\Desktop","FontSmoothingOrientation",0x00010003,0x00000001
HKCU,"Control Panel\Desktop","FontSmoothingType",0x00010003,0x00000001
HKCU,"Control Panel\Desktop","ForegroundFlashCount",0x00010003,0x00000003

View file

@ -28,7 +28,7 @@ HKCU,"Control Panel\Desktop","HungAppTimeout",0x00000002,"5000"
HKCU,"Control Panel\Desktop","SCRNSAVE.EXE",0x00000000,""
HKCU,"Control Panel\Desktop","WaitToKillAppTimeout",0x00000002,"20000"
HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,""
HKCU,"Control Panel\Desktop","FontSmoothing",2,"0"
HKCU,"Control Panel\Desktop","FontSmoothing",0,"0"
HKCU,"Control Panel\Desktop","SmoothScroll",3,00,00,00,00
HKCU,"Control Panel\Desktop","UserPreferencesMask",3,10,00,00,80
HKCU,"Control Panel\Desktop","LowPowerActive",,"0"

Binary file not shown.

View file

@ -1,6 +1,7 @@
/*
* FreeLoader NTFS support
* Copyright (C) 2004 Filip Navara <xnavara@volny.cz>
* Copyright (C) 2011 Pierre Schweitzer <pierre.schweitzer@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -30,16 +31,22 @@
#define NTFS_FILE_BADCLUS 8
#define NTFS_FILE_QUOTA 9
#define NTFS_FILE_UPCASE 10
#define NTFS_FILE_EXTEND 11
#define NTFS_ATTR_TYPE_STANDARD_INFORMATION 0x10
#define NTFS_ATTR_TYPE_ATTRIBUTE_LIST 0x20
#define NTFS_ATTR_TYPE_FILENAME 0x30
#define NTFS_ATTR_TYPE_OBJECT_ID 0x40
#define NTFS_ATTR_TYPE_SECURITY_DESCRIPTOR 0x50
#define NTFS_ATTR_TYPE_VOLUME_NAME 0x60
#define NTFS_ATTR_TYPE_VOLUME_INFORMATION 0x70
#define NTFS_ATTR_TYPE_DATA 0x80
#define NTFS_ATTR_TYPE_INDEX_ROOT 0x90
#define NTFS_ATTR_TYPE_INDEX_ALLOCATION 0xa0
#define NTFS_ATTR_TYPE_BITMAP 0xb0
#define NTFS_ATTR_TYPE_SYMLINK 0xc0
#define NTFS_ATTR_TYPE_REPARSE_POINT 0xc0
#define NTFS_ATTR_TYPE_EA_INFORMATION 0xd0
#define NTFS_ATTR_TYPE_EA 0xe0
#define NTFS_ATTR_TYPE_END 0xffffffff
#define NTFS_ATTR_NORMAL 0
@ -126,7 +133,8 @@ typedef struct
{
ULONG ValueLength;
USHORT ValueOffset;
USHORT Flags;
UCHAR Flags;
UCHAR Reserved;
} Resident;
// Non-resident attributes
struct
@ -134,8 +142,8 @@ typedef struct
ULONGLONG LowestVCN;
ULONGLONG HighestVCN;
USHORT MappingPairsOffset;
UCHAR CompressionUnit;
UCHAR Reserved[5];
USHORT CompressionUnit;
UCHAR Reserved[4];
LONGLONG AllocatedSize;
LONGLONG DataSize;
LONGLONG InitializedSize;
@ -180,7 +188,20 @@ typedef struct
WCHAR FileName[0];
} NTFS_FILE_NAME_ATTR, *PNTFS_FILE_NAME_ATTR;
typedef struct {
typedef struct
{
ULONG Type;
USHORT RecLength;
UCHAR NameLength;
UCHAR NameOffset;
ULONGLONG StartingVCN;
ULONGLONG BaseFileRef;
USHORT AttrId;
PWCHAR Name;
} NTFS_ATTR_LIST_ATTR, *PNTFS_ATTR_LIST_ATTR;
typedef struct
{
union
{
struct

View file

@ -2918,6 +2918,61 @@ CONFIGRET WINAPI CM_Is_Dock_Station_Present_Ex(
}
/***********************************************************************
* CM_Is_Version_Available_Ex [SETUPAPI.@]
*/
BOOL WINAPI CM_Is_Version_Available(
WORD wVersion)
{
TRACE("%hu\n", wVersion);
return CM_Is_Version_Available_Ex(wVersion, NULL);
}
/***********************************************************************
* CM_Is_Version_Available_Ex [SETUPAPI.@]
*/
BOOL WINAPI CM_Is_Version_Available_Ex(
WORD wVersion, HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
WORD wServerVersion;
CONFIGRET ret;
TRACE("%hu %lx\n", wVersion, hMachine);
if (wVersion <= 0x400)
return TRUE;
if (hMachine != NULL)
{
BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
if (BindingHandle == NULL)
return FALSE;
}
else
{
if (!PnpGetLocalHandles(&BindingHandle, NULL))
return FALSE;
}
RpcTryExcept
{
ret = PNP_GetVersion(BindingHandle, &wServerVersion);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
ret = RpcStatusToCmStatus(RpcExceptionCode());
}
RpcEndExcept;
if (ret != CR_SUCCESS)
return FALSE;
return (wServerVersion >= wVersion);
}
/***********************************************************************
* CM_Locate_DevNodeA [SETUPAPI.@]
*/

View file

@ -137,8 +137,8 @@
@ stub CM_Invert_Range_List
@ stdcall CM_Is_Dock_Station_Present(ptr)
@ stdcall CM_Is_Dock_Station_Present_Ex(ptr long)
@ stub CM_Is_Version_Available
@ stub CM_Is_Version_Available_Ex
@ stdcall CM_Is_Version_Available(long)
@ stdcall CM_Is_Version_Available_Ex(long long)
@ stdcall CM_Locate_DevNodeA(ptr str long)
@ stdcall CM_Locate_DevNodeW(ptr wstr long)
@ stdcall CM_Locate_DevNode_ExA(ptr str long long)

View file

@ -477,15 +477,21 @@ EnableUserModePnpManager(VOID)
SC_HANDLE hService = NULL;
BOOL ret = FALSE;
hSCManager = OpenSCManager(NULL, NULL, 0);
hSCManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE);
if (hSCManager == NULL)
{
DPRINT1("Unable to open the service control manager.\n");
goto cleanup;
}
hService = OpenServiceW(hSCManager,
L"PlugPlay",
SERVICE_CHANGE_CONFIG | SERVICE_START);
if (hService == NULL)
{
DPRINT1("Unable to open PlugPlay service\n");
goto cleanup;
}
ret = ChangeServiceConfigW(hService,
SERVICE_NO_CHANGE,
@ -494,11 +500,17 @@ EnableUserModePnpManager(VOID)
NULL, NULL, NULL,
NULL, NULL, NULL, NULL);
if (!ret)
{
DPRINT1("Unable to change the service configuration\n");
goto cleanup;
}
ret = StartServiceW(hService, 0, NULL);
if (!ret)
{
DPRINT("Unable to start service\n");
goto cleanup;
}
ret = TRUE;

View file

@ -544,6 +544,25 @@ WdmAudSetWaveDeviceFormatByLegacy(
return MMSYSERR_NOERROR;
}
VOID
CALLBACK
LegacyCompletionRoutine(
IN DWORD dwErrorCode,
IN DWORD dwNumberOfBytesTransferred,
IN LPOVERLAPPED lpOverlapped)
{
PSOUND_OVERLAPPED Overlap;
PWDMAUD_DEVICE_INFO DeviceInfo;
Overlap = (PSOUND_OVERLAPPED)lpOverlapped;
DeviceInfo = (PWDMAUD_DEVICE_INFO)Overlap->CompletionContext;
/* Call mmebuddy overlap routine */
Overlap->OriginalCompletionRoutine(dwErrorCode, DeviceInfo->Header.DataUsed, lpOverlapped);
HeapFree(GetProcessHeap(), 0, DeviceInfo);
}
MMRESULT
WdmAudCommitWaveBufferByLegacy(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
@ -554,7 +573,7 @@ WdmAudCommitWaveBufferByLegacy(
{
HANDLE Handle;
MMRESULT Result;
WDMAUD_DEVICE_INFO DeviceInfo;
PWDMAUD_DEVICE_INFO DeviceInfo;
PSOUND_DEVICE SoundDevice;
MMDEVICE_TYPE DeviceType;
BOOL Ret;
@ -577,37 +596,53 @@ WdmAudCommitWaveBufferByLegacy(
Result = GetSoundDeviceType(SoundDevice, &DeviceType);
SND_ASSERT( Result == MMSYSERR_NOERROR );
ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO));
DeviceInfo.Header.FrameExtent = Length;
if (DeviceType == WAVE_OUT_DEVICE_TYPE)
DeviceInfo = (PWDMAUD_DEVICE_INFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WDMAUD_DEVICE_INFO));
if (!DeviceInfo)
{
DeviceInfo.Header.DataUsed = Length;
// no memory
return MMSYSERR_NOMEM;
}
DeviceInfo.Header.Data = OffsetPtr;
DeviceInfo.Header.Size = sizeof(WDMAUD_DEVICE_INFO);
DeviceInfo.Header.PresentationTime.Numerator = 1;
DeviceInfo.Header.PresentationTime.Denominator = 1;
DeviceInfo.hDevice = Handle;
DeviceInfo.DeviceType = DeviceType;
DeviceInfo->Header.FrameExtent = Length;
if (DeviceType == WAVE_OUT_DEVICE_TYPE)
{
DeviceInfo->Header.DataUsed = Length;
}
DeviceInfo->Header.Data = OffsetPtr;
DeviceInfo->Header.Size = sizeof(WDMAUD_DEVICE_INFO);
DeviceInfo->Header.PresentationTime.Numerator = 1;
DeviceInfo->Header.PresentationTime.Denominator = 1;
DeviceInfo->hDevice = Handle;
DeviceInfo->DeviceType = DeviceType;
// create completion event
Overlap->Standard.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
if (Overlap->Standard.hEvent == NULL)
{
// no memory
return MMSYSERR_NOMEM;
}
Overlap->OriginalCompletionRoutine = CompletionRoutine;
Overlap->CompletionContext = (PVOID)DeviceInfo;
if (DeviceType == WAVE_OUT_DEVICE_TYPE)
{
Ret = WriteFileEx(KernelHandle, &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPOVERLAPPED)Overlap, CompletionRoutine);
Ret = WriteFileEx(KernelHandle, DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPOVERLAPPED)Overlap, LegacyCompletionRoutine);
if (Ret)
WaitForSingleObjectEx (KernelHandle, INFINITE, TRUE);
}
else if (DeviceType == WAVE_IN_DEVICE_TYPE)
{
Ret = ReadFileEx(KernelHandle, &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPOVERLAPPED)Overlap, CompletionRoutine);
//if (Ret)
// WaitForSingleObjectEx (KernelHandle, INFINITE, TRUE);
Ret = ReadFileEx(KernelHandle, DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPOVERLAPPED)Overlap, LegacyCompletionRoutine);
if (Ret)
WaitForSingleObjectEx (KernelHandle, INFINITE, TRUE);
}
// close event handle
CloseHandle(Overlap->Standard.hEvent);
return MMSYSERR_NOERROR;
}

View file

@ -421,7 +421,7 @@ MixerCompletionRoutine(
PSOUND_OVERLAPPED Overlap = (PSOUND_OVERLAPPED)lpOverlapped;
/* Call mmebuddy overlap routine */
Overlap->OriginalCompletionRoutine(dwErrorCode, Overlap->OriginalBufferSize, lpOverlapped);
Overlap->OriginalCompletionRoutine(dwErrorCode, PtrToUlong(Overlap->CompletionContext), lpOverlapped);
}
MMRESULT
@ -527,7 +527,7 @@ WriteFileEx_Remixer(
DeviceInfo.Header.PresentationTime.Numerator = 1;
DeviceInfo.Header.PresentationTime.Denominator = 1;
Overlap->OriginalBufferSize = Length;
Overlap->CompletionContext = UlongToPtr(Length);
Overlap->OriginalCompletionRoutine = CompletionRoutine;
Overlap->Standard.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);

94
include/asm/syscalls.inc Normal file
View file

@ -0,0 +1,94 @@
#ifdef _M_IX86
#define KUSER_SHARED_SYSCALL HEX(7ffe0300)
#define KGDT_R0_CODE 8
MACRO(STUBCODE_U, SyscallId, StackBytes)
mov eax, SyscallId
mov ecx, KUSER_SHARED_SYSCALL
call dword ptr [ecx]
ret StackBytes
ENDM
MACRO(STUBCODE_K, SyscallId, StackBytes)
mov eax, SyscallId
lea edx, [esp + 4]
pushf
push KGDT_R0_CODE
call _KiSystemService
ret StackBytes
ENDM
#elif defined(_M_AMD64)
MACRO(STUBCODE_U, SyscallId, StackBytes)
mov eax, SyscallId
mov r10, rcx
syscall
ret StackBytes
ENDM
MACRO(STUBCODE_K, SyscallId, StackBytes)
mov eax, SyscallId
call KiSystemService
ret StackBytes
ENDM
#elif defined(_M_ARM)
MACRO(STUBCODE_U, SyscallId, StackBytes)
swi #SyscallId
bx lr
ENDM
MACRO(STUBCODE_K, SyscallId, StackBytes)
mov ip, lr
swi #SyscallId
bx ip
ENDM
#elif defined(_M_PPC)
MACRO(STUBCODE_U, SyscallId, StackBytes)
stwu 1,-16(1)
mflr 0
stw 0,0(1)
li 0, SyscallId
sc
lwz 0,0(1)
mtlr 0
addi 1,1,16
blr
ENDM
#define STUBCODE_K STUBCODE_U
#elif defined(_M_MIPS)
MACRO(STUBCODE_U, SyscallId, StackBytes)
li $8, KUSER_SHARED_SYSCALL
lw $8,0($8)
j $8
nop
ENDM
MACRO(STUBCODE_K, SyscallId, StackBytes)
j KiSystemService
nop
ENDM
#else
#error unsupported architecture
#endif
#ifdef _M_IX86
MACRO(MAKE_LABEL, Name, Stackbytes)
PUBLIC _&Name&@&Stackbytes
_&Name&@&Stackbytes:
ENDM
#else
MACRO(MAKE_LABEL, Name, Stackbytes)
PUBLIC &Name
&Name:
ENDM
#endif
MACRO(STUB_U, Name, ArgCount)
Stackbytes = 4 * &ArgCount
MAKE_LABEL Zw&Name, %Stackbytes
MAKE_LABEL Nt&Name, %Stackbytes
STUBCODE_U SyscallId, %Stackbytes
SyscallId = SyscallId + 1
ENDM
MACRO(STUB_K, Name, ArgCount)
Stackbytes = 4 * &ArgCount
MAKE_LABEL Zw&Name, %Stackbytes
STUBCODE_K SyscallId, %Stackbytes
SyscallId = SyscallId + 1
ENDM

View file

@ -185,8 +185,8 @@ typedef struct _SOUND_OVERLAPPED
PWAVEHDR Header;
BOOL PerformCompletion;
DWORD OriginalBufferSize;
LPOVERLAPPED_COMPLETION_ROUTINE OriginalCompletionRoutine;
PVOID CompletionContext;
} SOUND_OVERLAPPED, *PSOUND_OVERLAPPED;

View file

@ -14,7 +14,6 @@ add_subdirectory(epsapi)
add_subdirectory(fslib)
add_subdirectory(lsalib)
#add_subdirectory(nls)
add_subdirectory(ntdllsys)
add_subdirectory(ppcmmu)
add_subdirectory(pseh)
add_subdirectory(recyclebin)
@ -23,7 +22,6 @@ add_subdirectory(rtl)
add_subdirectory(sdk)
add_subdirectory(smlib)
add_subdirectory(tdilib)
add_subdirectory(win32ksys)
else()

View file

@ -1,5 +0,0 @@
set_source_files_properties(${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S PROPERTIES GENERATED TRUE)
add_library(ntdllsys STATIC ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S)
add_dependencies(ntdllsys ntdll_S asm)
set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE C)

View file

@ -235,12 +235,6 @@ RtlpInsertFreeBlockHelper(PHEAP Heap,
FreeEntry->Flags &= HEAP_ENTRY_LAST_ENTRY;
}
/* Check if PreviousSize of the next entry matches ours */
if (!(FreeEntry->Flags & HEAP_ENTRY_LAST_ENTRY))
{
ASSERT(((PHEAP_ENTRY)FreeEntry + BlockSize)->PreviousSize == BlockSize);
}
/* Insert it either into dedicated or non-dedicated list */
if (BlockSize < HEAP_FREELISTS)
{

View file

@ -235,6 +235,8 @@ RtlMultiByteToUnicodeN(
ULONG Size = 0;
ULONG i;
PAGED_CODE_RTL();
if (NlsMbCodePageTag == FALSE)
{
/* single-byte code page */
@ -300,6 +302,8 @@ RtlMultiByteToUnicodeSize(PULONG UnicodeSize,
{
ULONG Length = 0;
PAGED_CODE_RTL();
if (!NlsMbCodePageTag)
{
/* single-byte code page */
@ -504,6 +508,8 @@ RtlUnicodeToMultiByteN (PCHAR MbString,
ULONG Size = 0;
ULONG i;
PAGED_CODE_RTL();
if (NlsMbCodePageTag == FALSE)
{
/* single-byte code page */

View file

@ -76,7 +76,14 @@ RtlAnsiStringToUnicodeString(
PAGED_CODE_RTL();
Length = RtlAnsiStringToUnicodeSize(AnsiSource);
if (NlsMbCodePageTag == FALSE)
{
Length = AnsiSource->Length * 2 + sizeof(WCHAR);
}
else
{
Length = RtlxAnsiStringToUnicodeSize(AnsiSource);
}
if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2;
UniDest->Length = (USHORT)Length - sizeof(WCHAR);
@ -91,6 +98,9 @@ RtlAnsiStringToUnicodeString(
return STATUS_BUFFER_OVERFLOW;
}
/* UniDest->MaximumLength must be even due to sizeof(WCHAR) being 2 */
ASSERT(!(UniDest->MaximumLength & 1) && UniDest->Length <= UniDest->MaximumLength);
Status = RtlMultiByteToUnicodeN(UniDest->Buffer,
UniDest->Length,
&Index,
@ -123,6 +133,8 @@ RtlxAnsiStringToUnicodeSize(IN PCANSI_STRING AnsiString)
{
ULONG Size;
PAGED_CODE_RTL();
/* Convert from Mb String to Unicode Size */
RtlMultiByteToUnicodeSize(&Size,
AnsiString->Buffer,
@ -963,7 +975,16 @@ RtlUnicodeStringToAnsiString(
PAGED_CODE_RTL();
Length = RtlUnicodeStringToAnsiSize(UniSource);
ASSERT(!(UniSource->Length & 1));
if (NlsMbCodePageTag == FALSE)
{
Length = (UniSource->Length + sizeof(WCHAR)) / sizeof(WCHAR);
}
else
{
Length = RtlxUnicodeStringToAnsiSize(UniSource);
}
if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2;
AnsiDest->Length = (USHORT)Length - sizeof(CHAR);
@ -1953,6 +1974,10 @@ RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString)
{
ULONG Size;
PAGED_CODE_RTL();
ASSERT(!(UnicodeString->Length & 1));
/* Convert the Unicode String to Mb Size */
RtlUnicodeToMultiByteSize(&Size,
UnicodeString->Buffer,

View file

@ -1,5 +0,0 @@
set_source_files_properties(${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S PROPERTIES GENERATED TRUE)
add_library(win32ksys ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S)
add_dependencies(win32ksys win32k_S asm)
set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE C)

View file

@ -107,6 +107,7 @@ list(APPEND SOURCE
ex/work.c
ex/xipdisp.c
ex/zone.c
ex/zw.S
fsrtl/dbcsname.c
fsrtl/fastio.c
fsrtl/faulttol.c
@ -269,7 +270,6 @@ list(APPEND SOURCE
vf/driver.c
wmi/wmi.c
ntoskrnl.rc
${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
if(ARCH MATCHES i386)
@ -451,3 +451,5 @@ add_dependencies(ntoskrnl psdk bugcodes kernel_zw kernel_napi asm)
add_minicd_target(ntoskrnl reactos ntoskrnl.exe)
add_livecd_target(ntoskrnl reactos/system32)
add_importlib_target(ntoskrnl.spec)
add_library(ntdllsys ntdll.S)

12
ntoskrnl/ex/zw.S Normal file
View file

@ -0,0 +1,12 @@
#include <asm.inc>
#include <syscalls.inc>
.code
SyscallId = 0
#define SVC_(name, argcount) STUB_K name, argcount
#include <sysfuncs.h>
END

View file

@ -0,0 +1,22 @@
/*
* FILE: ntoskrnl/include/internal/napi.h
* COPYRIGHT: GNU GPL, see COPYING in the top level directory
* PURPOSE: System Call Table for Native API
* PROGRAMMER: Timo Kreuzer
*/
#define SVC_(name, argcount) (ULONG_PTR)Nt##name,
ULONG_PTR MainSSDT[] = {
#include "sysfuncs.h"
};
#undef SVC_
#define SVC_(name, argcount) argcount * sizeof(void *),
UCHAR MainSSPT[] = {
#include "sysfuncs.h"
};
#define MIN_SYSCALL_NUMBER 0
#define NUMBER_OF_SYSCALLS (sizeof(MainSSPT) / sizeof(MainSSPT[0]))
#define MAX_SYSCALL_NUMBER (NUMBER_OF_SYSCALLS - 1)
ULONG MainNumberOfSysCalls = NUMBER_OF_SYSCALLS;

296
ntoskrnl/include/sysfuncs.h Normal file
View file

@ -0,0 +1,296 @@
SVC_(AcceptConnectPort, 6)
SVC_(AccessCheck, 8)
SVC_(AccessCheckAndAuditAlarm, 11)
SVC_(AccessCheckByType, 11)
SVC_(AccessCheckByTypeAndAuditAlarm, 16)
SVC_(AccessCheckByTypeResultList, 11)
SVC_(AccessCheckByTypeResultListAndAuditAlarm, 16)
SVC_(AccessCheckByTypeResultListAndAuditAlarmByHandle, 17)
SVC_(AddAtom, 3)
SVC_(AddBootEntry, 2)
SVC_(AddDriverEntry, 2)
SVC_(AdjustGroupsToken, 6)
SVC_(AdjustPrivilegesToken, 6)
SVC_(AlertResumeThread, 2)
SVC_(AlertThread, 1)
SVC_(AllocateLocallyUniqueId, 1)
SVC_(AllocateUserPhysicalPages, 3)
SVC_(AllocateUuids, 4)
SVC_(AllocateVirtualMemory, 6)
SVC_(ApphelpCacheControl, 2)
SVC_(AreMappedFilesTheSame, 2)
SVC_(AssignProcessToJobObject, 2)
SVC_(CallbackReturn, 3)
SVC_(CancelDeviceWakeupRequest, 1)
SVC_(CancelIoFile, 2)
SVC_(CancelTimer, 2)
SVC_(ClearEvent, 1)
SVC_(Close, 1)
SVC_(CloseObjectAuditAlarm, 3)
SVC_(CompactKeys, 2)
SVC_(CompareTokens, 3)
SVC_(CompleteConnectPort, 1)
SVC_(CompressKey, 1)
SVC_(ConnectPort, 8)
SVC_(Continue, 2)
SVC_(CreateDebugObject, 4)
SVC_(CreateDirectoryObject, 3)
SVC_(CreateEvent, 5)
SVC_(CreateEventPair, 3)
SVC_(CreateFile, 11)
SVC_(CreateIoCompletion, 4)
SVC_(CreateJobObject, 3)
SVC_(CreateJobSet, 3)
SVC_(CreateKey, 7)
SVC_(CreateMailslotFile, 8)
SVC_(CreateMutant, 4)
SVC_(CreateNamedPipeFile, 14)
SVC_(CreatePagingFile, 4)
SVC_(CreatePort, 5)
SVC_(CreateProcess, 8)
SVC_(CreateProcessEx, 9)
SVC_(CreateProfile, 9)
SVC_(CreateSection, 7)
SVC_(CreateSemaphore, 5)
SVC_(CreateSymbolicLinkObject, 4)
SVC_(CreateThread, 8)
SVC_(CreateTimer, 4)
SVC_(CreateToken, 13)
SVC_(CreateWaitablePort, 5)
SVC_(DebugActiveProcess, 2)
SVC_(DebugContinue, 3)
SVC_(DelayExecution, 2)
SVC_(DeleteAtom, 1)
SVC_(DeleteBootEntry, 1)
SVC_(DeleteDriverEntry, 1)
SVC_(DeleteFile, 1)
SVC_(DeleteKey, 1)
SVC_(DeleteObjectAuditAlarm, 3)
SVC_(DeleteValueKey, 2)
SVC_(DeviceIoControlFile, 10)
SVC_(DisplayString, 1)
SVC_(DuplicateObject, 7)
SVC_(DuplicateToken, 6)
SVC_(EnumerateBootEntries, 2)
SVC_(EnumerateDriverEntries, 2)
SVC_(EnumerateKey, 6)
SVC_(EnumerateSystemEnvironmentValuesEx, 3)
SVC_(EnumerateValueKey, 6)
SVC_(ExtendSection, 2)
SVC_(FilterToken, 6)
SVC_(FindAtom, 3)
SVC_(FlushBuffersFile, 2)
SVC_(FlushInstructionCache, 3)
SVC_(FlushKey, 1)
SVC_(FlushVirtualMemory, 4)
SVC_(FlushWriteBuffer, 0)
SVC_(FreeUserPhysicalPages, 3)
SVC_(FreeVirtualMemory, 4)
SVC_(FsControlFile, 10)
SVC_(GetContextThread, 2)
SVC_(GetDevicePowerState, 2)
SVC_(GetPlugPlayEvent, 4)
SVC_(GetWriteWatch, 7)
SVC_(ImpersonateAnonymousToken, 1)
SVC_(ImpersonateClientOfPort, 2)
SVC_(ImpersonateThread, 3)
SVC_(InitializeRegistry, 1)
SVC_(InitiatePowerAction, 4)
SVC_(IsProcessInJob, 2)
SVC_(IsSystemResumeAutomatic, 0)
SVC_(ListenPort, 2)
SVC_(LoadDriver, 1)
SVC_(LoadKey, 2)
SVC_(LoadKey2, 3)
SVC_(LoadKeyEx, 4)
SVC_(LockFile, 10)
SVC_(LockProductActivationKeys, 2)
SVC_(LockRegistryKey, 1)
SVC_(LockVirtualMemory, 4)
SVC_(MakePermanentObject, 1)
SVC_(MakeTemporaryObject, 1)
SVC_(MapUserPhysicalPages, 3)
SVC_(MapUserPhysicalPagesScatter, 3)
SVC_(MapViewOfSection, 10)
SVC_(ModifyBootEntry, 1)
SVC_(ModifyDriverEntry, 1)
SVC_(NotifyChangeDirectoryFile, 9)
SVC_(NotifyChangeKey, 10)
SVC_(NotifyChangeMultipleKeys, 12)
SVC_(OpenDirectoryObject, 3)
SVC_(OpenEvent, 3)
SVC_(OpenEventPair, 3)
SVC_(OpenFile, 6)
SVC_(OpenIoCompletion, 3)
SVC_(OpenJobObject, 3)
SVC_(OpenKey, 3)
SVC_(OpenMutant, 3)
SVC_(OpenObjectAuditAlarm, 12)
SVC_(OpenProcess, 4)
SVC_(OpenProcessToken, 3)
SVC_(OpenProcessTokenEx, 4)
SVC_(OpenSection, 3)
SVC_(OpenSemaphore, 3)
SVC_(OpenSymbolicLinkObject, 3)
SVC_(OpenThread, 4)
SVC_(OpenThreadToken, 4)
SVC_(OpenThreadTokenEx, 5)
SVC_(OpenTimer, 3)
SVC_(PlugPlayControl, 3)
SVC_(PowerInformation, 5)
SVC_(PrivilegeCheck, 3)
SVC_(PrivilegeObjectAuditAlarm, 6)
SVC_(PrivilegedServiceAuditAlarm, 5)
SVC_(ProtectVirtualMemory, 5)
SVC_(PulseEvent, 2)
SVC_(QueryAttributesFile, 2)
SVC_(QueryBootEntryOrder, 2)
SVC_(QueryBootOptions, 2)
SVC_(QueryDebugFilterState, 2)
SVC_(QueryDefaultLocale, 2)
SVC_(QueryDefaultUILanguage, 1)
SVC_(QueryDirectoryFile, 11)
SVC_(QueryDirectoryObject, 7)
SVC_(QueryDriverEntryOrder, 2)
SVC_(QueryEaFile, 9)
SVC_(QueryEvent, 5)
SVC_(QueryFullAttributesFile, 2)
SVC_(QueryInformationAtom, 5)
SVC_(QueryInformationFile, 5)
SVC_(QueryInformationJobObject, 5)
SVC_(QueryInformationPort, 5)
SVC_(QueryInformationProcess, 5)
SVC_(QueryInformationThread, 5)
SVC_(QueryInformationToken, 5)
SVC_(QueryInstallUILanguage, 1)
SVC_(QueryIntervalProfile, 2)
SVC_(QueryIoCompletion, 5)
SVC_(QueryKey, 5)
SVC_(QueryMultipleValueKey, 6)
SVC_(QueryMutant, 5)
SVC_(QueryObject, 5)
SVC_(QueryOpenSubKeys, 2)
SVC_(QueryOpenSubKeysEx, 4)
SVC_(QueryPerformanceCounter, 2)
SVC_(QueryQuotaInformationFile, 9)
SVC_(QuerySection, 5)
SVC_(QuerySecurityObject, 5)
SVC_(QuerySemaphore, 5)
SVC_(QuerySymbolicLinkObject, 3)
SVC_(QuerySystemEnvironmentValue, 4)
SVC_(QuerySystemEnvironmentValueEx, 5)
SVC_(QuerySystemInformation, 4)
SVC_(QuerySystemTime, 1)
SVC_(QueryTimer, 5)
SVC_(QueryTimerResolution, 3)
SVC_(QueryValueKey, 6)
SVC_(QueryVirtualMemory, 6)
SVC_(QueryVolumeInformationFile, 5)
SVC_(QueueApcThread, 5)
SVC_(RaiseException, 3)
SVC_(RaiseHardError, 6)
SVC_(ReadFile, 9)
SVC_(ReadFileScatter, 9)
SVC_(ReadRequestData, 6)
SVC_(ReadVirtualMemory, 5)
SVC_(RegisterThreadTerminatePort, 1)
SVC_(ReleaseMutant, 2)
SVC_(ReleaseSemaphore, 3)
SVC_(RemoveIoCompletion, 5)
SVC_(RemoveProcessDebug, 2)
SVC_(RenameKey, 2)
SVC_(ReplaceKey, 3)
SVC_(ReplyPort, 2)
SVC_(ReplyWaitReceivePort, 4)
SVC_(ReplyWaitReceivePortEx, 5)
SVC_(ReplyWaitReplyPort, 2)
SVC_(RequestDeviceWakeup, 1)
SVC_(RequestPort, 2)
SVC_(RequestWaitReplyPort, 3)
SVC_(RequestWakeupLatency, 1)
SVC_(ResetEvent, 2)
SVC_(ResetWriteWatch, 3)
SVC_(RestoreKey, 3)
SVC_(ResumeProcess, 1)
SVC_(ResumeThread, 2)
SVC_(SaveKey, 2)
SVC_(SaveKeyEx, 3)
SVC_(SaveMergedKeys, 3)
SVC_(SecureConnectPort, 9)
SVC_(SetBootEntryOrder, 2)
SVC_(SetBootOptions, 2)
SVC_(SetContextThread, 2)
SVC_(SetDebugFilterState, 3)
SVC_(SetDefaultHardErrorPort, 1)
SVC_(SetDefaultLocale, 2)
SVC_(SetDefaultUILanguage, 1)
SVC_(SetDriverEntryOrder, 2)
SVC_(SetEaFile, 4)
SVC_(SetEvent, 2)
SVC_(SetEventBoostPriority, 1)
SVC_(SetHighEventPair, 1)
SVC_(SetHighWaitLowEventPair, 1)
SVC_(SetInformationDebugObject, 5)
SVC_(SetInformationFile, 5)
SVC_(SetInformationJobObject, 4)
SVC_(SetInformationKey, 4)
SVC_(SetInformationObject, 4)
SVC_(SetInformationProcess, 4)
SVC_(SetInformationThread, 4)
SVC_(SetInformationToken, 4)
SVC_(SetIntervalProfile, 2)
SVC_(SetIoCompletion, 5)
SVC_(SetLdtEntries, 6)
SVC_(SetLowEventPair, 1)
SVC_(SetLowWaitHighEventPair, 1)
SVC_(SetQuotaInformationFile, 4)
SVC_(SetSecurityObject, 3)
SVC_(SetSystemEnvironmentValue, 2)
SVC_(SetSystemEnvironmentValueEx, 2)
SVC_(SetSystemInformation, 3)
SVC_(SetSystemPowerState, 3)
SVC_(SetSystemTime, 2)
SVC_(SetThreadExecutionState, 2)
SVC_(SetTimer, 7)
SVC_(SetTimerResolution, 3)
SVC_(SetUuidSeed, 1)
SVC_(SetValueKey, 6)
SVC_(SetVolumeInformationFile, 5)
SVC_(ShutdownSystem, 1)
SVC_(SignalAndWaitForSingleObject, 4)
SVC_(StartProfile, 1)
SVC_(StopProfile, 1)
SVC_(SuspendProcess, 1)
SVC_(SuspendThread, 2)
SVC_(SystemDebugControl, 6)
SVC_(TerminateJobObject, 2)
SVC_(TerminateProcess, 2)
SVC_(TerminateThread, 2)
SVC_(TestAlert, 0)
SVC_(TraceEvent, 4)
SVC_(TranslateFilePath, 4)
SVC_(UnloadDriver, 1)
SVC_(UnloadKey, 1)
SVC_(UnloadKey2, 2)
SVC_(UnloadKeyEx, 2)
SVC_(UnlockFile, 5)
SVC_(UnlockVirtualMemory, 4)
SVC_(UnmapViewOfSection, 2)
SVC_(VdmControl, 2)
SVC_(WaitForDebugEvent, 4)
SVC_(WaitForMultipleObjects, 5)
SVC_(WaitForSingleObject, 3)
SVC_(WaitHighEventPair, 1)
SVC_(WaitLowEventPair, 1)
SVC_(WriteFile, 9)
SVC_(WriteFileGather, 9)
SVC_(WriteRequestData, 6)
SVC_(WriteVirtualMemory, 5)
SVC_(YieldExecution, 0)
SVC_(CreateKeyedEvent, 4)
SVC_(OpenKeyedEvent, 3)
SVC_(ReleaseKeyedEvent, 4)
SVC_(WaitForKeyedEvent, 4)
SVC_(QueryPortInformationProcess, 0)
SVC_(GetCurrentProcessorNumber, 0)
SVC_(WaitForMultipleObjects32, 5)

View file

@ -44,7 +44,7 @@ NTAPI
CPUID(IN ULONG CpuInfo[4],
IN ULONG InfoType)
{
RtlZeroMemory(CpuInfo, sizeof(CpuInfo));
RtlZeroMemory(CpuInfo, 4 * sizeof(ULONG));
}
VOID

View file

@ -690,9 +690,6 @@ l_ReadHeaderFromFile:
DIE(("The image is larger than 4GB\n"));
}
/* spare our caller some work in validating the segments */
*Flags = EXEFMT_LOAD_ASSUME_SEGMENTS_SORTED | EXEFMT_LOAD_ASSUME_SEGMENTS_NO_OVERLAP;
if(nSectionAlignment >= PAGE_SIZE)
*Flags |= EXEFMT_LOAD_ASSUME_SEGMENTS_PAGE_ALIGNED;

12
ntoskrnl/ntdll.S Normal file
View file

@ -0,0 +1,12 @@
#include <asm.inc>
#include <syscalls.inc>
.code
SyscallId = 0
#define SVC_(name, argcount) STUB_U name, argcount
#include <sysfuncs.h>
END

View file

@ -192,3 +192,5 @@ add_pch(win32k ${CMAKE_CURRENT_SOURCE_DIR}/pch.h ${SOURCE})
add_dependencies(win32k gendib_generated subsystem_napi)
add_cab_target(win32k 1)
add_importlib_target(win32k.spec)
add_library(win32ksys sys-stubs.S)

View file

@ -91,7 +91,7 @@ EXLATEOBJ_iXlateRGBto555(PEXLATEOBJ pxlo, ULONG iColor)
iColor >>= 13;
iNewColor |= iColor & 0x3E0;
/* Copy green */
/* Copy blue */
iColor >>= 13;
iNewColor |= iColor & 0x1F;
@ -417,11 +417,11 @@ EXLATEOBJ_vInitialize(
pexlo->aulXlate[0] =
PALETTE_ulGetNearestPaletteIndex(ppalSrc, crSrcBackColor);
}
else if (ppalSrc->flFlags & PAL_BGR)
else if (ppalSrc->flFlags & PAL_RGB)
{
pexlo->aulXlate[0] = crSrcBackColor;
}
else if (ppalSrc->flFlags & PAL_RGB)
else if (ppalSrc->flFlags & PAL_BGR)
{
pexlo->aulXlate[0] = RGB(GetBValue(crSrcBackColor),
GetGValue(crSrcBackColor),

View file

@ -0,0 +1,22 @@
/*
* FILE: subsystems/win32/win32k/include/napi.h
* COPYRIGHT: GNU GPL, see COPYING in the top level directory
* PURPOSE: System Call Table for Native API
* PROGRAMMER: Timo Kreuzer
*/
#define SVC_(name, argcount) (ULONG_PTR)Nt##name,
ULONG_PTR Win32kSSDT[] = {
#include "w32ksvc.h"
};
#undef SVC_
#define SVC_(name, argcount) argcount * sizeof(void *),
UCHAR Win32kSSPT[] = {
#include "w32ksvc.h"
};
#define MIN_SYSCALL_NUMBER 0
#define NUMBER_OF_SYSCALLS (sizeof(Win32kSSPT) / sizeof(Win32kSSPT[0]))
#define MAX_SYSCALL_NUMBER (NUMBER_OF_SYSCALLS - 1)
ULONG Win32kNumberOfSysCalls = NUMBER_OF_SYSCALLS;

View file

@ -272,64 +272,51 @@ ULONG
FASTCALL
InterlockedPopFreeEntry(VOID)
{
ULONG idxFirst, idxNext, idxPrev;
ULONG iFirst, iNext, iPrev;
PGDI_TABLE_ENTRY pEntry;
DWORD PrevProcId;
DPRINT("Enter InterLockedPopFreeEntry\n");
while (TRUE)
do
{
idxFirst = GdiHandleTable->FirstFree;
/* Get the index and sequence number of the first free entry */
iFirst = GdiHandleTable->FirstFree;
if (!idxFirst)
/* Check if we have a free entry */
if (!(iFirst & GDI_HANDLE_INDEX_MASK))
{
/* Increment FirstUnused and get the new index */
idxFirst = InterlockedIncrement((LONG*)&GdiHandleTable->FirstUnused) - 1;
iFirst = InterlockedIncrement((LONG*)&GdiHandleTable->FirstUnused) - 1;
/* Check if we have entries left */
if (idxFirst >= GDI_HANDLE_COUNT)
/* Check if we have unused entries left */
if (iFirst >= GDI_HANDLE_COUNT)
{
DPRINT1("No more gdi handles left!\n");
return 0;
}
/* Return the old index */
return idxFirst;
return iFirst;
}
/* Get a pointer to the first free entry */
pEntry = GdiHandleTable->Entries + idxFirst;
pEntry = GdiHandleTable->Entries + (iFirst & GDI_HANDLE_INDEX_MASK);
/* Try to lock the entry */
PrevProcId = InterlockedCompareExchange((LONG*)&pEntry->ProcessId, 1, 0);
if (PrevProcId != 0)
{
/* The entry was locked or not free, wait and start over */
DelayExecution();
continue;
}
/* Sanity check: is entry really free? */
ASSERT(((ULONG_PTR)pEntry->KernelData & ~GDI_HANDLE_INDEX_MASK) == 0);
/* Create a new value with an increased sequence number */
iNext = (USHORT)(ULONG_PTR)pEntry->KernelData;
iNext |= (iFirst & ~GDI_HANDLE_INDEX_MASK) + 0x10000;
/* Try to exchange the FirstFree value */
idxNext = (ULONG_PTR)pEntry->KernelData;
idxPrev = InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstFree,
idxNext,
idxFirst);
/* Unlock the free entry */
(void)InterlockedExchange((LONG*)&pEntry->ProcessId, 0);
/* If we succeeded, break out of the loop */
if (idxPrev == idxFirst)
{
break;
}
iPrev = InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstFree,
iNext,
iFirst);
}
while (iPrev != iFirst);
return idxFirst;
/* Sanity check: is entry really free? */
ASSERT(((ULONG_PTR)pEntry->KernelData & ~GDI_HANDLE_INDEX_MASK) == 0);
return iFirst & GDI_HANDLE_INDEX_MASK;
}
/* Pushes an entry of the handle table to the free list,
@ -338,7 +325,7 @@ VOID
FASTCALL
InterlockedPushFreeEntry(ULONG idxToFree)
{
ULONG idxFirstFree, idxPrev;
ULONG iToFree, iFirst, iPrev;
PGDI_TABLE_ENTRY pFreeEntry;
DPRINT("Enter InterlockedPushFreeEntry\n");
@ -346,18 +333,26 @@ InterlockedPushFreeEntry(ULONG idxToFree)
pFreeEntry = GdiHandleTable->Entries + idxToFree;
ASSERT((pFreeEntry->Type & GDI_ENTRY_BASETYPE_MASK) == 0);
ASSERT(pFreeEntry->ProcessId == 0);
pFreeEntry->UserData = NULL;
pFreeEntry->UserData = NULL; // FIXME
ASSERT(pFreeEntry->UserData == NULL);
do
{
idxFirstFree = GdiHandleTable->FirstFree;
pFreeEntry->KernelData = (PVOID)(ULONG_PTR)idxFirstFree;
/* Get the current first free index and sequence number */
iFirst = GdiHandleTable->FirstFree;
idxPrev = InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstFree,
idxToFree,
idxFirstFree);
/* Set the KernelData member to the index of the first free entry */
pFreeEntry->KernelData = UlongToPtr(iFirst & GDI_HANDLE_INDEX_MASK);
/* Combine new index and increased sequence number in iToFree */
iToFree = idxToFree | ((iFirst & ~GDI_HANDLE_INDEX_MASK) + 0x10000);
/* Try to atomically update the first free entry */
iPrev = InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstFree,
iToFree,
iFirst);
}
while (idxPrev != idxFirstFree);
while (iPrev != iFirst);
}

View file

@ -0,0 +1,12 @@
#include <asm.inc>
#include <syscalls.inc>
.code
SyscallId = HEX(1000)
#define SVC_(name, argcount) STUB_U name, argcount
#include "w32ksvc.h"
END

View file

@ -0,0 +1,695 @@
// SVC_(<NAME>, <ARG_COUNT>)
//
// Funcs, order, should, match, Windows, XP, 5.1.2600, SP2)
//
SVC_(GdiAbortDoc, 1)
SVC_(GdiAbortPath, 1)
SVC_(GdiAddFontResourceW, 6)
SVC_(GdiAddRemoteFontToDC, 4)
SVC_(GdiAddFontMemResourceEx, 5)
SVC_(GdiRemoveMergeFont, 2)
SVC_(GdiAddRemoteMMInstanceToDC, 3)
SVC_(GdiAlphaBlend, 12)
SVC_(GdiAngleArc, 6)
SVC_(GdiAnyLinkedFonts, 0)
SVC_(GdiFontIsLinked, 1)
SVC_(GdiArcInternal, 10)
SVC_(GdiBeginPath, 1)
SVC_(GdiBitBlt, 11)
SVC_(GdiCancelDC, 1)
SVC_(GdiCheckBitmapBits, 8)
SVC_(GdiCloseFigure, 1)
SVC_(GdiClearBitmapAttributes, 2)
SVC_(GdiClearBrushAttributes, 2)
SVC_(GdiColorCorrectPalette, 6)
SVC_(GdiCombineRgn, 4)
SVC_(GdiCombineTransform, 3)
SVC_(GdiComputeXformCoefficients, 1)
SVC_(GdiConsoleTextOut, 4)
SVC_(GdiConvertMetafileRect, 2)
SVC_(GdiCreateBitmap, 5)
SVC_(GdiCreateClientObj, 1)
SVC_(GdiCreateColorSpace, 1)
SVC_(GdiCreateColorTransform, 8)
SVC_(GdiCreateCompatibleBitmap, 3)
SVC_(GdiCreateCompatibleDC, 1)
SVC_(GdiCreateDIBBrush, 6)
SVC_(GdiCreateDIBitmapInternal, 11)
SVC_(GdiCreateDIBSection, 9)
SVC_(GdiCreateEllipticRgn, 4)
SVC_(GdiCreateHalftonePalette, 1)
SVC_(GdiCreateHatchBrushInternal, 3)
SVC_(GdiCreateMetafileDC, 1)
SVC_(GdiCreatePaletteInternal, 2)
SVC_(GdiCreatePatternBrushInternal, 3)
SVC_(GdiCreatePen, 4)
SVC_(GdiCreateRectRgn, 4)
SVC_(GdiCreateRoundRectRgn, 6)
SVC_(GdiCreateServerMetaFile, 6)
SVC_(GdiCreateSolidBrush, 2)
SVC_(GdiD3dContextCreate, 4)
SVC_(GdiD3dContextDestroy, 1)
SVC_(GdiD3dContextDestroyAll, 1)
SVC_(GdiD3dValidateTextureStageState, 1)
SVC_(GdiD3dDrawPrimitives2, 7)
SVC_(GdiDdGetDriverState, 1)
SVC_(GdiDdAddAttachedSurface, 3)
SVC_(GdiDdAlphaBlt, 3)
SVC_(GdiDdAttachSurface, 2)
SVC_(GdiDdBeginMoCompFrame, 2)
SVC_(GdiDdBlt, 3)
SVC_(GdiDdCanCreateSurface, 2)
SVC_(GdiDdCanCreateD3DBuffer, 2)
SVC_(GdiDdColorControl, 2)
SVC_(GdiDdCreateDirectDrawObject, 1)
SVC_(GdiDdCreateSurface, 8)
SVC_(GdiDdCreateD3DBuffer, 8)
SVC_(GdiDdCreateMoComp, 2)
SVC_(GdiDdCreateSurfaceObject, 6)
SVC_(GdiDdDeleteDirectDrawObject, 1)
SVC_(GdiDdDeleteSurfaceObject, 1)
SVC_(GdiDdDestroyMoComp, 2)
SVC_(GdiDdDestroySurface, 2)
SVC_(GdiDdDestroyD3DBuffer, 1)
SVC_(GdiDdEndMoCompFrame, 2)
SVC_(GdiDdFlip, 5)
SVC_(GdiDdFlipToGDISurface, 2)
SVC_(GdiDdGetAvailDriverMemory, 2)
SVC_(GdiDdGetBltStatus, 2)
SVC_(GdiDdGetDC, 2)
SVC_(GdiDdGetDriverInfo, 2)
SVC_(GdiDdGetDxHandle, 3)
SVC_(GdiDdGetFlipStatus, 2)
SVC_(GdiDdGetInternalMoCompInfo, 2)
SVC_(GdiDdGetMoCompBuffInfo, 2)
SVC_(GdiDdGetMoCompGuids, 2)
SVC_(GdiDdGetMoCompFormats, 2)
SVC_(GdiDdGetScanLine, 2)
SVC_(GdiDdLock, 3)
SVC_(GdiDdLockD3D, 2)
SVC_(GdiDdQueryDirectDrawObject, 11)
SVC_(GdiDdQueryMoCompStatus, 2)
SVC_(GdiDdReenableDirectDrawObject, 2)
SVC_(GdiDdReleaseDC, 1)
SVC_(GdiDdRenderMoComp, 2)
SVC_(GdiDdResetVisrgn, 2)
SVC_(GdiDdSetColorKey, 2)
SVC_(GdiDdSetExclusiveMode, 2)
SVC_(GdiDdSetGammaRamp, 3)
SVC_(GdiDdCreateSurfaceEx, 3)
SVC_(GdiDdSetOverlayPosition, 3)
SVC_(GdiDdUnattachSurface, 2)
SVC_(GdiDdUnlock, 2)
SVC_(GdiDdUnlockD3D, 2)
SVC_(GdiDdUpdateOverlay, 3)
SVC_(GdiDdWaitForVerticalBlank, 2)
SVC_(GdiDvpCanCreateVideoPort, 2)
SVC_(GdiDvpColorControl, 2)
SVC_(GdiDvpCreateVideoPort, 2)
SVC_(GdiDvpDestroyVideoPort, 2)
SVC_(GdiDvpFlipVideoPort, 4)
SVC_(GdiDvpGetVideoPortBandwidth, 2)
SVC_(GdiDvpGetVideoPortField, 2)
SVC_(GdiDvpGetVideoPortFlipStatus, 2)
SVC_(GdiDvpGetVideoPortInputFormats, 2)
SVC_(GdiDvpGetVideoPortLine, 2)
SVC_(GdiDvpGetVideoPortOutputFormats, 2)
SVC_(GdiDvpGetVideoPortConnectInfo, 2)
SVC_(GdiDvpGetVideoSignalStatus, 2)
SVC_(GdiDvpUpdateVideoPort, 4)
SVC_(GdiDvpWaitForVideoPortSync, 2)
SVC_(GdiDvpAcquireNotification, 3)
SVC_(GdiDvpReleaseNotification, 2)
SVC_(GdiDxgGenericThunk, 6)
SVC_(GdiDeleteClientObj, 1)
SVC_(GdiDeleteColorSpace, 1)
SVC_(GdiDeleteColorTransform, 2)
SVC_(GdiDeleteObjectApp, 1)
SVC_(GdiDescribePixelFormat, 4)
SVC_(GdiGetPerBandInfo, 2)
SVC_(GdiDoBanding, 4)
SVC_(GdiDoPalette, 6)
SVC_(GdiDrawEscape, 4)
SVC_(GdiEllipse, 5)
SVC_(GdiEnableEudc, 1)
SVC_(GdiEndDoc, 1)
SVC_(GdiEndPage, 1)
SVC_(GdiEndPath, 1)
SVC_(GdiEnumFontChunk, 5)
SVC_(GdiEnumFontClose, 1)
SVC_(GdiEnumFontOpen, 7)
SVC_(GdiEnumObjects, 4)
SVC_(GdiEqualRgn, 2)
SVC_(GdiEudcLoadUnloadLink, 7)
SVC_(GdiExcludeClipRect, 5)
SVC_(GdiExtCreatePen, 11)
SVC_(GdiExtCreateRegion, 3)
SVC_(GdiExtEscape, 8)
SVC_(GdiExtFloodFill, 5)
SVC_(GdiExtGetObjectW, 3)
SVC_(GdiExtSelectClipRgn, 3)
SVC_(GdiExtTextOutW, 9)
SVC_(GdiFillPath, 1)
SVC_(GdiFillRgn, 3)
SVC_(GdiFlattenPath, 1)
SVC_(GdiFlushUserBatch, 0)
SVC_(GdiFlush, 0)
SVC_(GdiForceUFIMapping, 2)
SVC_(GdiFrameRgn, 5)
SVC_(GdiFullscreenControl, 5)
SVC_(GdiGetAndSetDCDword, 4)
SVC_(GdiGetAppClipBox, 2)
SVC_(GdiGetBitmapBits, 3)
SVC_(GdiGetBitmapDimension, 2)
SVC_(GdiGetBoundsRect, 3)
SVC_(GdiGetCharABCWidthsW, 6)
SVC_(GdiGetCharacterPlacementW, 6)
SVC_(GdiGetCharSet, 1)
SVC_(GdiGetCharWidthW, 6)
SVC_(GdiGetCharWidthInfo, 2)
SVC_(GdiGetColorAdjustment, 2)
SVC_(GdiGetColorSpaceforBitmap, 1)
SVC_(GdiGetDCDword, 3)
SVC_(GdiGetDCforBitmap, 1)
SVC_(GdiGetDCObject, 2)
SVC_(GdiGetDCPoint, 3)
SVC_(GdiGetDeviceCaps, 2)
SVC_(GdiGetDeviceGammaRamp, 2)
SVC_(GdiGetDeviceCapsAll, 2)
SVC_(GdiGetDIBitsInternal, 9)
SVC_(GdiGetETM, 2)
SVC_(GdiGetEudcTimeStampEx, 3)
SVC_(GdiGetFontData, 5)
SVC_(GdiGetFontResourceInfoInternalW, 7)
SVC_(GdiGetGlyphIndicesW, 5)
SVC_(GdiGetGlyphIndicesWInternal, 6)
SVC_(GdiGetGlyphOutline, 8)
SVC_(GdiGetKerningPairs, 3)
SVC_(GdiGetLinkedUFIs, 3)
SVC_(GdiGetMiterLimit, 2)
SVC_(GdiGetMonitorID, 3)
SVC_(GdiGetNearestColor, 2)
SVC_(GdiGetNearestPaletteIndex, 2)
SVC_(GdiGetObjectBitmapHandle, 2)
SVC_(GdiGetOutlineTextMetricsInternalW, 4)
SVC_(GdiGetPath, 4)
SVC_(GdiGetPixel, 3)
SVC_(GdiGetRandomRgn, 3)
SVC_(GdiGetRasterizerCaps, 2)
SVC_(GdiGetRealizationInfo, 3)
SVC_(GdiGetRegionData, 3)
SVC_(GdiGetRgnBox, 2)
SVC_(GdiGetServerMetaFileBits, 7)
SVC_(GdiGetSpoolMessage, 4)
SVC_(GdiGetStats, 5)
SVC_(GdiGetStockObject, 1)
SVC_(GdiGetStringBitmapW, 5)
SVC_(GdiGetSystemPaletteUse, 1)
SVC_(GdiGetTextCharsetInfo, 3)
SVC_(GdiGetTextExtent, 5)
SVC_(GdiGetTextExtentExW, 8)
SVC_(GdiGetTextFaceW, 4)
SVC_(GdiGetTextMetricsW, 3)
SVC_(GdiGetTransform, 3)
SVC_(GdiGetUFI, 6)
SVC_(GdiGetEmbUFI, 7)
SVC_(GdiGetUFIPathname, 10)
SVC_(GdiGetEmbedFonts, 0)
SVC_(GdiChangeGhostFont, 2)
SVC_(GdiAddEmbFontToDC, 2)
SVC_(GdiGetFontUnicodeRanges, 2)
SVC_(GdiGetWidthTable, 7)
SVC_(GdiGradientFill, 6)
SVC_(GdiHfontCreate, 5)
SVC_(GdiIcmBrushInfo, 8)
SVC_(GdiInit, 0)
SVC_(GdiInitSpool, 0)
SVC_(GdiIntersectClipRect, 5)
SVC_(GdiInvertRgn, 2)
SVC_(GdiLineTo, 3)
SVC_(GdiMakeFontDir, 5)
SVC_(GdiMakeInfoDC, 2)
SVC_(GdiMaskBlt, 13)
SVC_(GdiModifyWorldTransform, 3)
SVC_(GdiMonoBitmap, 1)
SVC_(GdiMoveTo, 4)
SVC_(GdiOffsetClipRgn, 3)
SVC_(GdiOffsetRgn, 3)
SVC_(GdiOpenDCW, 8)
SVC_(GdiPatBlt, 6)
SVC_(GdiPolyPatBlt, 5)
SVC_(GdiPathToRegion, 1)
SVC_(GdiPlgBlt, 11)
SVC_(GdiPolyDraw, 4)
SVC_(GdiPolyPolyDraw, 5)
SVC_(GdiPolyTextOutW, 4)
SVC_(GdiPtInRegion, 3)
SVC_(GdiPtVisible, 3)
SVC_(GdiQueryFonts, 3)
SVC_(GdiQueryFontAssocInfo, 1)
SVC_(GdiRectangle, 5)
SVC_(GdiRectInRegion, 2)
SVC_(GdiRectVisible, 2)
SVC_(GdiRemoveFontResourceW, 6)
SVC_(GdiRemoveFontMemResourceEx, 1)
SVC_(GdiResetDC, 5)
SVC_(GdiResizePalette, 2)
SVC_(GdiRestoreDC, 2)
SVC_(GdiRoundRect, 7)
SVC_(GdiSaveDC, 1)
SVC_(GdiScaleViewportExtEx, 6)
SVC_(GdiScaleWindowExtEx, 6)
SVC_(GdiSelectBitmap, 2)
SVC_(GdiSelectBrush, 2)
SVC_(GdiSelectClipPath, 2)
SVC_(GdiSelectFont, 2)
SVC_(GdiSelectPen, 2)
SVC_(GdiSetBitmapAttributes, 2)
SVC_(GdiSetBitmapBits, 3)
SVC_(GdiSetBitmapDimension, 4)
SVC_(GdiSetBoundsRect, 3)
SVC_(GdiSetBrushAttributes, 2)
SVC_(GdiSetBrushOrg, 4)
SVC_(GdiSetColorAdjustment, 2)
SVC_(GdiSetColorSpace, 2)
SVC_(GdiSetDeviceGammaRamp, 2)
SVC_(GdiSetDIBitsToDeviceInternal, 16)
SVC_(GdiSetFontEnumeration, 1)
SVC_(GdiSetFontXform, 3)
SVC_(GdiSetIcmMode, 3)
SVC_(GdiSetLinkedUFIs, 3)
SVC_(GdiSetMagicColors, 3)
SVC_(GdiSetMetaRgn, 1)
SVC_(GdiSetMiterLimit, 3)
SVC_(GdiGetDeviceWidth, 1)
SVC_(GdiMirrorWindowOrg, 1)
SVC_(GdiSetLayout, 3)
SVC_(GdiSetPixel, 4)
SVC_(GdiSetPixelFormat, 2)
SVC_(GdiSetRectRgn, 5)
SVC_(GdiSetSystemPaletteUse, 2)
SVC_(GdiSetTextJustification, 3)
SVC_(GdiSetupPublicCFONT, 3)
SVC_(GdiSetVirtualResolution, 5)
SVC_(GdiSetSizeDevice, 3)
SVC_(GdiStartDoc, 4)
SVC_(GdiStartPage, 1)
SVC_(GdiStretchBlt, 12)
SVC_(GdiStretchDIBitsInternal, 16)
SVC_(GdiStrokeAndFillPath, 1)
SVC_(GdiStrokePath, 1)
SVC_(GdiSwapBuffers, 1)
SVC_(GdiTransformPoints, 5)
SVC_(GdiTransparentBlt, 11)
SVC_(GdiUnloadPrinterDriver, 2)
SVC_(GdiUnmapMemFont, 1)
SVC_(GdiUnrealizeObject, 1)
SVC_(GdiUpdateColors, 1)
SVC_(GdiWidenPath, 1)
SVC_(UserActivateKeyboardLayout, 2)
SVC_(UserAlterWindowStyle, 3)
SVC_(UserAssociateInputContext, 3)
SVC_(UserAttachThreadInput, 3)
SVC_(UserBeginPaint, 2)
SVC_(UserBitBltSysBmp, 8)
SVC_(UserBlockInput, 1)
SVC_(UserBuildHimcList, 4)
SVC_(UserBuildHwndList, 7)
SVC_(UserBuildNameList, 4)
SVC_(UserBuildPropList, 4)
SVC_(UserCallHwnd, 2)
SVC_(UserCallHwndLock, 2)
SVC_(UserCallHwndOpt, 2)
SVC_(UserCallHwndParam, 3)
SVC_(UserCallHwndParamLock, 3)
SVC_(UserCallMsgFilter, 2)
SVC_(UserCallNextHookEx, 4)
SVC_(UserCallNoParam, 1)
SVC_(UserCallOneParam, 2)
SVC_(UserCallTwoParam, 3)
SVC_(UserChangeClipboardChain, 2)
SVC_(UserChangeDisplaySettings, 5)
SVC_(UserCheckImeHotKey, 2)
SVC_(UserCheckMenuItem, 3)
SVC_(UserChildWindowFromPointEx, 4)
SVC_(UserClipCursor, 1)
SVC_(UserCloseClipboard, 0)
SVC_(UserCloseDesktop, 1)
SVC_(UserCloseWindowStation, 1)
SVC_(UserConsoleControl, 3)
SVC_(UserConvertMemHandle, 2)
SVC_(UserCopyAcceleratorTable, 3)
SVC_(UserCountClipboardFormats, 0)
SVC_(UserCreateAcceleratorTable, 2)
SVC_(UserCreateCaret, 4)
SVC_(UserCreateDesktop, 5)
SVC_(UserCreateInputContext, 1)
SVC_(UserCreateLocalMemHandle, 4)
SVC_(UserCreateWindowEx, 15)
SVC_(UserCreateWindowStation, 7)
SVC_(UserDdeGetQualityOfService, 3)
SVC_(UserDdeInitialize, 5)
SVC_(UserDdeSetQualityOfService, 3)
SVC_(UserDeferWindowPos, 8)
SVC_(UserDefSetText, 2)
SVC_(UserDeleteMenu, 3)
SVC_(UserDestroyAcceleratorTable, 1)
SVC_(UserDestroyCursor, 2)
SVC_(UserDestroyInputContext, 1)
SVC_(UserDestroyMenu, 1)
SVC_(UserDestroyWindow, 1)
SVC_(UserDisableThreadIme, 1)
SVC_(UserDispatchMessage, 1)
SVC_(UserDragDetect, 3)
SVC_(UserDragObject, 5)
SVC_(UserDrawAnimatedRects, 4)
SVC_(UserDrawCaption, 4)
SVC_(UserDrawCaptionTemp, 7)
SVC_(UserDrawIconEx, 11)
SVC_(UserDrawMenuBarTemp, 5)
SVC_(UserEmptyClipboard, 0)
SVC_(UserEnableMenuItem, 3)
SVC_(UserEnableScrollBar, 3)
SVC_(UserEndDeferWindowPosEx, 2)
SVC_(UserEndMenu, 0)
SVC_(UserEndPaint, 2)
SVC_(UserEnumDisplayDevices, 4)
// SVC_(UserEnumDisplayMonitors, 4, Wrong, number, of, param, ?)
SVC_(UserEnumDisplayMonitors, 5)
SVC_(UserEnumDisplaySettings, 4)
SVC_(UserEvent, 1)
SVC_(UserExcludeUpdateRgn, 2)
SVC_(UserFillWindow, 4)
// SVC_(UserFindExistingCursorIcon, 3, Wrong, number, of, param, ?)
SVC_(UserFindExistingCursorIcon, 4)
SVC_(UserFindWindowEx, 5)
SVC_(UserFlashWindowEx, 1)
SVC_(UserGetAltTabInfo, 6)
SVC_(UserGetAncestor, 2)
SVC_(UserGetAppImeLevel, 1)
SVC_(UserGetAsyncKeyState, 1)
SVC_(UserGetAtomName, 2)
SVC_(UserGetCaretBlinkTime, 0)
SVC_(UserGetCaretPos, 1)
SVC_(UserGetClassInfo, 5)
SVC_(UserGetClassName, 3)
SVC_(UserGetClipboardData, 2)
SVC_(UserGetClipboardFormatName, 3)
SVC_(UserGetClipboardOwner, 0)
SVC_(UserGetClipboardSequenceNumber, 0)
SVC_(UserGetClipboardViewer, 0)
SVC_(UserGetClipCursor, 1)
SVC_(UserGetComboBoxInfo, 2)
SVC_(UserGetControlBrush, 3)
SVC_(UserGetControlColor, 4)
SVC_(UserGetCPD, 3)
SVC_(UserGetCursorFrameInfo, 4)
SVC_(UserGetCursorInfo, 1)
SVC_(UserGetDC, 1)
SVC_(UserGetDCEx, 3)
SVC_(UserGetDoubleClickTime, 0)
SVC_(UserGetForegroundWindow, 0)
SVC_(UserGetGuiResources, 2)
SVC_(UserGetGUIThreadInfo, 2)
SVC_(UserGetIconInfo, 6)
SVC_(UserGetIconSize, 4)
SVC_(UserGetImeHotKey, 4)
SVC_(UserGetImeInfoEx, 2)
SVC_(UserGetInternalWindowPos, 3)
SVC_(UserGetKeyboardLayoutList, 2)
SVC_(UserGetKeyboardLayoutName, 1)
SVC_(UserGetKeyboardState, 1)
SVC_(UserGetKeyNameText, 3)
SVC_(UserGetKeyState, 1)
SVC_(UserGetListBoxInfo, 1)
SVC_(UserGetMenuBarInfo, 4)
SVC_(UserGetMenuIndex, 2)
SVC_(UserGetMenuItemRect, 4)
SVC_(UserGetMessage, 4)
SVC_(UserGetMouseMovePointsEx, 5)
SVC_(UserGetObjectInformation, 5)
SVC_(UserGetOpenClipboardWindow, 0)
SVC_(UserGetPriorityClipboardFormat, 2)
SVC_(UserGetProcessWindowStation, 0)
SVC_(UserGetRawInputBuffer, 3)
SVC_(UserGetRawInputData, 5)
SVC_(UserGetRawInputDeviceInfo, 4)
SVC_(UserGetRawInputDeviceList, 3)
SVC_(UserGetRegisteredRawInputDevices, 3)
SVC_(UserGetScrollBarInfo, 3)
SVC_(UserGetSystemMenu, 2)
SVC_(UserGetThreadDesktop, 2)
SVC_(UserGetThreadState, 1)
SVC_(UserGetTitleBarInfo, 2)
SVC_(UserGetUpdateRect, 3)
SVC_(UserGetUpdateRgn, 3)
SVC_(UserGetWindowDC, 1)
SVC_(UserGetWindowPlacement, 2)
SVC_(UserGetWOWClass, 2)
SVC_(UserHardErrorControl, 3)
SVC_(UserHideCaret, 1)
SVC_(UserHiliteMenuItem, 4)
SVC_(UserImpersonateDdeClientWindow, 2)
SVC_(UserInitialize, 3)
SVC_(UserInitializeClientPfnArrays, 4)
SVC_(UserInitTask, 12)
SVC_(UserInternalGetWindowText, 3)
SVC_(UserInvalidateRect, 3)
SVC_(UserInvalidateRgn, 3)
SVC_(UserIsClipboardFormatAvailable, 1)
SVC_(UserKillTimer, 2)
SVC_(UserLoadKeyboardLayoutEx, 7)
SVC_(UserLockWindowStation, 1)
SVC_(UserLockWindowUpdate, 1)
SVC_(UserLockWorkStation, 0)
SVC_(UserMapVirtualKeyEx, 4)
SVC_(UserMenuItemFromPoint, 4)
SVC_(UserMessageCall, 7)
SVC_(UserMinMaximize, 3)
SVC_(UserMNDragLeave, 0)
SVC_(UserMNDragOver, 2)
SVC_(UserModifyUserStartupInfoFlags, 2)
SVC_(UserMoveWindow, 6)
SVC_(UserNotifyIMEStatus, 3)
SVC_(UserNotifyProcessCreate, 4)
SVC_(UserNotifyWinEvent, 4)
SVC_(UserOpenClipboard, 2)
SVC_(UserOpenDesktop, 3)
SVC_(UserOpenInputDesktop, 3)
SVC_(UserOpenWindowStation, 2)
SVC_(UserPaintDesktop, 1)
SVC_(UserPeekMessage, 5)
SVC_(UserPostMessage, 4)
SVC_(UserPostThreadMessage, 4)
SVC_(UserPrintWindow, 3)
SVC_(UserProcessConnect, 3)
SVC_(UserQueryInformationThread, 5)
SVC_(UserQueryInputContext, 2)
SVC_(UserQuerySendMessage, 1)
SVC_(UserQueryUserCounters, 5)
SVC_(UserQueryWindow, 2)
SVC_(UserRealChildWindowFromPoint, 3)
SVC_(UserRealInternalGetMessage, 6)
SVC_(UserRealWaitMessageEx, 2)
SVC_(UserRedrawWindow, 4)
SVC_(UserRegisterClassExWOW, 7)
SVC_(UserRegisterUserApiHook, 4)
SVC_(UserRegisterHotKey, 4)
SVC_(UserRegisterRawInputDevices, 3)
SVC_(UserRegisterTasklist, 1)
SVC_(UserRegisterWindowMessage, 1)
SVC_(UserRemoveMenu, 3)
SVC_(UserRemoveProp, 2)
SVC_(UserResolveDesktop, 4)
SVC_(UserResolveDesktopForWOW, 1)
SVC_(UserSBGetParms, 4)
SVC_(UserScrollDC, 7)
SVC_(UserScrollWindowEx, 8)
SVC_(UserSelectPalette, 3)
SVC_(UserSendInput, 3)
SVC_(UserSetActiveWindow, 1)
SVC_(UserSetAppImeLevel, 2)
SVC_(UserSetCapture, 1)
SVC_(UserSetClassLong, 4)
SVC_(UserSetClassWord, 3)
SVC_(UserSetClipboardData, 3)
SVC_(UserSetClipboardViewer, 1)
SVC_(UserSetConsoleReserveKeys, 2)
SVC_(UserSetCursor, 1)
SVC_(UserSetCursorContents, 2)
SVC_(UserSetCursorIconData, 6)
SVC_(UserSetDbgTag, 2)
SVC_(UserSetFocus, 1)
SVC_(UserSetImeHotKey, 5)
SVC_(UserSetImeInfoEx, 1)
SVC_(UserSetImeOwnerWindow, 2)
SVC_(UserSetInformationProcess, 4)
SVC_(UserSetInformationThread, 4)
SVC_(UserSetInternalWindowPos, 4)
SVC_(UserSetKeyboardState, 1)
SVC_(UserSetLogonNotifyWindow, 1)
SVC_(UserSetMenu, 3)
SVC_(UserSetMenuContextHelpId, 2)
SVC_(UserSetMenuDefaultItem, 3)
SVC_(UserSetMenuFlagRtoL, 1)
SVC_(UserSetObjectInformation, 4)
SVC_(UserSetParent, 2)
SVC_(UserSetProcessWindowStation, 1)
SVC_(UserSetProp, 3)
SVC_(UserSetRipFlags, 2)
SVC_(UserSetScrollInfo, 4)
SVC_(UserSetShellWindowEx, 2)
SVC_(UserSetSysColors, 4)
SVC_(UserSetSystemCursor, 2)
SVC_(UserSetSystemMenu, 2)
SVC_(UserSetSystemTimer, 4)
SVC_(UserSetThreadDesktop, 1)
SVC_(UserSetThreadLayoutHandles, 2)
SVC_(UserSetThreadState, 2)
SVC_(UserSetTimer, 4)
SVC_(UserSetWindowFNID, 2)
SVC_(UserSetWindowLong, 4)
SVC_(UserSetWindowPlacement, 2)
SVC_(UserSetWindowPos, 7)
SVC_(UserSetWindowRgn, 3)
SVC_(UserSetWindowsHookAW, 3)
SVC_(UserSetWindowsHookEx, 6)
SVC_(UserSetWindowStationUser, 4)
SVC_(UserSetWindowWord, 3)
SVC_(UserSetWinEventHook, 8)
SVC_(UserShowCaret, 1)
SVC_(UserShowScrollBar, 3)
SVC_(UserShowWindow, 2)
SVC_(UserShowWindowAsync, 2)
SVC_(UserSoundSentry, 0)
SVC_(UserSwitchDesktop, 1)
SVC_(UserSystemParametersInfo, 4)
SVC_(UserTestForInteractiveUser, 1)
SVC_(UserThunkedMenuInfo, 2)
SVC_(UserThunkedMenuItemInfo, 6)
SVC_(UserToUnicodeEx, 7)
SVC_(UserTrackMouseEvent, 1)
SVC_(UserTrackPopupMenuEx, 6)
SVC_(UserCalcMenuBar, 5)
SVC_(UserPaintMenuBar, 6)
SVC_(UserTranslateAccelerator, 3)
SVC_(UserTranslateMessage, 2)
SVC_(UserUnhookWindowsHookEx, 1)
SVC_(UserUnhookWinEvent, 1)
SVC_(UserUnloadKeyboardLayout, 1)
SVC_(UserUnlockWindowStation, 1)
SVC_(UserUnregisterClass, 3)
SVC_(UserUnregisterUserApiHook, 0)
SVC_(UserUnregisterHotKey, 2)
SVC_(UserUpdateInputContext, 3)
SVC_(UserUpdateInstance, 3)
SVC_(UserUpdateLayeredWindow, 10)
SVC_(UserGetLayeredWindowAttributes, 4)
SVC_(UserSetLayeredWindowAttributes, 4)
SVC_(UserUpdatePerUserSystemParameters, 2)
SVC_(UserUserHandleGrantAccess, 3)
SVC_(UserValidateHandleSecure, 2)
SVC_(UserValidateRect, 2)
SVC_(UserValidateTimerCallback, 3)
SVC_(UserVkKeyScanEx, 3)
SVC_(UserWaitForInputIdle, 3)
SVC_(UserWaitForMsgAndEvent, 1)
SVC_(UserWaitMessage, 0)
SVC_(UserWin32PoolAllocationStats, 6)
SVC_(UserWindowFromPhysicalPoint, 2)
SVC_(UserWindowFromPoint, 2)
SVC_(UserYieldTask, 0)
SVC_(UserRemoteConnect, 3)
SVC_(UserRemoteRedrawRectangle, 4)
SVC_(UserRemoteRedrawScreen, 0)
SVC_(UserRemoteStopScreenUpdates, 0)
SVC_(UserCtxDisplayIOCtl, 3)
SVC_(GdiEngAssociateSurface, 3)
SVC_(GdiEngCreateBitmap, 6)
SVC_(GdiEngCreateDeviceSurface, 4)
SVC_(GdiEngCreateDeviceBitmap, 4)
SVC_(GdiEngCreatePalette, 6)
SVC_(GdiEngComputeGlyphSet, 3)
SVC_(GdiEngCopyBits, 6)
SVC_(GdiEngDeletePalette, 1)
SVC_(GdiEngDeleteSurface, 1)
SVC_(GdiEngEraseSurface, 3)
SVC_(GdiEngUnlockSurface, 1)
SVC_(GdiEngLockSurface, 1)
SVC_(GdiEngBitBlt, 11)
SVC_(GdiEngStretchBlt, 11)
SVC_(GdiEngPlgBlt, 11)
SVC_(GdiEngMarkBandingSurface, 1)
SVC_(GdiEngStrokePath, 8)
SVC_(GdiEngFillPath, 7)
SVC_(GdiEngStrokeAndFillPath, 10)
SVC_(GdiEngPaint, 5)
SVC_(GdiEngLineTo, 9)
SVC_(GdiEngAlphaBlend, 7)
SVC_(GdiEngGradientFill, 10)
SVC_(GdiEngTransparentBlt, 8)
SVC_(GdiEngTextOut, 10)
SVC_(GdiEngStretchBltROP, 13)
SVC_(GdiXLATEOBJ_cGetPalette, 4)
SVC_(GdiXLATEOBJ_iXlate, 2)
SVC_(GdiXLATEOBJ_hGetColorTransform, 1)
SVC_(GdiCLIPOBJ_bEnum, 3)
SVC_(GdiCLIPOBJ_cEnumStart, 5)
SVC_(GdiCLIPOBJ_ppoGetPath, 1)
SVC_(GdiEngDeletePath, 1)
SVC_(GdiEngCreateClip, 0)
SVC_(GdiEngDeleteClip, 1)
SVC_(GdiBRUSHOBJ_ulGetBrushColor, 1)
SVC_(GdiBRUSHOBJ_pvAllocRbrush, 2)
SVC_(GdiBRUSHOBJ_pvGetRbrush, 1)
SVC_(GdiBRUSHOBJ_hGetColorTransform, 1)
SVC_(GdiXFORMOBJ_bApplyXform, 5)
SVC_(GdiXFORMOBJ_iGetXform, 2)
SVC_(GdiFONTOBJ_vGetInfo, 3)
SVC_(GdiFONTOBJ_pxoGetXform, 1)
SVC_(GdiFONTOBJ_cGetGlyphs, 5)
SVC_(GdiFONTOBJ_pifi, 1)
SVC_(GdiFONTOBJ_pfdg, 1)
SVC_(GdiFONTOBJ_pQueryGlyphAttrs, 2)
SVC_(GdiFONTOBJ_pvTrueTypeFontFile, 2)
SVC_(GdiFONTOBJ_cGetAllGlyphHandles, 2)
SVC_(GdiSTROBJ_bEnum, 3)
SVC_(GdiSTROBJ_bEnumPositionsOnly, 3)
SVC_(GdiSTROBJ_bGetAdvanceWidths, 4)
SVC_(GdiSTROBJ_vEnumStart, 1)
SVC_(GdiSTROBJ_dwGetCodePage, 1)
SVC_(GdiPATHOBJ_vGetBounds, 2)
SVC_(GdiPATHOBJ_bEnum, 2)
SVC_(GdiPATHOBJ_vEnumStart, 1)
SVC_(GdiPATHOBJ_vEnumStartClipLines, 4)
SVC_(GdiPATHOBJ_bEnumClipLines, 3)
SVC_(GdiGetDhpdev, 1)
SVC_(GdiEngCheckAbort, 1)
SVC_(GdiHT_Get8BPPFormatPalette, 4)
SVC_(GdiHT_Get8BPPMaskPalette, 6)
SVC_(GdiUpdateTransform, 1)
SVC_(GdiSetPUMPDOBJ, 4)
SVC_(GdiBRUSHOBJ_DeleteRbrush, 2)
SVC_(GdiUMPDEngFreeUserMem, 1)
SVC_(GdiDrawStream, 3)
// ReactOS, specific, syscalls)
SVC_(GdiSetDIBits, 7)
SVC_(GdiSetViewportOrgEx, 4)
SVC_(GdiSetWindowOrgEx, 4)
SVC_(GdiGetFontFamilyInfo, 4)
SVC_(GdiOffsetViewportOrgEx, 4)
SVC_(GdiOffsetWindowOrgEx, 4)
SVC_(UserBuildMenuItemList, 4)
SVC_(UserGetMenuDefaultItem, 3)
SVC_(UserGetLastInputInfo, 1)
SVC_(UserGetMinMaxInfo, 3)
SVC_(UserGetMonitorInfo, 2)
SVC_(UserMenuInfo, 3)
SVC_(UserMenuItemInfo, 5)
SVC_(UserMonitorFromPoint, 3)
SVC_(UserMonitorFromRect, 2)
SVC_(UserMonitorFromWindow, 2)
SVC_(UserSetScrollBarInfo, 3)