sync with trunk head (34904)
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 28 Jul 2008 15:52:00 +0000 (15:52 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 28 Jul 2008 15:52:00 +0000 (15:52 +0000)
svn path=/branches/ros-amd64-bringup/; revision=34910

1  2 
reactos/dll/ntdll/def/ntdll_arm.def
reactos/dll/win32/advapi32/advapi32.rbuild
reactos/hal/hal/hal.c
reactos/include/psdk/winnt.h
reactos/lib/sdk/crt/stdio/file.c
reactos/ntoskrnl/mm/anonmem.c
reactos/subsystems/win32/win32k/ntuser/callback.c
reactos/subsystems/win32/win32k/ntuser/hook.c
reactos/tools/rbuild/module.cpp
reactos/tools/winebuild/spec32.c

@@@ -1,4 -1,3 +1,4 @@@
 +
  ; $Id: ntdll.def 34404 2008-07-10 09:46:25Z fireball $
  ;
  ; ReactOS Operating System
  LIBRARY ntdll.dll
  
  EXPORTS
- CsrAllocateCaptureBuffer@8
- CsrAllocateMessagePointer@12
- CsrCaptureMessageBuffer@16
- CsrCaptureMessageMultiUnicodeStringsInPlace@12
- CsrCaptureMessageString@20
- CsrCaptureTimeout@8
- CsrClientCallServer@16
- CsrClientConnectToServer@20
- CsrFreeCaptureBuffer@4
- CsrGetProcessId@0
- CsrIdentifyAlertableThread@0
- CsrNewThread@0
- CsrProbeForRead@12
- CsrProbeForWrite@12
- CsrSetPriorityClass@8
- DbgBreakPoint@0
+ CsrAllocateCaptureBuffer
+ CsrAllocateMessagePointer
+ CsrCaptureMessageBuffer
+ CsrCaptureMessageMultiUnicodeStringsInPlace
+ CsrCaptureMessageString
+ CsrCaptureTimeout
+ CsrClientCallServer
+ CsrClientConnectToServer
+ CsrFreeCaptureBuffer
+ CsrGetProcessId
+ CsrIdentifyAlertableThread
+ CsrNewThread
+ CsrProbeForRead
+ CsrProbeForWrite
+ CsrSetPriorityClass
+ DbgBreakPoint
  DbgPrint
  DbgPrintEx
- DbgPrompt@12
- DbgUiConvertStateChangeStructure@8
- DbgUiDebugActiveProcess@4
- DbgUiConnectToDbg@0
- DbgUiContinue@8
- DbgUiGetThreadDebugObject@0
- DbgUiIssueRemoteBreakin@4
- DbgUiRemoteBreakin@0
- DbgUiSetThreadDebugObject@4
- DbgUiStopDebugging@4
- DbgUiWaitStateChange@8
- DbgUserBreakPoint@0
- KiRaiseUserExceptionDispatcher@0
- KiUserApcDispatcher@16
- KiUserCallbackDispatcher@12
- KiUserExceptionDispatcher@8
- KiIntSystemCall@0
- KiFastSystemCallRet@0
- KiFastSystemCall@0
- LdrAccessResource@16
- LdrAddRefDll@8
- LdrDisableThreadCalloutsForDll@4
- LdrEnumResources@20
- LdrFindEntryForAddress@8
- LdrFindResourceDirectory_U@16
- LdrFindResource_U@16
- LdrGetDllHandle@16
- LdrGetProcedureAddress@16
- LdrInitializeThunk@16
- LdrLoadDll@16
- LdrProcessRelocationBlock@16
- LdrQueryImageFileExecutionOptions@24
- LdrQueryProcessModuleInformation@12
- LdrShutdownProcess@0
- LdrShutdownThread@0
- LdrUnloadDll@4
- LdrVerifyImageMatchesChecksum@16
+ DbgPrompt
+ DbgUiConvertStateChangeStructure
+ DbgUiDebugActiveProcess
+ DbgUiConnectToDbg
+ DbgUiContinue
+ DbgUiGetThreadDebugObject
+ DbgUiIssueRemoteBreakin
+ DbgUiRemoteBreakin
+ DbgUiSetThreadDebugObject
+ DbgUiStopDebugging
+ DbgUiWaitStateChange
+ DbgUserBreakPoint
+ KiRaiseUserExceptionDispatcher
+ KiUserApcDispatcher
+ KiUserCallbackDispatcher
+ KiUserExceptionDispatcher
+ KiIntSystemCall
+ KiFastSystemCallRet
+ KiFastSystemCall
+ LdrAccessResource
+ LdrAddRefDll
+ LdrDisableThreadCalloutsForDll
+ LdrEnumResources
+ LdrFindEntryForAddress
+ LdrFindResourceDirectory_U
+ LdrFindResource_U
+ LdrGetDllHandle
+ LdrGetProcedureAddress
+ LdrInitializeThunk
+ LdrLoadDll
+ LdrProcessRelocationBlock
+ LdrQueryImageFileExecutionOptions
+ LdrQueryProcessModuleInformation
+ LdrShutdownProcess
+ LdrShutdownThread
+ LdrUnloadDll
+ LdrVerifyImageMatchesChecksum
  NlsAnsiCodePage DATA
  NlsMbCodePageTag DATA
  NlsMbOemCodePageTag DATA
- NtAcceptConnectPort@24
- NtAccessCheck@32
- NtAccessCheckAndAuditAlarm@44
- NtAddAtom@12
- NtAddBootEntry@8
- NtAdjustGroupsToken@24
- NtAdjustPrivilegesToken@24
- NtAlertResumeThread@8
- NtAlertThread@4
- NtAllocateLocallyUniqueId@4
- NtAllocateUuids@16
- NtAllocateVirtualMemory@24
- NtAssignProcessToJobObject@8
- NtCallbackReturn@12
- NtCancelIoFile@8
- NtCancelTimer@8
- NtClearEvent@4
- NtClose@4
- NtCloseObjectAuditAlarm@12
- NtCompareTokens@12
- NtCompleteConnectPort@4
- NtConnectPort@32
- NtContinue@8
- NtCreateDebugObject@16
- NtCreateDirectoryObject@12
- NtCreateEvent@20
- NtCreateEventPair@12
- NtCreateFile@44
- NtCreateIoCompletion@16
- NtCreateJobObject@12
- NtCreateKey@28
- NtCreateMailslotFile@32
- NtCreateMutant@16
- NtCreateNamedPipeFile@56
- NtCreatePagingFile@16
- NtCreatePort@20
- NtCreateProcess@32
- NtCreateProfile@36
- NtCreateSection@28
- NtCreateSemaphore@20
- NtCreateSymbolicLinkObject@16
- NtCreateThread@32
- NtCreateTimer@16
- NtCreateToken@52
- NtCreateWaitablePort@20
- NtCurrentTeb=_NtCurrentTeb@0
- NtDebugContinue@12
- NtDelayExecution@8
- NtDeleteAtom@4
- NtDeleteFile@4
- NtDeleteKey@4
- NtDeleteObjectAuditAlarm@12
- NtDeleteValueKey@8
- NtDeviceIoControlFile@40
- NtDisplayString@4
- NtDuplicateObject@28
- NtDuplicateToken@24
- NtEnumerateKey@24
- NtEnumerateValueKey@24
- NtExtendSection@8
- NtFindAtom@12
- NtFlushBuffersFile@8
- NtFlushInstructionCache@12
- NtFlushKey@4
- NtFlushVirtualMemory@16
- NtFlushWriteBuffer@0
- NtFreeVirtualMemory@16
- NtFsControlFile@40
- NtGetContextThread@8
- NtGetPlugPlayEvent@16
- NtImpersonateAnonymousToken@4
- NtImpersonateClientOfPort@8
- NtImpersonateThread@12
- NtInitializeRegistry@4
- NtIsProcessInJob@8
- NtListenPort@8
- NtLoadDriver@4
- NtLoadKey@8
- NtLoadKey2@12
- NtLockFile@40
- NtLockVirtualMemory@16
- NtMakeTemporaryObject@4
- NtMapViewOfSection@40
- NtNotifyChangeDirectoryFile@36
- NtNotifyChangeKey@40
- NtOpenDirectoryObject@12
- NtOpenEvent@12
- NtOpenEventPair@12
- NtOpenFile@24
- NtOpenIoCompletion@12
- NtOpenJobObject@12
- NtOpenKey@12
- NtOpenMutant@12
- NtOpenObjectAuditAlarm@48
- NtOpenProcess@16
- NtOpenProcessToken@12
- NtOpenSection@12
- NtOpenSemaphore@12
- NtOpenSymbolicLinkObject@12
- NtOpenThread@16
- NtOpenThreadToken@16
- NtOpenTimer@12
- NtPlugPlayControl@12
- NtPowerInformation@20
- NtPrivilegeCheck@12
- NtPrivilegedServiceAuditAlarm@20
- NtPrivilegeObjectAuditAlarm@24
- NtProtectVirtualMemory@20
- NtPulseEvent@8
- NtQueryAttributesFile@8
- NtQueryDebugFilterState@8
- NtQueryDefaultLocale@8
- NtQueryDefaultUILanguage@4
- NtQueryDirectoryFile@44
- NtQueryDirectoryObject@28
- NtQueryEaFile@36
- NtQueryEvent@20
- NtQueryFullAttributesFile@8
- NtQueryInformationAtom@20
- NtQueryInformationFile@20
- NtQueryInformationJobObject@20
- NtQueryInformationPort@20
- NtQueryInformationProcess@20
- NtQueryInformationThread@20
- NtQueryInformationToken@20
- NtQueryInstallUILanguage@4
- NtQueryIntervalProfile@8
- NtQueryIoCompletion@20
- NtQueryKey@20
- NtQueryMultipleValueKey@24
- NtQueryMutant@20
- NtQueryObject@20
- NtQueryPerformanceCounter@8
- NtQuerySection@20
- NtQuerySecurityObject@20
- NtQuerySemaphore@20
- NtQuerySymbolicLinkObject@12
- NtQuerySystemEnvironmentValue@16
- NtQuerySystemInformation@16
- NtQuerySystemTime@4
- NtQueryTimer@20
- NtQueryTimerResolution@12
- NtQueryValueKey@24
- NtQueryVirtualMemory@24
- NtQueryVolumeInformationFile@20
- NtQueueApcThread@20
- NtRaiseException@12
- NtRaiseHardError@24
- NtReadFile@36
- NtReadFileScatter@36
- NtReadRequestData@24
- NtReadVirtualMemory@20
- NtRegisterThreadTerminatePort@4
- NtReleaseMutant@8
- NtReleaseSemaphore@12
- NtRemoveIoCompletion@20
- NtReplaceKey@12
- NtReplyPort@8
- NtReplyWaitReceivePort@16
- NtReplyWaitReceivePortEx@20
- NtReplyWaitReplyPort@8
- NtRequestPort@8
- NtRequestWaitReplyPort@12
- NtResetEvent@8
- NtRestoreKey@12
- NtResumeProcess@4
- NtResumeThread@8
- NtSaveKey@8
- NtSecureConnectPort@36
- NtSetContextThread@8
- NtSetDebugFilterState@12
- NtSetDefaultHardErrorPort@4
- NtSetDefaultLocale@8
- NtSetDefaultUILanguage@4
- NtSetEaFile@16
- NtSetEvent@8
- NtSetHighEventPair@4
- NtSetHighWaitLowEventPair@4
- NtSetInformationDebugObject@20
- NtSetInformationFile@20
- NtSetInformationJobObject@16
- NtSetInformationKey@16
- NtSetInformationObject@16
- NtSetInformationProcess@16
- NtSetInformationThread@16
- NtSetInformationToken@16
- NtSetIntervalProfile@8
- NtSetIoCompletion@20
- NtSetLdtEntries@24
- NtSetLowEventPair@4
- NtSetLowWaitHighEventPair@4
- NtSetSecurityObject@12
- NtSetSystemEnvironmentValue@8
- NtSetSystemInformation@12
- NtSetSystemPowerState@12
- NtSetSystemTime@8
- NtSetTimer@28
- NtSetTimerResolution@12
- NtSetUuidSeed@4
- NtSetValueKey@24
- NtSetVolumeInformationFile@20
- NtShutdownSystem@4
- NtSignalAndWaitForSingleObject@16
- NtStartProfile@4
- NtStopProfile@4
- NtSuspendProcess@4
- NtSuspendThread@8
- NtSystemDebugControl@24
- NtTerminateJobObject@8
- NtTerminateProcess@8
- NtTerminateThread@8
- NtTestAlert@0
- NtUnloadDriver@4
- NtUnloadKey@4
- NtUnlockFile@20
- NtUnlockVirtualMemory@16
- NtUnmapViewOfSection@8
- NtVdmControl@8
- NtWaitForDebugEvent@16
- NtWaitForMultipleObjects@20
- NtWaitForSingleObject@12
- NtWaitHighEventPair@4
- NtWaitLowEventPair@4
- NtWriteFile@36
- NtWriteFileGather@36
- NtWriteRequestData@24
- NtWriteVirtualMemory@20
- NtYieldExecution@0
+ NtAcceptConnectPort
+ NtAccessCheck
+ NtAccessCheckAndAuditAlarm
+ NtAddAtom
+ NtAddBootEntry
+ NtAdjustGroupsToken
+ NtAdjustPrivilegesToken
+ NtAlertResumeThread
+ NtAlertThread
+ NtAllocateLocallyUniqueId
+ NtAllocateUuids
+ NtAllocateVirtualMemory
+ NtAssignProcessToJobObject
+ NtCallbackReturn
+ NtCancelIoFile
+ NtCancelTimer
+ NtClearEvent
+ NtClose
+ NtCloseObjectAuditAlarm
+ NtCompareTokens
+ NtCompleteConnectPort
+ NtConnectPort
+ NtContinue
+ NtCreateDebugObject
+ NtCreateDirectoryObject
+ NtCreateEvent
+ NtCreateEventPair
+ NtCreateFile
+ NtCreateIoCompletion
+ NtCreateJobObject
+ NtCreateKey
+ NtCreateMailslotFile
+ NtCreateMutant
+ NtCreateNamedPipeFile
+ NtCreatePagingFile
+ NtCreatePort
+ NtCreateProcess
+ NtCreateProfile
+ NtCreateSection
+ NtCreateSemaphore
+ NtCreateSymbolicLinkObject
+ NtCreateThread
+ NtCreateTimer
+ NtCreateToken
+ NtCreateWaitablePort
+ NtCurrentTeb=_NtCurrentTeb
+ NtDebugContinue
+ NtDelayExecution
+ NtDeleteAtom
+ NtDeleteFile
+ NtDeleteKey
+ NtDeleteObjectAuditAlarm
+ NtDeleteValueKey
+ NtDeviceIoControlFile
+ NtDisplayString
+ NtDuplicateObject
+ NtDuplicateToken
+ NtEnumerateKey
+ NtEnumerateValueKey
+ NtExtendSection
+ NtFindAtom
+ NtFlushBuffersFile
+ NtFlushInstructionCache
+ NtFlushKey
+ NtFlushVirtualMemory
+ NtFlushWriteBuffer
+ NtFreeVirtualMemory
+ NtFsControlFile
+ NtGetContextThread
+ NtGetPlugPlayEvent
+ NtImpersonateAnonymousToken
+ NtImpersonateClientOfPort
+ NtImpersonateThread
+ NtInitializeRegistry
+ NtIsProcessInJob
+ NtListenPort
+ NtLoadDriver
+ NtLoadKey
+ NtLoadKey2
+ NtLockFile
+ NtLockVirtualMemory
+ NtMakeTemporaryObject
+ NtMapViewOfSection
+ NtNotifyChangeDirectoryFile
+ NtNotifyChangeKey
+ NtOpenDirectoryObject
+ NtOpenEvent
+ NtOpenEventPair
+ NtOpenFile
+ NtOpenIoCompletion
+ NtOpenJobObject
+ NtOpenKey
+ NtOpenMutant
+ NtOpenObjectAuditAlarm
+ NtOpenProcess
+ NtOpenProcessToken
+ NtOpenSection
+ NtOpenSemaphore
+ NtOpenSymbolicLinkObject
+ NtOpenThread
+ NtOpenThreadToken
+ NtOpenTimer
+ NtPlugPlayControl
+ NtPowerInformation
+ NtPrivilegeCheck
+ NtPrivilegedServiceAuditAlarm
+ NtPrivilegeObjectAuditAlarm
+ NtProtectVirtualMemory
+ NtPulseEvent
+ NtQueryAttributesFile
+ NtQueryDebugFilterState
+ NtQueryDefaultLocale
+ NtQueryDefaultUILanguage
+ NtQueryDirectoryFile
+ NtQueryDirectoryObject
+ NtQueryEaFile
+ NtQueryEvent
+ NtQueryFullAttributesFile
+ NtQueryInformationAtom
+ NtQueryInformationFile
+ NtQueryInformationJobObject
+ NtQueryInformationPort
+ NtQueryInformationProcess
+ NtQueryInformationThread
+ NtQueryInformationToken
+ NtQueryInstallUILanguage
+ NtQueryIntervalProfile
+ NtQueryIoCompletion
+ NtQueryKey
+ NtQueryMultipleValueKey
+ NtQueryMutant
+ NtQueryObject
+ NtQueryPerformanceCounter
+ NtQuerySection
+ NtQuerySecurityObject
+ NtQuerySemaphore
+ NtQuerySymbolicLinkObject
+ NtQuerySystemEnvironmentValue
+ NtQuerySystemInformation
+ NtQuerySystemTime
+ NtQueryTimer
+ NtQueryTimerResolution
+ NtQueryValueKey
+ NtQueryVirtualMemory
+ NtQueryVolumeInformationFile
+ NtQueueApcThread
+ NtRaiseException
+ NtRaiseHardError
+ NtReadFile
+ NtReadFileScatter
+ NtReadRequestData
+ NtReadVirtualMemory
+ NtRegisterThreadTerminatePort
+ NtReleaseMutant
+ NtReleaseSemaphore
+ NtRemoveIoCompletion
+ NtReplaceKey
+ NtReplyPort
+ NtReplyWaitReceivePort
+ NtReplyWaitReceivePortEx
+ NtReplyWaitReplyPort
+ NtRequestPort
+ NtRequestWaitReplyPort
+ NtResetEvent
+ NtRestoreKey
+ NtResumeProcess
+ NtResumeThread
+ NtSaveKey
+ NtSecureConnectPort
+ NtSetContextThread
+ NtSetDebugFilterState
+ NtSetDefaultHardErrorPort
+ NtSetDefaultLocale
+ NtSetDefaultUILanguage
+ NtSetEaFile
+ NtSetEvent
+ NtSetHighEventPair
+ NtSetHighWaitLowEventPair
+ NtSetInformationDebugObject
+ NtSetInformationFile
+ NtSetInformationJobObject
+ NtSetInformationKey
+ NtSetInformationObject
+ NtSetInformationProcess
+ NtSetInformationThread
+ NtSetInformationToken
+ NtSetIntervalProfile
+ NtSetIoCompletion
+ NtSetLdtEntries
+ NtSetLowEventPair
+ NtSetLowWaitHighEventPair
+ NtSetSecurityObject
+ NtSetSystemEnvironmentValue
+ NtSetSystemInformation
+ NtSetSystemPowerState
+ NtSetSystemTime
+ NtSetTimer
+ NtSetTimerResolution
+ NtSetUuidSeed
+ NtSetValueKey
+ NtSetVolumeInformationFile
+ NtShutdownSystem
+ NtSignalAndWaitForSingleObject
+ NtStartProfile
+ NtStopProfile
+ NtSuspendProcess
+ NtSuspendThread
+ NtSystemDebugControl
+ NtTerminateJobObject
+ NtTerminateProcess
+ NtTerminateThread
+ NtTestAlert
+ NtUnloadDriver
+ NtUnloadKey
+ NtUnlockFile
+ NtUnlockVirtualMemory
+ NtUnmapViewOfSection
+ NtVdmControl
+ NtWaitForDebugEvent
+ NtWaitForMultipleObjects
+ NtWaitForSingleObject
+ NtWaitHighEventPair
+ NtWaitLowEventPair
+ NtWriteFile
+ NtWriteFileGather
+ NtWriteRequestData
+ NtWriteVirtualMemory
+ NtYieldExecution
  ;PfxFindPrefix
  ;PfxInitialize
  ;PfxInsertPrefix
  ;PropertyLengthAsVariant
  ;RestoreEm87Context
  ;RtlAbortRXact
- RtlAbsoluteToSelfRelativeSD@12
- RtlAcquirePebLock@0
- RtlAcquireResourceExclusive@8
- RtlAcquireResourceShared@8
- RtlAcquireSRWLockExclusive@4
- RtlAcquireSRWLockShared@4
- RtlAddAccessAllowedAce@16
- RtlAddAccessAllowedAceEx@20
- RtlAddAccessAllowedObjectAce@28
- RtlAddAccessDeniedAce@16
- RtlAddAccessDeniedAceEx@20
- RtlAddAccessDeniedObjectAce@28
- RtlAddAce@20
+ RtlAbsoluteToSelfRelativeSD
+ RtlAcquirePebLock
+ RtlAcquireResourceExclusive
+ RtlAcquireResourceShared
+ RtlAcquireSRWLockExclusive
+ RtlAcquireSRWLockShared
+ RtlAddAccessAllowedAce
+ RtlAddAccessAllowedAceEx
+ RtlAddAccessAllowedObjectAce
+ RtlAddAccessDeniedAce
+ RtlAddAccessDeniedAceEx
+ RtlAddAccessDeniedObjectAce
+ RtlAddAce
  ;RtlAddActionToRXact
- RtlAddAtomToAtomTable@12
+ RtlAddAtomToAtomTable
  ;RtlAddAttributeActionToRXact
- RtlAddAuditAccessAce@24
- RtlAddAuditAccessAceEx@28
- RtlAddAuditAccessObjectAce@36
+ RtlAddAuditAccessAce
+ RtlAddAuditAccessAceEx
+ RtlAddAuditAccessObjectAce
  ;RtlAddCompoundAce
- RtlAddMandatoryAce@24
- RtlAddRange@36
- RtlAddVectoredExceptionHandler@8
- RtlAdjustPrivilege@16
- RtlAllocateAndInitializeSid@44
- RtlAllocateHandle@8
- RtlAllocateHeap@12
- RtlAnsiCharToUnicodeChar@4
- RtlAnsiStringToUnicodeSize@4=RtlxAnsiStringToUnicodeSize@4
- RtlAnsiStringToUnicodeString@12
- RtlAppendAsciizToString@8
- RtlAppendStringToString@8
- RtlAppendUnicodeStringToString@8
- RtlAppendUnicodeToString@8
+ RtlAddMandatoryAce
+ RtlAddRange
+ RtlAddVectoredExceptionHandler
+ RtlAdjustPrivilege
+ RtlAllocateAndInitializeSid
+ RtlAllocateHandle
+ RtlAllocateHeap
+ RtlAnsiCharToUnicodeChar
+ RtlAnsiStringToUnicodeSize=RtlxAnsiStringToUnicodeSize
+ RtlAnsiStringToUnicodeString
+ RtlAppendAsciizToString
+ RtlAppendStringToString
+ RtlAppendUnicodeStringToString
+ RtlAppendUnicodeToString
  ;RtlApplyRXact
  ;RtlApplyRXactNoFlush
- RtlAreAllAccessesGranted@8
- RtlAreAnyAccessesGranted@8
- RtlAreBitsClear@12
- RtlAreBitsSet@12
- RtlAssert@16
- RtlCaptureStackBackTrace@16
- RtlCharToInteger@12
- RtlCheckRegistryKey@8
- RtlClearAllBits@4
- RtlClearBits@12
- RtlCompactHeap@8
- RtlCompareMemory@12
- RtlCompareMemoryUlong@12
- RtlCompareString@12
- RtlCompareUnicodeString@12
- RtlCompressBuffer@32
- RtlComputeCrc32@12
+ RtlAreAllAccessesGranted
+ RtlAreAnyAccessesGranted
+ RtlAreBitsClear
+ RtlAreBitsSet
+ RtlAssert
+ RtlCaptureStackBackTrace
+ RtlCharToInteger
+ RtlCheckRegistryKey
+ RtlClearAllBits
+ RtlClearBits
+ RtlCompactHeap
+ RtlCompareMemory
+ RtlCompareMemoryUlong
+ RtlCompareString
+ RtlCompareUnicodeString
+ RtlCompressBuffer
+ RtlComputeCrc32
  ;RtlConsoleMultiByteToUnicodeN
- RtlConvertExclusiveToShared@4
- RtlConvertLongToLargeInteger@4
- RtlConvertSharedToExclusive@4
- RtlConvertSidToUnicodeString@12
+ RtlConvertExclusiveToShared
+ RtlConvertLongToLargeInteger
+ RtlConvertSharedToExclusive
+ RtlConvertSidToUnicodeString
  ;RtlConvertUiListToApiList
- RtlConvertUlongToLargeInteger@4
- RtlCopyLuid@8
- RtlCopyLuidAndAttributesArray@12
- RtlCopyRangeList@8
- RtlCopySecurityDescriptor@8
- RtlCopySid@12
- RtlCopySidAndAttributesArray@28
- RtlCopyString@8
- RtlCopyUnicodeString@8
- RtlCreateAcl@12
+ RtlConvertUlongToLargeInteger
+ RtlCopyLuid
+ RtlCopyLuidAndAttributesArray
+ RtlCopyRangeList
+ RtlCopySecurityDescriptor
+ RtlCopySid
+ RtlCopySidAndAttributesArray
+ RtlCopyString
+ RtlCopyUnicodeString
+ RtlCreateAcl
  ;RtlCreateAndSetSD
- RtlCreateAtomTable@8
- RtlCreateEnvironment@8
- RtlCreateHeap@24
- RtlCreateProcessParameters@40
- RtlCreateQueryDebugBuffer@8
- RtlCreateRegistryKey@8
- RtlCreateSecurityDescriptor@8
- RtlCreateTagHeap@16
- RtlCreateTimer@28
- RtlCreateTimerQueue@4
- RtlCreateUnicodeString@8
- RtlCreateUnicodeStringFromAsciiz@8
- RtlCreateUserProcess@40
+ RtlCreateAtomTable
+ RtlCreateEnvironment
+ RtlCreateHeap
+ RtlCreateProcessParameters
+ RtlCreateQueryDebugBuffer
+ RtlCreateRegistryKey
+ RtlCreateSecurityDescriptor
+ RtlCreateTagHeap
+ RtlCreateTimer
+ RtlCreateTimerQueue
+ RtlCreateUnicodeString
+ RtlCreateUnicodeStringFromAsciiz
+ RtlCreateUserProcess
  ;RtlCreateUserSecurityObject
- RtlCreateUserThread@40
- RtlCustomCPToUnicodeN@24
- RtlCutoverTimeToSystemTime@16
- RtlDeNormalizeProcessParams@4
- RtlDecodePointer=RtlEncodePointer@4
- RtlDecompressBuffer@24
- RtlDecompressFragment@32
- RtlDelete@4
- RtlDeleteAce@8
- RtlDeleteAtomFromAtomTable@8
- RtlDeleteCriticalSection@4
- RtlDeleteElementGenericTable@8
- RtlDeleteElementGenericTableAvl@8
- RtlDeleteNoSplay@8
- RtlDeleteOwnersRanges@8
- RtlDeleteRange@24
- RtlDeleteRegistryValue@12
- RtlDeleteResource@4
- RtlDeleteSecurityObject@4
- RtlDeleteTimer@12
- RtlDeleteTimerQueue@4
- RtlDeleteTimerQueueEx@8
- RtlDeregisterWait@4
- RtlDeregisterWaitEx@8
- RtlDestroyAtomTable@4
- RtlDestroyEnvironment@4
- RtlDestroyHandleTable@4
- RtlDestroyHeap@4
- RtlDestroyProcessParameters@4
- RtlDestroyQueryDebugBuffer@4
- RtlDetermineDosPathNameType_U@4
- RtlDllShutdownInProgress@0
- RtlDoesFileExists_U@4
- RtlDosPathNameToNtPathName_U@16
- RtlDosPathNameToRelativeNtPathName_U@16
- RtlDosSearchPath_U@24
- RtlDowncaseUnicodeChar@4
- RtlDowncaseUnicodeString@12
- RtlDumpResource@4
- RtlDuplicateUnicodeString@12
- RtlEmptyAtomTable@8
- RtlEncodePointer@4
- RtlEnlargedIntegerMultiply@8
- RtlEnlargedUnsignedDivide@16
- RtlEnlargedUnsignedMultiply@8
- RtlEnterCriticalSection@4
- RtlEnumProcessHeaps@8
- RtlEnumerateGenericTable@8
- RtlEnumerateGenericTableAvl@8
- RtlEnumerateGenericTableLikeADirectory@28
- RtlEnumerateGenericTableWithoutSplaying@8
- RtlEnumerateGenericTableWithoutSplayingAvl@8
- RtlEqualComputerName@8
- RtlEqualDomainName@8
- RtlEqualLuid@8
- RtlEqualPrefixSid@8
- RtlEqualSid@8
- RtlEqualString@12
- RtlEqualUnicodeString@12
- RtlEraseUnicodeString@4
- RtlExitUserThread@4
- RtlExpandEnvironmentStrings_U@16
- RtlExtendHeap@16
- RtlExtendedIntegerMultiply@12
- RtlExtendedLargeIntegerDivide@16
- RtlExtendedMagicDivide@20
- RtlFillMemory@12
- RtlFillMemoryUlong@12
- RtlFindClearBits@12
- RtlFindClearBitsAndSet@12
- RtlFindClearRuns@16
- RtlFindLastBackwardRunClear@12
- RtlFindLeastSignificantBit@8
- RtlFindLongestRunClear@8
- RtlFindLongestRunSet@8
- RtlFindMessage@20
- RtlFindMostSignificantBit@8
- RtlFindNextForwardRunClear@12
- RtlFindRange@48
- RtlFindSetBits@12
- RtlFindSetBitsAndClear@12
- RtlFirstFreeAce@8
- RtlFormatCurrentUserKeyPath@4
- RtlFormatMessage@32
- RtlFreeAnsiString@4
- RtlFreeHandle@8
- RtlFreeHeap@12
- RtlFreeOemString@4
- RtlFreeRangeList@4
- RtlFreeSid@4
- RtlFreeUnicodeString@4
- RtlFreeUserThreadStack@8
- RtlGUIDFromString@8
- RtlGenerate8dot3Name@16
- RtlGetAce@12
+ RtlCreateUserThread
+ RtlCustomCPToUnicodeN
+ RtlCutoverTimeToSystemTime
+ RtlDeNormalizeProcessParams
+ RtlDecodePointer=RtlEncodePointer
+ RtlDecompressBuffer
+ RtlDecompressFragment
+ RtlDelete
+ RtlDeleteAce
+ RtlDeleteAtomFromAtomTable
+ RtlDeleteCriticalSection
+ RtlDeleteElementGenericTable
+ RtlDeleteElementGenericTableAvl
+ RtlDeleteNoSplay
+ RtlDeleteOwnersRanges
+ RtlDeleteRange
+ RtlDeleteRegistryValue
+ RtlDeleteResource
+ RtlDeleteSecurityObject
+ RtlDeleteTimer
+ RtlDeleteTimerQueue
+ RtlDeleteTimerQueueEx
+ RtlDeregisterWait
+ RtlDeregisterWaitEx
+ RtlDestroyAtomTable
+ RtlDestroyEnvironment
+ RtlDestroyHandleTable
+ RtlDestroyHeap
+ RtlDestroyProcessParameters
+ RtlDestroyQueryDebugBuffer
+ RtlDetermineDosPathNameType_U
+ RtlDllShutdownInProgress
+ RtlDoesFileExists_U
+ RtlDosPathNameToNtPathName_U
+ RtlDosPathNameToRelativeNtPathName_U
+ RtlDosSearchPath_U
+ RtlDowncaseUnicodeChar
+ RtlDowncaseUnicodeString
+ RtlDumpResource
+ RtlDuplicateUnicodeString
+ RtlEmptyAtomTable
+ RtlEncodePointer
+ RtlEnlargedIntegerMultiply
+ RtlEnlargedUnsignedDivide
+ RtlEnlargedUnsignedMultiply
+ RtlEnterCriticalSection
+ RtlEnumProcessHeaps
+ RtlEnumerateGenericTable
+ RtlEnumerateGenericTableAvl
+ RtlEnumerateGenericTableLikeADirectory
+ RtlEnumerateGenericTableWithoutSplaying
+ RtlEnumerateGenericTableWithoutSplayingAvl
+ RtlEqualComputerName
+ RtlEqualDomainName
+ RtlEqualLuid
+ RtlEqualPrefixSid
+ RtlEqualSid
+ RtlEqualString
+ RtlEqualUnicodeString
+ RtlEraseUnicodeString
+ RtlExitUserThread
+ RtlExpandEnvironmentStrings_U
+ RtlExtendHeap
+ RtlExtendedIntegerMultiply
+ RtlExtendedLargeIntegerDivide
+ RtlExtendedMagicDivide
+ RtlFillMemory
+ RtlFillMemoryUlong
+ RtlFindClearBits
+ RtlFindClearBitsAndSet
+ RtlFindClearRuns
+ RtlFindLastBackwardRunClear
+ RtlFindLeastSignificantBit
+ RtlFindLongestRunClear
+ RtlFindLongestRunSet
+ RtlFindMessage
+ RtlFindMostSignificantBit
+ RtlFindNextForwardRunClear
+ RtlFindRange
+ RtlFindSetBits
+ RtlFindSetBitsAndClear
+ RtlFirstFreeAce
+ RtlFormatCurrentUserKeyPath
+ RtlFormatMessage
+ RtlFreeAnsiString
+ RtlFreeHandle
+ RtlFreeHeap
+ RtlFreeOemString
+ RtlFreeRangeList
+ RtlFreeSid
+ RtlFreeUnicodeString
+ RtlFreeUserThreadStack
+ RtlGUIDFromString
+ RtlGenerate8dot3Name
+ RtlGetAce
  ;RtlGetCallersAddress
- RtlGetCompressionWorkSpaceSize@12
- RtlGetControlSecurityDescriptor@12
- RtlGetCurrentDirectory_U@8
- RtlGetDaclSecurityDescriptor@16
- RtlGetElementGenericTable@8
- RtlGetElementGenericTableAvl@8
- RtlGetFirstRange@12
- RtlGetFullPathName_U@16
- RtlGetGroupSecurityDescriptor@12
- RtlGetLastNtStatus@0
- RtlGetLastWin32Error@0
- RtlGetLongestNtPathLength@0
- RtlGetNextRange@12
- RtlGetNtGlobalFlags@0
- RtlGetNtProductType@4
- RtlGetNtVersionNumbers@12
- RtlGetOwnerSecurityDescriptor@12
- RtlGetProcessHeaps@8
- RtlGetSaclSecurityDescriptor@16
- RtlGetSecurityDescriptorRMControl@8
- RtlGetSetBootStatusData@24
- RtlGetUserInfoHeap@20
- RtlGetVersion@4
- RtlHashUnicodeString@16
- RtlIdentifierAuthoritySid@4
- RtlImageDirectoryEntryToData@16
- RtlImageNtHeader@4
- RtlImageRvaToSection@12
- RtlImageRvaToVa@16
- RtlImpersonateSelf@4
- RtlInitAnsiString@8
- RtlInitCodePageTable@8
- RtlInitNlsTables@16
- RtlInitString@8
- RtlInitUnicodeString@8
- RtlInitUnicodeStringEx@8
+ RtlGetCompressionWorkSpaceSize
+ RtlGetControlSecurityDescriptor
+ RtlGetCurrentDirectory_U
+ RtlGetDaclSecurityDescriptor
+ RtlGetElementGenericTable
+ RtlGetElementGenericTableAvl
+ RtlGetFirstRange
+ RtlGetFullPathName_U
+ RtlGetGroupSecurityDescriptor
+ RtlGetLastNtStatus
+ RtlGetLastWin32Error
+ RtlGetLongestNtPathLength
+ RtlGetNextRange
+ RtlGetNtGlobalFlags
+ RtlGetNtProductType
+ RtlGetNtVersionNumbers
+ RtlGetOwnerSecurityDescriptor
+ RtlGetProcessHeaps
+ RtlGetSaclSecurityDescriptor
+ RtlGetSecurityDescriptorRMControl
+ RtlGetSetBootStatusData
+ RtlGetUserInfoHeap
+ RtlGetVersion
+ RtlHashUnicodeString
+ RtlIdentifierAuthoritySid
+ RtlImageDirectoryEntryToData
+ RtlImageNtHeader
+ RtlImageRvaToSection
+ RtlImageRvaToVa
+ RtlImpersonateSelf
+ RtlInitAnsiString
+ RtlInitCodePageTable
+ RtlInitNlsTables
+ RtlInitString
+ RtlInitUnicodeString
+ RtlInitUnicodeStringEx
  ;RtlInitializeAtomPackage
- RtlInitializeBitMap@12
- RtlInitializeConditionVariable@4
- RtlInitializeContext@20
- RtlInitializeCriticalSection@4
- RtlInitializeCriticalSectionAndSpinCount@8
- RtlInitializeGenericTable@20
- RtlInitializeGenericTableAvl@20
- RtlInitializeHandleTable@12
- RtlInitializeRangeList@4
- RtlInitializeResource@4
+ RtlInitializeBitMap
+ RtlInitializeConditionVariable
+ RtlInitializeContext
+ RtlInitializeCriticalSection
+ RtlInitializeCriticalSectionAndSpinCount
+ RtlInitializeGenericTable
+ RtlInitializeGenericTableAvl
+ RtlInitializeHandleTable
+ RtlInitializeRangeList
+ RtlInitializeResource
  ;RtlInitializeRXact
- RtlInitializeSid@12
- RtlInitializeSRWLock@4
- RtlInsertElementGenericTable@16
- RtlInsertElementGenericTableAvl@16
- RtlInsertElementGenericTableFull@24
- RtlInsertElementGenericTableFullAvl@24
- RtlInt64ToUnicodeString@16
- RtlIntegerToChar@16
- RtlIntegerToUnicodeString@12
- RtlInvertRangeList@8
- RtlIpv4AddressToStringA@8
- RtlIpv4AddressToStringExA@16
- RtlIpv4AddressToStringExW@16
- RtlIpv4AddressToStringW@8
- RtlIpv4StringToAddressA@16
- RtlIpv4StringToAddressExA@16
- RtlIpv4StringToAddressExW@16
- RtlIpv4StringToAddressW@16
- RtlIpv6AddressToStringA@8
- RtlIpv6AddressToStringExA@20
- RtlIpv6AddressToStringExW@20
- RtlIpv6AddressToStringW@8
- RtlIpv6StringToAddressA@12
- RtlIpv6StringToAddressExA@16
- RtlIpv6StringToAddressExW@16
- RtlIpv6StringToAddressW@12
- RtlIsDosDeviceName_U@4
- RtlIsGenericTableEmpty@4
- RtlIsGenericTableEmptyAvl@4
- RtlIsNameLegalDOS8Dot3@12
- RtlIsRangeAvailable@40
- RtlIsTextUnicode@12
- RtlIsValidHandle@8
- RtlIsValidIndexHandle@12
- RtlLargeIntegerAdd@16
- RtlLargeIntegerArithmeticShift@12
- RtlLargeIntegerDivide@20
- RtlLargeIntegerNegate@8
- RtlLargeIntegerShiftLeft@12
- RtlLargeIntegerShiftRight@12
- RtlLargeIntegerSubtract@16
- RtlLargeIntegerToChar@16
- RtlLeaveCriticalSection@4
- RtlLengthRequiredSid@4
- RtlLengthSecurityDescriptor@4
- RtlLengthSid@4
- RtlLocalTimeToSystemTime@8
- RtlLockBootStatusData@4
- RtlLockHeap@4
- RtlLookupAtomInAtomTable@12
- RtlLookupElementGenericTable@8
- RtlLookupElementGenericTableAvl@8
- RtlLookupElementGenericTableFull@16
- RtlLookupElementGenericTableFullAvl@16
- RtlMakeSelfRelativeSD@12
- RtlMapGenericMask@8
- RtlMergeRangeLists@16
- RtlMoveMemory@12
- RtlMultiByteToUnicodeN@20
- RtlMultiByteToUnicodeSize@12
+ RtlInitializeSid
+ RtlInitializeSRWLock
+ RtlInsertElementGenericTable
+ RtlInsertElementGenericTableAvl
+ RtlInsertElementGenericTableFull
+ RtlInsertElementGenericTableFullAvl
+ RtlInt64ToUnicodeString
+ RtlIntegerToChar
+ RtlIntegerToUnicodeString
+ RtlInvertRangeList
+ RtlIpv4AddressToStringA
+ RtlIpv4AddressToStringExA
+ RtlIpv4AddressToStringExW
+ RtlIpv4AddressToStringW
+ RtlIpv4StringToAddressA
+ RtlIpv4StringToAddressExA
+ RtlIpv4StringToAddressExW
+ RtlIpv4StringToAddressW
+ RtlIpv6AddressToStringA
+ RtlIpv6AddressToStringExA
+ RtlIpv6AddressToStringExW
+ RtlIpv6AddressToStringW
+ RtlIpv6StringToAddressA
+ RtlIpv6StringToAddressExA
+ RtlIpv6StringToAddressExW
+ RtlIpv6StringToAddressW
+ RtlIsDosDeviceName_U
+ RtlIsGenericTableEmpty
+ RtlIsGenericTableEmptyAvl
+ RtlIsNameLegalDOS8Dot3
+ RtlIsRangeAvailable
+ RtlIsTextUnicode
+ RtlIsValidHandle
+ RtlIsValidIndexHandle
+ RtlLargeIntegerAdd
+ RtlLargeIntegerArithmeticShift
+ RtlLargeIntegerDivide
+ RtlLargeIntegerNegate
+ RtlLargeIntegerShiftLeft
+ RtlLargeIntegerShiftRight
+ RtlLargeIntegerSubtract
+ RtlLargeIntegerToChar
+ RtlLeaveCriticalSection
+ RtlLengthRequiredSid
+ RtlLengthSecurityDescriptor
+ RtlLengthSid
+ RtlLocalTimeToSystemTime
+ RtlLockBootStatusData
+ RtlLockHeap
+ RtlLookupAtomInAtomTable
+ RtlLookupElementGenericTable
+ RtlLookupElementGenericTableAvl
+ RtlLookupElementGenericTableFull
+ RtlLookupElementGenericTableFullAvl
+ RtlMakeSelfRelativeSD
+ RtlMapGenericMask
+ RtlMergeRangeLists
+ RtlMoveMemory
+ RtlMultiByteToUnicodeN
+ RtlMultiByteToUnicodeSize
  ;RtlNewInstanceSecurityObject
  ;RtlNewSecurityGrantedAccess
- RtlNewSecurityObject@24
- RtlNormalizeProcessParams@4
- RtlNtPathNameToDosPathName@16
- RtlNtStatusToDosError@4
- RtlNumberGenericTableElements@4
- RtlNumberGenericTableElementsAvl@4
- RtlNumberOfClearBits@4
- RtlNumberOfSetBits@4
- RtlOemStringToUnicodeSize@4=RtlxOemStringToUnicodeSize@4
- RtlOemStringToUnicodeString@12
- RtlOemToUnicodeN@20
- RtlOpenCurrentUser@8
- RtlPcToFileHeader@8
- RtlPinAtomInAtomTable@8
- RtlPrefixString@12
- RtlPrefixUnicodeString@12
+ RtlNewSecurityObject
+ RtlNormalizeProcessParams
+ RtlNtPathNameToDosPathName
+ RtlNtStatusToDosError
+ RtlNumberGenericTableElements
+ RtlNumberGenericTableElementsAvl
+ RtlNumberOfClearBits
+ RtlNumberOfSetBits
+ RtlOemStringToUnicodeSize=RtlxOemStringToUnicodeSize
+ RtlOemStringToUnicodeString
+ RtlOemToUnicodeN
+ RtlOpenCurrentUser
+ RtlPcToFileHeader
+ RtlPinAtomInAtomTable
+ RtlPrefixString
+ RtlPrefixUnicodeString
  ;RtlProtectHeap
- RtlQueryAtomInAtomTable@24
- RtlQueryEnvironmentVariable_U@12
- RtlQueryInformationAcl@16
+ RtlQueryAtomInAtomTable
+ RtlQueryEnvironmentVariable_U
+ RtlQueryInformationAcl
  ;RtlQueryProcessBackTraceInformation
- RtlQueryProcessDebugInformation@12
+ RtlQueryProcessDebugInformation
  ;RtlQueryProcessHeapInformation
  ;RtlQueryProcessLockInformation
- RtlQueryRegistryValues@20
- RtlQuerySecurityObject@20
- RtlQueryTagHeap@20
- RtlQueryTimeZoneInformation@4
- RtlQueueWorkItem@12
- RtlRaiseException@4
- RtlRaiseStatus@4
- RtlRandom@4
- RtlRandomEx=RtlRandom@4
- RtlReAllocateHeap@16
- RtlRealPredecessor@4
- RtlRealSuccessor@4
- RtlRegisterWait@24
- RtlReleasePebLock@0
- RtlReleaseRelativeName@4
- RtlReleaseResource@4
- RtlReleaseSRWLockExclusive@4
- RtlReleaseSRWLockShared@4
+ RtlQueryRegistryValues
+ RtlQuerySecurityObject
+ RtlQueryTagHeap
+ RtlQueryTimeZoneInformation
+ RtlQueueWorkItem
+ RtlRaiseException
+ RtlRaiseStatus
+ RtlRandom
+ RtlRandomEx=RtlRandom
+ RtlReAllocateHeap
+ RtlRealPredecessor
+ RtlRealSuccessor
+ RtlRegisterWait
+ RtlReleasePebLock
+ RtlReleaseRelativeName
+ RtlReleaseResource
+ RtlReleaseSRWLockExclusive
+ RtlReleaseSRWLockShared
  ;RtlRemoteCall
- RtlRemoveVectoredExceptionHandler@4
- RtlResetRtlTranslations@4
- RtlRestoreLastWin32Error@4=RtlSetLastWin32Error@4
- RtlRunDecodeUnicodeString@8
- RtlRunEncodeUnicodeString@8
- RtlSecondsSince1970ToTime@8
- RtlSecondsSince1980ToTime@8
- RtlSelfRelativeToAbsoluteSD2@8
- RtlSelfRelativeToAbsoluteSD@44
- RtlSetAllBits@4
- RtlSetAttributesSecurityDescriptor@12
- RtlSetBits@12
- RtlSetControlSecurityDescriptor@12
- RtlSetCriticalSectionSpinCount@8
- RtlSetCurrentDirectory_U@4
- RtlSetCurrentEnvironment@8
- RtlSetDaclSecurityDescriptor@16
- RtlSetEnvironmentVariable@12
- RtlSetGroupSecurityDescriptor@12
- RtlSetInformationAcl@16
- RtlSetLastWin32Error@4
- RtlSetLastWin32ErrorAndNtStatusFromNtStatus@4
- RtlSetOwnerSecurityDescriptor@12
- RtlSetProcessIsCritical@12
- RtlSetSaclSecurityDescriptor@16
- RtlSetSecurityDescriptorRMControl@8
- RtlSetSecurityObject@20
- RtlSetTimeZoneInformation@4
+ RtlRemoveVectoredExceptionHandler
+ RtlResetRtlTranslations
+ RtlRestoreLastWin32Error=RtlSetLastWin32Error
+ RtlRunDecodeUnicodeString
+ RtlRunEncodeUnicodeString
+ RtlSecondsSince1970ToTime
+ RtlSecondsSince1980ToTime
+ RtlSelfRelativeToAbsoluteSD
+ RtlSelfRelativeToAbsoluteSD2
+ RtlSetAllBits
+ RtlSetAttributesSecurityDescriptor
+ RtlSetBits
+ RtlSetControlSecurityDescriptor
+ RtlSetCriticalSectionSpinCount
+ RtlSetCurrentDirectory_U
+ RtlSetCurrentEnvironment
+ RtlSetDaclSecurityDescriptor
+ RtlSetEnvironmentVariable
+ RtlSetGroupSecurityDescriptor
+ RtlSetInformationAcl
+ RtlSetLastWin32Error
+ RtlSetLastWin32ErrorAndNtStatusFromNtStatus
+ RtlSetOwnerSecurityDescriptor
+ RtlSetProcessIsCritical
+ RtlSetSaclSecurityDescriptor
+ RtlSetSecurityDescriptorRMControl
+ RtlSetSecurityObject
+ RtlSetTimeZoneInformation
  ;RtlSetUnicodeCallouts
- RtlSetUserFlagsHeap@16
- RtlSetUserValueHeap@16
- RtlSizeHeap@12
- RtlSleepConditionVariableCS@12
- RtlSleepConditionVariableSRW@16
- RtlSplay@4
+ RtlSetUserFlagsHeap
+ RtlSetUserValueHeap
+ RtlSizeHeap
+ RtlSleepConditionVariableCS
+ RtlSleepConditionVariableSRW
+ RtlSplay
  ;RtlStartRXact
- RtlStringFromGUID@8
- RtlSubAuthorityCountSid@4
- RtlSubAuthoritySid@8
- RtlSubtreePredecessor@4
- RtlSubtreeSuccessor@4
- RtlSystemTimeToLocalTime@8
- RtlTimeFieldsToTime@8
- RtlTimeToElapsedTimeFields@8
- RtlTimeToSecondsSince1970@8
- RtlTimeToSecondsSince1980@8
- RtlTimeToTimeFields@8
- RtlTryEnterCriticalSection@4
- @RtlUlongByteSwap@4
- @RtlUlonglongByteSwap@8
- RtlUnhandledExceptionFilter@4
- RtlUnicodeStringToAnsiSize@4=RtlxUnicodeStringToAnsiSize@4
- RtlUnicodeStringToAnsiString@12
- RtlUnicodeStringToCountedOemString@12
- RtlUnicodeStringToInteger@12
- RtlUnicodeStringToOemSize@4=RtlxUnicodeStringToOemSize@4
- RtlUnicodeStringToOemString@12
- RtlUnicodeToCustomCPN@24
- RtlUnicodeToMultiByteN@20
- RtlUnicodeToMultiByteSize@12
- RtlUnicodeToOemN@20
- RtlUniform@4
- RtlUnlockBootStatusData@4
- RtlUnlockHeap@4
- RtlUnwind@16
- RtlUpcaseUnicodeChar@4
- RtlUpcaseUnicodeString@12
- RtlUpcaseUnicodeStringToAnsiString@12
- RtlUpcaseUnicodeStringToCountedOemString@12
- RtlUpcaseUnicodeStringToOemString@12
- RtlUpcaseUnicodeToCustomCPN@24
- RtlUpcaseUnicodeToMultiByteN@20
- RtlUpcaseUnicodeToOemN@20
- RtlUpdateTimer@16
- RtlUpperChar@4
- RtlUpperString@8
- RtlUsageHeap@12
- @RtlUshortByteSwap@4
- RtlValidAcl@4
- RtlValidRelativeSecurityDescriptor@12
- RtlValidSecurityDescriptor@4
- RtlValidSid@4
- RtlValidateHeap@12
- RtlValidateProcessHeaps@0
- RtlValidateUnicodeString@8
- RtlVerifyVersionInfo@16
+ RtlStringFromGUID
+ RtlSubAuthorityCountSid
+ RtlSubAuthoritySid
+ RtlSubtreePredecessor
+ RtlSubtreeSuccessor
+ RtlSystemTimeToLocalTime
+ RtlTimeFieldsToTime
+ RtlTimeToElapsedTimeFields
+ RtlTimeToSecondsSince1970
+ RtlTimeToSecondsSince1980
+ RtlTimeToTimeFields
+ RtlTryEnterCriticalSection
+ @RtlUlongByteSwap
+ @RtlUlonglongByteSwap
+ RtlUnhandledExceptionFilter
+ RtlUnicodeStringToAnsiSize=RtlxUnicodeStringToAnsiSize
+ RtlUnicodeStringToAnsiString
+ RtlUnicodeStringToCountedOemString
+ RtlUnicodeStringToInteger
+ RtlUnicodeStringToOemSize=RtlxUnicodeStringToOemSize
+ RtlUnicodeStringToOemString
+ RtlUnicodeToCustomCPN
+ RtlUnicodeToMultiByteN
+ RtlUnicodeToMultiByteSize
+ RtlUnicodeToOemN
+ RtlUniform
+ RtlUnlockBootStatusData
+ RtlUnlockHeap
+ RtlUnwind
+ RtlUpcaseUnicodeChar
+ RtlUpcaseUnicodeString
+ RtlUpcaseUnicodeStringToAnsiString
+ RtlUpcaseUnicodeStringToCountedOemString
+ RtlUpcaseUnicodeStringToOemString
+ RtlUpcaseUnicodeToCustomCPN
+ RtlUpcaseUnicodeToMultiByteN
+ RtlUpcaseUnicodeToOemN
+ RtlUpdateTimer
+ RtlUpperChar
+ RtlUpperString
+ RtlUsageHeap
+ @RtlUshortByteSwap
+ RtlValidAcl
+ RtlValidRelativeSecurityDescriptor
+ RtlValidSecurityDescriptor
+ RtlValidSid
+ RtlValidateHeap
+ RtlValidateProcessHeaps
+ RtlValidateUnicodeString
+ RtlVerifyVersionInfo
  ;RtlWalkHeap
- RtlWakeAllConditionVariable@4
- RtlWakeConditionVariable@4
- RtlWriteRegistryValue@24
+ RtlWakeAllConditionVariable
+ RtlWakeConditionVariable
+ RtlWriteRegistryValue
  ;RtlZeroHeap
- RtlZeroMemory@8
- RtlpEnsureBufferSize@12
- RtlpNtCreateKey@24
- RtlpNtEnumerateSubKey@16
- RtlpNtMakeTemporaryKey@4
- RtlpNtOpenKey@16
- RtlpNtQueryValueKey@20
- RtlpNtSetValueKey@16
- RtlpUnWaitCriticalSection@4
- RtlpWaitForCriticalSection@4
- RtlxAnsiStringToUnicodeSize@4
- RtlxOemStringToUnicodeSize@4
- RtlxUnicodeStringToAnsiSize@4
- RtlxUnicodeStringToOemSize@4
+ RtlZeroMemory
+ RtlpEnsureBufferSize
+ RtlpNtCreateKey
+ RtlpNtEnumerateSubKey
+ RtlpNtMakeTemporaryKey
+ RtlpNtOpenKey
+ RtlpNtQueryValueKey
+ RtlpNtSetValueKey
+ RtlpUnWaitCriticalSection
+ RtlpWaitForCriticalSection
+ RtlxAnsiStringToUnicodeSize
+ RtlxOemStringToUnicodeSize
+ RtlxUnicodeStringToAnsiSize
+ RtlxUnicodeStringToOemSize
  ;SaveEm87Context
- VerSetConditionMask@16
- ZwAcceptConnectPort@24
- ZwAccessCheck@32
- ZwAccessCheckAndAuditAlarm@44
- ZwAddAtom@12
- ZwAdjustGroupsToken@24
- ZwAdjustPrivilegesToken@24
- ZwAlertResumeThread@8
- ZwAlertThread@4
- ZwAllocateLocallyUniqueId@4
- ZwAllocateUuids@16
- ZwAllocateVirtualMemory@24
- ZwAssignProcessToJobObject@8
- ZwCallbackReturn@12
- ZwCancelIoFile@8
- ZwCancelTimer@8
- ZwClearEvent@4
- ZwClose@4
- ZwCloseObjectAuditAlarm@12
- ZwCompareTokens@12
- ZwCompleteConnectPort@4
- ZwConnectPort@32
- ZwContinue@8
- ZwCreateDebugObject@16
- ZwCreateDirectoryObject@12
- ZwCreateEvent@20
- ZwCreateEventPair@12
- ZwCreateFile@44
- ZwCreateIoCompletion@16
- ZwCreateJobObject@12
- ZwCreateKey@28
- ZwCreateMailslotFile@32
- ZwCreateMutant@16
- ZwCreateNamedPipeFile@56
- ZwCreatePagingFile@16
- ZwCreatePort@20
- ZwCreateProcess@32
- ZwCreateProfile@36
- ZwCreateSection@28
- ZwCreateSemaphore@20
- ZwCreateSymbolicLinkObject@16
- ZwCreateThread@32
- ZwCreateTimer@16
- ZwCreateToken@52
- ZwCreateWaitablePort@20
- ZwDebugContinue@12
- ZwDelayExecution@8
- ZwDeleteAtom@4
- ZwDeleteFile@4
- ZwDeleteKey@4
- ZwDeleteObjectAuditAlarm@12
- ZwDeleteValueKey@8
- ZwDeviceIoControlFile@40
- ZwDisplayString@4
- ZwDuplicateObject@28
- ZwDuplicateToken@24
- ZwEnumerateKey@24
- ZwEnumerateValueKey@24
- ZwExtendSection@8
- ZwFindAtom@12
- ZwFlushBuffersFile@8
- ZwFlushInstructionCache@12
- ZwFlushKey@4
- ZwFlushVirtualMemory@16
- ZwFlushWriteBuffer@0
- ZwFreeVirtualMemory@16
- ZwFsControlFile@40
- ZwGetContextThread@8
- ZwGetPlugPlayEvent@16
- ZwImpersonateAnonymousToken@4
- ZwImpersonateClientOfPort@8
- ZwImpersonateThread@12
- ZwInitializeRegistry@4
- ZwIsProcessInJob@8
- ZwListenPort@8
- ZwLoadDriver@4
- ZwLoadKey@8
- ZwLoadKey2@12
- ZwLockFile@40
- ZwLockVirtualMemory@16
- ZwMakeTemporaryObject@4
- ZwMapViewOfSection@40
- ZwNotifyChangeDirectoryFile@36
- ZwNotifyChangeKey@40
- ZwOpenDirectoryObject@12
- ZwOpenEvent@12
- ZwOpenEventPair@12
- ZwOpenFile@24
- ZwOpenIoCompletion@12
- ZwOpenJobObject@12
- ZwOpenKey@12
- ZwOpenMutant@12
- ZwOpenObjectAuditAlarm@48
- ZwOpenProcess@16
- ZwOpenProcessToken@12
- ZwOpenSection@12
- ZwOpenSemaphore@12
- ZwOpenSymbolicLinkObject@12
- ZwOpenThread@16
- ZwOpenThreadToken@16
- ZwOpenTimer@12
- ZwPlugPlayControl@12
- ZwPowerInformation@20
- ZwPrivilegeCheck@12
- ZwPrivilegedServiceAuditAlarm@20
- ZwPrivilegeObjectAuditAlarm@24
- ZwProtectVirtualMemory@20
- ZwPulseEvent@8
- ZwQueryAttributesFile@8
- ZwQueryDebugFilterState@8
- ZwQueryDefaultLocale@8
- ZwQueryDefaultUILanguage@4
- ZwQueryDirectoryFile@44
- ZwQueryDirectoryObject@28
- ZwQueryEaFile@36
- ZwQueryEvent@20
- ZwQueryFullAttributesFile@8
- ZwQueryInformationAtom@20
- ZwQueryInformationFile@20
- ZwQueryInformationJobObject@20
- ZwQueryInformationPort@20
- ZwQueryInformationProcess@20
- ZwQueryInformationThread@20
- ZwQueryInformationToken@20
- ZwQueryInstallUILanguage@4
- ZwQueryIntervalProfile@8
- ZwQueryIoCompletion@20
- ZwQueryKey@20
- ZwQueryMultipleValueKey@24
- ZwQueryMutant@20
- ZwQueryObject@20
- ZwQueryPerformanceCounter@8
- ZwQuerySection@20
- ZwQuerySecurityObject@20
- ZwQuerySemaphore@20
- ZwQuerySymbolicLinkObject@12
- ZwQuerySystemEnvironmentValue@16
- ZwQuerySystemInformation@16
- ZwQuerySystemTime@4
- ZwQueryTimer@20
- ZwQueryTimerResolution@12
- ZwQueryValueKey@24
- ZwQueryVirtualMemory@24
- ZwQueryVolumeInformationFile@20
- ZwQueueApcThread@20
- ZwRaiseException@12
- ZwRaiseHardError@24
- ZwReadFile@36
- ZwReadFileScatter@36
- ZwReadRequestData@24
- ZwReadVirtualMemory@20
- ZwRegisterThreadTerminatePort@4
- ZwReleaseMutant@8
- ZwReleaseSemaphore@12
- ZwRemoveIoCompletion@20
- ZwReplaceKey@12
- ZwReplyPort@8
- ZwReplyWaitReceivePort@16
- ZwReplyWaitReceivePortEx@20
- ZwReplyWaitReplyPort@8
- ZwRequestPort@8
- ZwRequestWaitReplyPort@12
- ZwResetEvent@8
- ZwRestoreKey@12
- ZwResumeProcess@4
- ZwResumeThread@8
- ZwSaveKey@8
- ZwSecureConnectPort@36
- ZwSetContextThread@8
- ZwSetDebugFilterState@12
- ZwSetDefaultHardErrorPort@4
- ZwSetDefaultLocale@8
- ZwSetDefaultUILanguage@4
- ZwSetEaFile@16
- ZwSetEvent@8
- ZwSetHighEventPair@4
- ZwSetHighWaitLowEventPair@4
- ZwSetInformationDebugObject@20
- ZwSetInformationFile@20
- ZwSetInformationJobObject@16
- ZwSetInformationKey@16
- ZwSetInformationObject@16
- ZwSetInformationProcess@16
- ZwSetInformationThread@16
- ZwSetInformationToken@16
- ZwSetIntervalProfile@8
- ZwSetIoCompletion@20
- ZwSetLdtEntries@24
- ZwSetLowEventPair@4
- ZwSetLowWaitHighEventPair@4
- ZwSetSecurityObject@12
- ZwSetSystemEnvironmentValue@8
- ZwSetSystemInformation@12
- ZwSetSystemPowerState@12
- ZwSetSystemTime@8
- ZwSetTimer@28
- ZwSetTimerResolution@12
- ZwSetUuidSeed@4
- ZwSetValueKey@24
- ZwSetVolumeInformationFile@20
- ZwShutdownSystem@4
- ZwSignalAndWaitForSingleObject@16
- ZwStartProfile@4
- ZwStopProfile@4
- ZwSuspendProcess@4
- ZwSuspendThread@8
- ZwSystemDebugControl@24
- ZwTerminateJobObject@8
- ZwTerminateProcess@8
- ZwTerminateThread@8
- ZwTestAlert@0
- ZwUnloadDriver@4
- ZwUnloadKey@4
- ZwUnlockFile@20
- ZwUnlockVirtualMemory@16
- ZwUnmapViewOfSection@8
- ZwVdmControl@8
- ZwWaitForDebugEvent@16
- ZwWaitForMultipleObjects@20
- ZwWaitForSingleObject@12
- ZwWaitHighEventPair@4
- ZwWaitLowEventPair@4
- ZwWriteFile@36
- ZwWriteFileGather@36
- ZwWriteRequestData@24
- ZwWriteVirtualMemory@20
- ZwYieldExecution@0
+ VerSetConditionMask
+ ZwAcceptConnectPort
+ ZwAccessCheck
+ ZwAccessCheckAndAuditAlarm
+ ZwAddAtom
+ ZwAdjustGroupsToken
+ ZwAdjustPrivilegesToken
+ ZwAlertResumeThread
+ ZwAlertThread
+ ZwAllocateLocallyUniqueId
+ ZwAllocateUuids
+ ZwAllocateVirtualMemory
+ ZwAssignProcessToJobObject
+ ZwCallbackReturn
+ ZwCancelIoFile
+ ZwCancelTimer
+ ZwClearEvent
+ ZwClose
+ ZwCloseObjectAuditAlarm
+ ZwCompareTokens
+ ZwCompleteConnectPort
+ ZwConnectPort
+ ZwContinue
+ ZwCreateDebugObject
+ ZwCreateDirectoryObject
+ ZwCreateEvent
+ ZwCreateEventPair
+ ZwCreateFile
+ ZwCreateIoCompletion
+ ZwCreateJobObject
+ ZwCreateKey
+ ZwCreateMailslotFile
+ ZwCreateMutant
+ ZwCreateNamedPipeFile
+ ZwCreatePagingFile
+ ZwCreatePort
+ ZwCreateProcess
+ ZwCreateProfile
+ ZwCreateSection
+ ZwCreateSemaphore
+ ZwCreateSymbolicLinkObject
+ ZwCreateThread
+ ZwCreateTimer
+ ZwCreateToken
+ ZwCreateWaitablePort
+ ZwDebugContinue
+ ZwDelayExecution
+ ZwDeleteAtom
+ ZwDeleteFile
+ ZwDeleteKey
+ ZwDeleteObjectAuditAlarm
+ ZwDeleteValueKey
+ ZwDeviceIoControlFile
+ ZwDisplayString
+ ZwDuplicateObject
+ ZwDuplicateToken
+ ZwEnumerateKey
+ ZwEnumerateValueKey
+ ZwExtendSection
+ ZwFindAtom
+ ZwFlushBuffersFile
+ ZwFlushInstructionCache
+ ZwFlushKey
+ ZwFlushVirtualMemory
+ ZwFlushWriteBuffer
+ ZwFreeVirtualMemory
+ ZwFsControlFile
+ ZwGetContextThread
+ ZwGetPlugPlayEvent
+ ZwImpersonateAnonymousToken
+ ZwImpersonateClientOfPort
+ ZwImpersonateThread
+ ZwInitializeRegistry
+ ZwIsProcessInJob
+ ZwListenPort
+ ZwLoadDriver
+ ZwLoadKey
+ ZwLoadKey2
+ ZwLockFile
+ ZwLockVirtualMemory
+ ZwMakeTemporaryObject
+ ZwMapViewOfSection
+ ZwNotifyChangeDirectoryFile
+ ZwNotifyChangeKey
+ ZwOpenDirectoryObject
+ ZwOpenEvent
+ ZwOpenEventPair
+ ZwOpenFile
+ ZwOpenIoCompletion
+ ZwOpenJobObject
+ ZwOpenKey
+ ZwOpenMutant
+ ZwOpenObjectAuditAlarm
+ ZwOpenProcess
+ ZwOpenProcessToken
+ ZwOpenSection
+ ZwOpenSemaphore
+ ZwOpenSymbolicLinkObject
+ ZwOpenThread
+ ZwOpenThreadToken
+ ZwOpenTimer
+ ZwPlugPlayControl
+ ZwPowerInformation
+ ZwPrivilegeCheck
+ ZwPrivilegedServiceAuditAlarm
+ ZwPrivilegeObjectAuditAlarm
+ ZwProtectVirtualMemory
+ ZwPulseEvent
+ ZwQueryAttributesFile
+ ZwQueryDebugFilterState
+ ZwQueryDefaultLocale
+ ZwQueryDefaultUILanguage
+ ZwQueryDirectoryFile
+ ZwQueryDirectoryObject
+ ZwQueryEaFile
+ ZwQueryEvent
+ ZwQueryFullAttributesFile
+ ZwQueryInformationAtom
+ ZwQueryInformationFile
+ ZwQueryInformationJobObject
+ ZwQueryInformationPort
+ ZwQueryInformationProcess
+ ZwQueryInformationThread
+ ZwQueryInformationToken
+ ZwQueryInstallUILanguage
+ ZwQueryIntervalProfile
+ ZwQueryIoCompletion
+ ZwQueryKey
+ ZwQueryMultipleValueKey
+ ZwQueryMutant
+ ZwQueryObject
+ ZwQueryPerformanceCounter
+ ZwQuerySection
+ ZwQuerySecurityObject
+ ZwQuerySemaphore
+ ZwQuerySymbolicLinkObject
+ ZwQuerySystemEnvironmentValue
+ ZwQuerySystemInformation
+ ZwQuerySystemTime
+ ZwQueryTimer
+ ZwQueryTimerResolution
+ ZwQueryValueKey
+ ZwQueryVirtualMemory
+ ZwQueryVolumeInformationFile
+ ZwQueueApcThread
+ ZwRaiseException
+ ZwRaiseHardError
+ ZwReadFile
+ ZwReadFileScatter
+ ZwReadRequestData
+ ZwReadVirtualMemory
+ ZwRegisterThreadTerminatePort
+ ZwReleaseMutant
+ ZwReleaseSemaphore
+ ZwRemoveIoCompletion
+ ZwReplaceKey
+ ZwReplyPort
+ ZwReplyWaitReceivePort
+ ZwReplyWaitReceivePortEx
+ ZwReplyWaitReplyPort
+ ZwRequestPort
+ ZwRequestWaitReplyPort
+ ZwResetEvent
+ ZwRestoreKey
+ ZwResumeProcess
+ ZwResumeThread
+ ZwSaveKey
+ ZwSecureConnectPort
+ ZwSetContextThread
+ ZwSetDebugFilterState
+ ZwSetDefaultHardErrorPort
+ ZwSetDefaultLocale
+ ZwSetDefaultUILanguage
+ ZwSetEaFile
+ ZwSetEvent
+ ZwSetHighEventPair
+ ZwSetHighWaitLowEventPair
+ ZwSetInformationDebugObject
+ ZwSetInformationFile
+ ZwSetInformationJobObject
+ ZwSetInformationKey
+ ZwSetInformationObject
+ ZwSetInformationProcess
+ ZwSetInformationThread
+ ZwSetInformationToken
+ ZwSetIntervalProfile
+ ZwSetIoCompletion
+ ZwSetLdtEntries
+ ZwSetLowEventPair
+ ZwSetLowWaitHighEventPair
+ ZwSetSecurityObject
+ ZwSetSystemEnvironmentValue
+ ZwSetSystemInformation
+ ZwSetSystemPowerState
+ ZwSetSystemTime
+ ZwSetTimer
+ ZwSetTimerResolution
+ ZwSetUuidSeed
+ ZwSetValueKey
+ ZwSetVolumeInformationFile
+ ZwShutdownSystem
+ ZwSignalAndWaitForSingleObject
+ ZwStartProfile
+ ZwStopProfile
+ ZwSuspendProcess
+ ZwSuspendThread
+ ZwSystemDebugControl
+ ZwTerminateJobObject
+ ZwTerminateProcess
+ ZwTerminateThread
+ ZwTestAlert
+ ZwUnloadDriver
+ ZwUnloadKey
+ ZwUnlockFile
+ ZwUnlockVirtualMemory
+ ZwUnmapViewOfSection
+ ZwVdmControl
+ ZwWaitForDebugEvent
+ ZwWaitForMultipleObjects
+ ZwWaitForSingleObject
+ ZwWaitHighEventPair
+ ZwWaitLowEventPair
+ ZwWriteFile
+ ZwWriteFileGather
+ ZwWriteRequestData
+ ZwWriteVirtualMemory
+ ZwYieldExecution
  __isascii
  __iscsym
  __iscsymf
@@@ -1,6 -1,6 +1,6 @@@
  <module name="advapi32" type="win32dll" baseaddress="${BASEADDRESS_ADVAPI32}" installbase="system32" installname="advapi32.dll" unicode="yes">
  
 -      <importlibrary definition="advapi32.def" />
 +      <importlibrary definition="advapi32.spec.def" />
        <include base="advapi32">.</include>
        <include base="scm_client">.</include>
        <include base="lsa_client">.</include>
        <library>scm_client</library>
        <library>lsa_client</library>
        <library>eventlog_client</library>
-       <library>ntdll</library>
        <library>rpcrt4</library>
        <library>wine</library>
        <library>kernel32</library>
        <library>pseh</library>
+       <library>ntdll</library>
        <pch>advapi32.h</pch>
 +      <file>advapi32.spec</file>
        <directory name="crypt">
                        <file>crypt.c</file>
                        <file>crypt_arc4.c</file>
diff --combined reactos/hal/hal/hal.c
@@@ -74,7 -74,7 +74,7 @@@ HalSetProfileInterval(IN ULONG_PTR Inte
      KEBUGCHECK(0);
      return Interval;
  }
 -
 +#if 0
  VOID
  FASTCALL
  ExAcquireFastMutex(
@@@ -101,7 -101,7 +101,7 @@@ ExTryToAcquireFastMutex
  
    return TRUE;
  }
 -
 +#endif
  
  VOID
  NTAPI
@@@ -466,7 -466,7 +466,7 @@@ HalReportResourceUsage(VOID
  VOID
  NTAPI
  HalRequestIpi(
 -  ULONG Unknown)
 +    KAFFINITY TargetSet)
  {
    UNIMPLEMENTED;
  }
@@@ -932,7 -932,7 +932,7 @@@ KfReleaseSpinLock
    UNIMPLEMENTED;
  }
  
 -
 +#if !defined(_M_AMD64)
  VOID
  NTAPI
  READ_PORT_BUFFER_UCHAR(
@@@ -1058,7 -1058,6 +1058,7 @@@ WRITE_PORT_USHORT
  {
    UNIMPLEMENTED;
  }
 +#endif
  
  KIRQL
  FASTCALL
@@@ -1084,4 -1083,23 +1084,23 @@@ KeReleaseQueuedSpinLock(IN PKLOCK_QUEUE
    UNIMPLEMENTED;
  }
  
+ VOID
+ HalSweepDcache(VOID)
+ {
+   UNIMPLEMENTED;
+ }
+ VOID
+ HalSweepIcache(VOID)
+ {
+     UNIMPLEMENTED;
+ }
+ ULONG
+ HalGetInterruptSource(VOID)
+ {
+     UNIMPLEMENTED;
+     return 0;
+ }
  /* EOF */
@@@ -4,24 -4,16 +4,16 @@@
  #pragma GCC system_header
  #endif
  
- /* translate GCC target defines to MS equivalents. Keep this synchronized
-    with windows.h. */
- #if defined(__i686__) && !defined(_M_IX86)
- #define _M_IX86 600
- #elif defined(__i586__) && !defined(_M_IX86)
- #define _M_IX86 500
- #elif defined(__i486__) && !defined(_M_IX86)
- #define _M_IX86 400
- #elif defined(__i386__) && !defined(_M_IX86)
- #define _M_IX86 300
+ #ifdef __GNUC__
+ #include <msvctarget.h>
  #endif
  #if defined(_M_IX86) && !defined(_X86_)
  #define _X86_
  #elif defined(_M_ALPHA) && !defined(_ALPHA_)
  #define _ALPHA_
- #elif defined(_M_ARM) && !defined(ARM)
- #define ARM
+ #elif defined(_M_ARM) && !defined(_ARM_)
+ #define _ARM_
  #elif defined(_M_PPC) && !defined(_PPC_)
  #define _PPC_
  #elif defined(_M_MRX000) && !defined(_MIPS_)
@@@ -100,6 -92,15 +92,6 @@@ extern "C" 
  #endif
  #endif
  
 -/* i386 context definitions */
 -#ifdef __i386__
 -
 -#define EXCEPTION_READ_FAULT    0
 -#define EXCEPTION_WRITE_FAULT   1
 -#define EXCEPTION_EXECUTE_FAULT 8
 -
 -#endif  /* __i386__ */
 -
  #ifndef VOID
  #define VOID void
  #endif
@@@ -510,6 -511,8 +502,6 @@@ typedef DWORD FLONG
  #define THREAD_DIRECT_IMPERSONATION   0x200
  #endif
  #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
 -#define EXCEPTION_NONCONTINUABLE      1
 -#define EXCEPTION_MAXIMUM_PARAMETERS 15
  /* FIXME: Oh how I wish, I wish the w32api DDK wouldn't include winnt.h... */
  #ifndef __NTDDK_H
  #define MUTANT_QUERY_STATE    0x0001
@@@ -1347,7 -1350,7 +1339,7 @@@ typedef enu
  #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800
  #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
  #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
 -#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
 +#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((ULONG_PTR)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
  #define IMAGE_DIRECTORY_ENTRY_EXPORT  0
  #define IMAGE_DIRECTORY_ENTRY_IMPORT  1
  #define IMAGE_DIRECTORY_ENTRY_RESOURCE        2
  #define IMAGE_REL_BASED_HIGHLOW 3
  #define IMAGE_REL_BASED_HIGHADJ 4
  #define IMAGE_REL_BASED_MIPS_JMPADDR 5
 +#define IMAGE_REL_BASED_MIPS_JMPADDR16 9
 +#define IMAGE_REL_BASED_IA64_IMM64 9
 +#define IMAGE_REL_BASED_DIR64 10
  #define IMAGE_ARCHIVE_START_SIZE 8
  #define IMAGE_ARCHIVE_START "!<arch>\n"
  #define IMAGE_ARCHIVE_END "`\n"
@@@ -2011,7 -2011,7 +2003,7 @@@ typedef struct _ACL_SIZE_INFORMATION 
  } ACL_SIZE_INFORMATION;
  
  /* FIXME: add more machines */
 -#if defined(_X86_) || defined(unix) && !defined(__PowerPC__)
 +#if defined(__i386__) && !defined(__PowerPC__)
  #define SIZE_OF_80387_REGISTERS       80
  #define CONTEXT_i386  0x10000
  #define CONTEXT_i486  0x10000
  #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
  #define CONTEXT_FULL  (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
  #define MAXIMUM_SUPPORTED_EXTENSION  512
 +
 +#define EXCEPTION_READ_FAULT    0
 +#define EXCEPTION_WRITE_FAULT   1
 +#define EXCEPTION_EXECUTE_FAULT 8
 +
  typedef struct _FLOATING_SAVE_AREA {
        DWORD   ControlWord;
        DWORD   StatusWord;
@@@ -2066,237 -2061,6 +2058,237 @@@ typedef struct _CONTEXT 
        DWORD   SegSs;
        BYTE    ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
  } CONTEXT;
 +#elif defined(__x86_64__)
 +
 +
 +#define CONTEXT_AMD64 0x100000
 +
 +#if !defined(RC_INVOKED)
 +#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L)
 +#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L)
 +#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L)
 +#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L)
 +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L)
 +
 +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
 +#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
 +
 +#define CONTEXT_EXCEPTION_ACTIVE 0x8000000
 +#define CONTEXT_SERVICE_ACTIVE 0x10000000
 +#define CONTEXT_EXCEPTION_REQUEST 0x40000000
 +#define CONTEXT_EXCEPTION_REPORTING 0x80000000
 +#endif
 +
 +#define INITIAL_MXCSR 0x1f80
 +#define INITIAL_FPCSR 0x027f
 +#define EXCEPTION_READ_FAULT    0
 +#define EXCEPTION_WRITE_FAULT   1
 +#define EXCEPTION_EXECUTE_FAULT 8
 +
 +typedef struct DECLSPEC_ALIGN(16) _M128A {
 +    ULONGLONG Low;
 +    LONGLONG High;
 +} M128A, *PM128A;
 +
 +typedef struct _XMM_SAVE_AREA32 {
 +    WORD ControlWord;
 +    WORD StatusWord;
 +    BYTE TagWord;
 +    BYTE Reserved1;
 +    WORD ErrorOpcode;
 +    DWORD ErrorOffset;
 +    WORD ErrorSelector;
 +    WORD Reserved2;
 +    DWORD DataOffset;
 +    WORD DataSelector;
 +    WORD Reserved3;
 +    DWORD MxCsr;
 +    DWORD MxCsr_Mask;
 +    M128A FloatRegisters[8];
 +    M128A XmmRegisters[16];
 +    BYTE Reserved4[96];
 +} XMM_SAVE_AREA32, *PXMM_SAVE_AREA32;
 +
 +typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
 +    DWORD64 P1Home;
 +    DWORD64 P2Home;
 +    DWORD64 P3Home;
 +    DWORD64 P4Home;
 +    DWORD64 P5Home;
 +    DWORD64 P6Home;
 +
 +    /* Control flags */
 +    DWORD ContextFlags;
 +    DWORD MxCsr;
 +
 +    /* Segment */
 +    WORD SegCs;
 +    WORD SegDs;
 +    WORD SegEs;
 +    WORD SegFs;
 +    WORD SegGs;
 +    WORD SegSs;
 +    DWORD EFlags;
 +
 +    /* Debug */
 +    DWORD64 Dr0;
 +    DWORD64 Dr1;
 +    DWORD64 Dr2;
 +    DWORD64 Dr3;
 +    DWORD64 Dr6;
 +    DWORD64 Dr7;
 +
 +    /* Integer */
 +    DWORD64 Rax;
 +    DWORD64 Rcx;
 +    DWORD64 Rdx;
 +    DWORD64 Rbx;
 +    DWORD64 Rsp;
 +    DWORD64 Rbp;
 +    DWORD64 Rsi;
 +    DWORD64 Rdi;
 +    DWORD64 R8;
 +    DWORD64 R9;
 +    DWORD64 R10;
 +    DWORD64 R11;
 +    DWORD64 R12;
 +    DWORD64 R13;
 +    DWORD64 R14;
 +    DWORD64 R15;
 +
 +    /* Counter */
 +    DWORD64 Rip;
 +
 +   /* Floating point */
 +   union {
 +       XMM_SAVE_AREA32 FltSave;
 +       struct {
 +           M128A Header[2];
 +           M128A Legacy[8];
 +           M128A Xmm0;
 +           M128A Xmm1;
 +           M128A Xmm2;
 +           M128A Xmm3;
 +           M128A Xmm4;
 +           M128A Xmm5;
 +           M128A Xmm6;
 +           M128A Xmm7;
 +           M128A Xmm8;
 +           M128A Xmm9;
 +           M128A Xmm10;
 +           M128A Xmm11;
 +           M128A Xmm12;
 +           M128A Xmm13;
 +           M128A Xmm14;
 +           M128A Xmm15;
 +      } DUMMYSTRUCTNAME;
 +    } DUMMYUNIONNAME;
 +
 +     /* Vector */
 +    M128A VectorRegister[26];
 +    DWORD64 VectorControl;
 +
 +    /* Debug control */
 +    DWORD64 DebugControl;
 +    DWORD64 LastBranchToRip;
 +    DWORD64 LastBranchFromRip;
 +    DWORD64 LastExceptionToRip;
 +    DWORD64 LastExceptionFromRip;
 +} CONTEXT, *PCONTEXT;
 +
 +
 +typedef struct _KNONVOLATILE_CONTEXT_POINTERS {
 +    union {
 +        PM128A FloatingContext[16];
 +        struct {
 +            PM128A Xmm0;
 +            PM128A Xmm1;
 +            PM128A Xmm2;
 +            PM128A Xmm3;
 +            PM128A Xmm4;
 +            PM128A Xmm5;
 +            PM128A Xmm6;
 +            PM128A Xmm7;
 +            PM128A Xmm8;
 +            PM128A Xmm9;
 +            PM128A Xmm10;
 +            PM128A Xmm11;
 +            PM128A Xmm12;
 +            PM128A Xmm13;
 +            PM128A Xmm14;
 +            PM128A Xmm15;
 +        };
 +    };
 +
 +    union {
 +        PULONG64 IntegerContext[16];
 +        struct {
 +            PULONG64 Rax;
 +            PULONG64 Rcx;
 +            PULONG64 Rdx;
 +            PULONG64 Rbx;
 +            PULONG64 Rsp;
 +            PULONG64 Rbp;
 +            PULONG64 Rsi;
 +            PULONG64 Rdi;
 +            PULONG64 R8;
 +            PULONG64 R9;
 +            PULONG64 R10;
 +            PULONG64 R11;
 +            PULONG64 R12;
 +            PULONG64 R13;
 +            PULONG64 R14;
 +            PULONG64 R15;
 +        };
 +    };
 +} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;
 +
 +#define UNW_FLAG_NHANDLER 0x0 /* No handler. */
 +#define UNW_FLAG_EHANDLER 0x1 /* Exception handler should be called */
 +#define UNW_FLAG_UHANDLER 0x2 /* Termination handler that should be called when unwinding an exception */
 +#define UNW_FLAG_CHAININFO 0x4 /* FunctionEntry member is the contents of a previous function table entry */
 +
 +#define RUNTIME_FUNCTION_INDIRECT 0x1
 +
 +  typedef struct _RUNTIME_FUNCTION {
 +    DWORD BeginAddress;
 +    DWORD EndAddress;
 +    DWORD UnwindData;
 +  } RUNTIME_FUNCTION,*PRUNTIME_FUNCTION;
 +
 +  typedef PRUNTIME_FUNCTION (*PGET_RUNTIME_FUNCTION_CALLBACK)(DWORD64 ControlPc,PVOID Context);
 +  typedef DWORD (*POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK)(HANDLE Process,PVOID TableAddress,PDWORD Entries,PRUNTIME_FUNCTION *Functions);
 +
 +  #define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME "OutOfProcessFunctionTableCallback"
 +
 +NTSYSAPI
 +VOID
 +__cdecl
 +RtlRestoreContext(PCONTEXT ContextRecord,
 +                  struct _EXCEPTION_RECORD *ExceptionRecord);
 +
 +NTSYSAPI
 +BOOLEAN
 +__cdecl
 +RtlAddFunctionTable(PRUNTIME_FUNCTION FunctionTable,
 +                    DWORD EntryCount,
 +                    DWORD64 BaseAddress);
 +
 +NTSYSAPI
 +BOOLEAN
 +__cdecl
 +RtlInstallFunctionTableCallback(DWORD64 TableIdentifier,
 +                                DWORD64 BaseAddress,
 +                                DWORD Length,
 +                                PGET_RUNTIME_FUNCTION_CALLBACK Callback,
 +                                PVOID Context,
 +                                PCWSTR OutOfProcessCallbackDll);
 +
 +NTSYSAPI
 +BOOLEAN
 +__cdecl
 +RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable);
 +
  #elif defined(_PPC_)
  #define CONTEXT_CONTROL       1L
  #define CONTEXT_FLOATING_POINT        2L
@@@ -2784,44 -2548,18 +2776,44 @@@ typedef struct _CONTEXT 
  #error "undefined processor type"
  #endif
  typedef CONTEXT *PCONTEXT,*LPCONTEXT;
 -typedef struct _EXCEPTION_RECORD {
 -      DWORD ExceptionCode;
 -      DWORD ExceptionFlags;
 -      struct _EXCEPTION_RECORD *ExceptionRecord;
 -      PVOID ExceptionAddress;
 -      DWORD NumberParameters;
 -      ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
 -} EXCEPTION_RECORD,*PEXCEPTION_RECORD,*LPEXCEPTION_RECORD;
 -typedef struct _EXCEPTION_POINTERS {
 -      PEXCEPTION_RECORD ExceptionRecord;
 -      PCONTEXT ContextRecord;
 -} EXCEPTION_POINTERS,*PEXCEPTION_POINTERS,*LPEXCEPTION_POINTERS;
 +
 +#define EXCEPTION_NONCONTINUABLE      1
 +#define EXCEPTION_MAXIMUM_PARAMETERS 15
 +
 +    typedef struct _EXCEPTION_RECORD {
 +      DWORD ExceptionCode;
 +      DWORD ExceptionFlags;
 +      struct _EXCEPTION_RECORD *ExceptionRecord;
 +      PVOID ExceptionAddress;
 +      DWORD NumberParameters;
 +      ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
 +    } EXCEPTION_RECORD, *PEXCEPTION_RECORD, *LPEXCEPTION_RECORD;
 +
 +    typedef EXCEPTION_RECORD *PEXCEPTION_RECORD;
 +
 +    typedef struct _EXCEPTION_RECORD32 {
 +      DWORD ExceptionCode;
 +      DWORD ExceptionFlags;
 +      DWORD ExceptionRecord;
 +      DWORD ExceptionAddress;
 +      DWORD NumberParameters;
 +      DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
 +    } EXCEPTION_RECORD32,*PEXCEPTION_RECORD32;
 +
 +    typedef struct _EXCEPTION_RECORD64 {
 +      DWORD ExceptionCode;
 +      DWORD ExceptionFlags;
 +      DWORD64 ExceptionRecord;
 +      DWORD64 ExceptionAddress;
 +      DWORD NumberParameters;
 +      DWORD __unusedAlignment;
 +      DWORD64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
 +    } EXCEPTION_RECORD64,*PEXCEPTION_RECORD64;
 +
 +    typedef struct _EXCEPTION_POINTERS {
 +      PEXCEPTION_RECORD ExceptionRecord;
 +      PCONTEXT ContextRecord;
 +    } EXCEPTION_POINTERS,*PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS;
  
  #ifdef _M_PPC
  #define LARGE_INTEGER_ORDER(x) x HighPart; DWORD LowPart;
@@@ -3164,7 -2902,7 +3156,7 @@@ typedef struct _RTL_CRITICAL_SECTION 
  #endif
  
  NTSYSAPI
 -WORD  
 +WORD
  NTAPI
  RtlCaptureStackBackTrace(
      IN DWORD FramesToSkip,
      OUT PDWORD BackTraceHash OPTIONAL
  );
  
 +NTSYSAPI
 +VOID
 +NTAPI
 +RtlCaptureContext(
 +    PCONTEXT ContextRecord
 +);
  
  NTSYSAPI
  PVOID
@@@ -3633,75 -3365,14 +3625,75 @@@ typedef struct _IMAGE_IMPORT_BY_NAME 
        WORD Hint;
        BYTE Name[1];
  } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME;
 -typedef struct _IMAGE_THUNK_DATA {
 -      union {
 -              ULONG ForwarderString;
 -              ULONG Function;
 -              DWORD Ordinal;
 -              ULONG AddressOfData;
 -      } u1;
 -} IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA;
 +#include "pshpack8.h"
 +typedef struct _IMAGE_THUNK_DATA64 {
 +    union {
 +        ULONGLONG ForwarderString;
 +        ULONGLONG Function;
 +        ULONGLONG Ordinal;
 +        ULONGLONG AddressOfData;
 +    } u1;
 +} IMAGE_THUNK_DATA64;
 +typedef IMAGE_THUNK_DATA64 *PIMAGE_THUNK_DATA64;
 +#include "poppack.h"
 +
 +typedef struct _IMAGE_THUNK_DATA32 {
 +    union {
 +        DWORD ForwarderString;
 +        DWORD Function;
 +        DWORD Ordinal;
 +        DWORD AddressOfData;
 +    } u1;
 +} IMAGE_THUNK_DATA32;
 +typedef IMAGE_THUNK_DATA32 *PIMAGE_THUNK_DATA32;
 +
 +#define IMAGE_ORDINAL_FLAG64 0x8000000000000000
 +#define IMAGE_ORDINAL_FLAG32 0x80000000
 +#define IMAGE_ORDINAL64(Ordinal) (Ordinal & 0xffff)
 +#define IMAGE_ORDINAL32(Ordinal) (Ordinal & 0xffff)
 +#define IMAGE_SNAP_BY_ORDINAL64(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG64)!=0)
 +#define IMAGE_SNAP_BY_ORDINAL32(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG32)!=0)
 +
 +typedef VOID
 +(NTAPI *PIMAGE_TLS_CALLBACK)(PVOID DllHandle,DWORD Reason,PVOID Reserved);
 +
 +typedef struct _IMAGE_TLS_DIRECTORY64 {
 +    ULONGLONG StartAddressOfRawData;
 +    ULONGLONG EndAddressOfRawData;
 +    ULONGLONG AddressOfIndex;
 +    ULONGLONG AddressOfCallBacks;
 +    DWORD SizeOfZeroFill;
 +    DWORD Characteristics;
 +} IMAGE_TLS_DIRECTORY64;
 +typedef IMAGE_TLS_DIRECTORY64 *PIMAGE_TLS_DIRECTORY64;
 +
 +typedef struct _IMAGE_TLS_DIRECTORY32 {
 +    DWORD StartAddressOfRawData;
 +    DWORD EndAddressOfRawData;
 +    DWORD AddressOfIndex;
 +    DWORD AddressOfCallBacks;
 +    DWORD SizeOfZeroFill;
 +    DWORD Characteristics;
 +} IMAGE_TLS_DIRECTORY32;
 +typedef IMAGE_TLS_DIRECTORY32 *PIMAGE_TLS_DIRECTORY32;
 +#ifdef _WIN64
 +#define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG64
 +#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL64(Ordinal)
 +typedef IMAGE_THUNK_DATA64 IMAGE_THUNK_DATA;
 +typedef PIMAGE_THUNK_DATA64 PIMAGE_THUNK_DATA;
 +#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL64(Ordinal)
 +typedef IMAGE_TLS_DIRECTORY64 IMAGE_TLS_DIRECTORY;
 +typedef PIMAGE_TLS_DIRECTORY64 PIMAGE_TLS_DIRECTORY;
 +#else
 +#define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG32
 +#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL32(Ordinal)
 +typedef IMAGE_THUNK_DATA32 IMAGE_THUNK_DATA;
 +typedef PIMAGE_THUNK_DATA32 PIMAGE_THUNK_DATA;
 +#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL32(Ordinal)
 +typedef IMAGE_TLS_DIRECTORY32 IMAGE_TLS_DIRECTORY;
 +typedef PIMAGE_TLS_DIRECTORY32 PIMAGE_TLS_DIRECTORY;
 +#endif
 +
  typedef struct _IMAGE_IMPORT_DESCRIPTOR {
        _ANONYMOUS_UNION union {
                DWORD Characteristics;
@@@ -3723,6 -3394,14 +3715,6 @@@ typedef struct _IMAGE_BOUND_FORWARDER_R
        WORD Reserved;
  } IMAGE_BOUND_FORWARDER_REF,*PIMAGE_BOUND_FORWARDER_REF;
  typedef void(NTAPI *PIMAGE_TLS_CALLBACK)(PVOID,DWORD,PVOID);
 -typedef struct _IMAGE_TLS_DIRECTORY {
 -      DWORD StartAddressOfRawData;
 -      DWORD EndAddressOfRawData;
 -      PDWORD AddressOfIndex;
 -      PIMAGE_TLS_CALLBACK *AddressOfCallBacks;
 -      DWORD SizeOfZeroFill;
 -      DWORD Characteristics;
 -} IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY;
  typedef struct _IMAGE_RESOURCE_DIRECTORY {
        DWORD Characteristics;
        DWORD TimeDateStamp;
@@@ -4411,11 -4090,6 +4403,11 @@@ static __inline__ PVOID GetCurrentFiber
      );
      return ret;
  }
 +#elif defined (_M_AMD64)
 +FORCEINLINE PVOID GetCurrentFiber(VOID)
 +{
 +    return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData));
 +}
  #elif defined (_M_ARM)
      PVOID WINAPI GetCurrentFiber(VOID);
  #else
@@@ -4456,18 -4130,13 +4448,18 @@@ static __inline__ struct _TEB * NtCurre
      return ret;
  }
  #elif _M_ARM
 -    
 +
  //
  // NT-ARM is not documented
  //
  #define KIRQL ULONG // Hack!
  #include <armddk.h>
 -    
 +
 +#elif defined (_M_AMD64)
 +FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
 +{
 +    return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
 +}
  #else
  static __inline__ struct _TEB * NtCurrentTeb(void)
  {
@@@ -4598,8 -4267,6 +4590,8 @@@ BitScanReverse(OUT ULONG *Index
  
  #if defined(_M_IX86)
  #define YieldProcessor() __asm__ __volatile__("pause");
 +#elif defined (_M_AMD64)
 +#define YieldProcessor() __asm__ __volatile__("pause");
  #elif defined(_M_PPC)
  #define YieldProcessor() __asm__ __volatile__("nop");
  #elif defined(_M_MIPS)
  
  #define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG64 *)a, b)
  
 +#define InterlockedAnd _InterlockedAnd
 +#define InterlockedExchange _InterlockedExchange
 +#define InterlockedOr _InterlockedOr
 +
 +#define InterlockedAnd64 _InterlockedAnd64
 +#define InterlockedOr64 _InterlockedOr64
 +
 +#define InterlockedBitTestAndSet _interlockedbittestandset
 +#define InterlockedBitTestAndSet64 _interlockedbittestandset64
 +#define InterlockedBitTestAndReset _interlockedbittestandreset
 +#define InterlockedBitTestAndReset64 _interlockedbittestandreset64
 +
 +
  #endif
  
  #else
@@@ -96,7 -96,7 +96,7 @@@ typedef struct 
  
  /*static */ioinfo fdesc[MAX_FILES];
  
- FILE _iob[3];
+ FILE _iob[3] = { { 0 } };
  
  static int fdstart = 3; /* first unallocated fd */
  static int fdend = 3; /* highest allocated fd */
@@@ -182,7 -182,7 +182,7 @@@ static HANDLE fdtoh(int fd
      *_errno() = EBADF;
      return INVALID_HANDLE_VALUE;
    }
-   if (fdesc[fd].handle == INVALID_HANDLE_VALUE) FIXME("wtf\n");
+   //if (fdesc[fd].handle == INVALID_HANDLE_VALUE) FIXME("wtf\n");
    return fdesc[fd].handle;
  }
  
@@@ -1291,7 -1291,7 +1291,7 @@@ long CDECL _get_osfhandle(int fd
    HANDLE hand = fdtoh(fd);
    TRACE(":fd (%d) handle (%p)\n",fd,hand);
  
 -  return (long)hand;
 +  return (long)(LONG_PTR)hand;
  }
  
  /*********************************************************************
@@@ -1654,7 -1654,7 +1654,7 @@@ int CDECL _open_osfhandle(long handle, 
    if (!(oflags & (_O_BINARY | _O_TEXT)))
        oflags |= _O_BINARY;
  
 -  fd = alloc_fd((HANDLE)handle, split_oflags(oflags));
 +  fd = alloc_fd((HANDLE)(LONG_PTR)handle, split_oflags(oflags));
    TRACE(":handle (%ld) fd (%d) flags 0x%08x\n", handle, fd, oflags);
    return fd;
  }
@@@ -47,7 -47,7 +47,7 @@@
  
  NTSTATUS
  NTAPI
- MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
+ MmWritePageVirtualMemory(PMM_AVL_TABLE AddressSpace,
                           PMEMORY_AREA MemoryArea,
                           PVOID Address,
                           PMM_PAGEOP PageOp)
@@@ -55,6 -55,7 +55,7 @@@
     SWAPENTRY SwapEntry;
     PFN_TYPE Page;
     NTSTATUS Status;
+    PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
  
     /*
      * Check for paging out from a deleted virtual memory area.
        return(STATUS_UNSUCCESSFUL);
     }
  
-    Page = MmGetPfnForProcess(AddressSpace->Process, Address);
+    Page = MmGetPfnForProcess(Process, Address);
  
     /*
      * Get that the page actually is dirty.
      */
-    if (!MmIsDirtyPage(AddressSpace->Process, Address))
+    if (!MmIsDirtyPage(Process, Address))
     {
        PageOp->Status = STATUS_SUCCESS;
        KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
@@@ -83,7 -84,7 +84,7 @@@
     /*
      * Speculatively set the mapping to clean.
      */
-    MmSetCleanPage(AddressSpace->Process, Address);
+    MmSetCleanPage(Process, Address);
  
     /*
      * If necessary, allocate an entry in the paging file for this page
@@@ -94,7 -95,7 +95,7 @@@
        SwapEntry = MmAllocSwapPage();
        if (SwapEntry == 0)
        {
-          MmSetDirtyPage(AddressSpace->Process, Address);
+          MmSetDirtyPage(Process, Address);
           PageOp->Status = STATUS_PAGEFILE_QUOTA_EXCEEDED;
           KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
           MmReleasePageOp(PageOp);
     {
        DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
                Status);
-       MmSetDirtyPage(AddressSpace->Process, Address);
+       MmSetDirtyPage(Process, Address);
        PageOp->Status = STATUS_UNSUCCESSFUL;
        KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
        MmReleasePageOp(PageOp);
  
  NTSTATUS
  NTAPI
- MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
+ MmPageOutVirtualMemory(PMM_AVL_TABLE AddressSpace,
                         PMEMORY_AREA MemoryArea,
                         PVOID Address,
                         PMM_PAGEOP PageOp)
     BOOLEAN WasDirty;
     SWAPENTRY SwapEntry;
     NTSTATUS Status;
+    PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+     
     DPRINT("MmPageOutVirtualMemory(Address 0x%.8X) PID %d\n",
-           Address, AddressSpace->Process->UniqueProcessId);
+           Address, Process->UniqueProcessId);
  
     /*
      * Check for paging out from a deleted virtual memory area.
     /*
      * Disable the virtual mapping.
      */
-    MmDisableVirtualMapping(AddressSpace->Process, Address,
+    MmDisableVirtualMapping(Process, Address,
                             &WasDirty, &Page);
  
     if (Page == 0)
     if (!WasDirty)
     {
        MmLockAddressSpace(AddressSpace);
-       MmDeleteVirtualMapping(AddressSpace->Process, Address, FALSE, NULL, NULL);
+       MmDeleteVirtualMapping(Process, Address, FALSE, NULL, NULL);
        MmDeleteAllRmaps(Page, NULL, NULL);
        if ((SwapEntry = MmGetSavedSwapEntryPage(Page)) != 0)
        {
-          MmCreatePageFileMapping(AddressSpace->Process, Address, SwapEntry);
+          MmCreatePageFileMapping(Process, Address, SwapEntry);
           MmSetSavedSwapEntryPage(Page, 0);
        }
        MmUnlockAddressSpace(AddressSpace);
        if (SwapEntry == 0)
        {
           MmShowOutOfSpaceMessagePagingFile();
-          MmEnableVirtualMapping(AddressSpace->Process, Address);
+          MmEnableVirtualMapping(Process, Address);
           PageOp->Status = STATUS_UNSUCCESSFUL;
           KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
           MmReleasePageOp(PageOp);
     {
        DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
                Status);
-       MmEnableVirtualMapping(AddressSpace->Process, Address);
+       MmEnableVirtualMapping(Process, Address);
        PageOp->Status = STATUS_UNSUCCESSFUL;
        KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
        MmReleasePageOp(PageOp);
      */
     DPRINT("MM: Swapped out virtual memory page 0x%.8X!\n", Page << PAGE_SHIFT);
     MmLockAddressSpace(AddressSpace);
-    MmDeleteVirtualMapping(AddressSpace->Process, Address, FALSE, NULL, NULL);
-    MmCreatePageFileMapping(AddressSpace->Process, Address, SwapEntry);
+    MmDeleteVirtualMapping(Process, Address, FALSE, NULL, NULL);
+    MmCreatePageFileMapping(Process, Address, SwapEntry);
     MmUnlockAddressSpace(AddressSpace);
     MmDeleteAllRmaps(Page, NULL, NULL);
     MmSetSavedSwapEntryPage(Page, 0);
  
  NTSTATUS
  NTAPI
- MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
+ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace,
                                 MEMORY_AREA* MemoryArea,
                                 PVOID Address,
                                 BOOLEAN Locked)
     NTSTATUS Status;
     PMM_REGION Region;
     PMM_PAGEOP PageOp;
+    PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+     
     /*
      * There is a window between taking the page fault and locking the
      * address space when another thread could load the page so we check
     /*
      * Get or create a page operation
      */
-    PageOp = MmGetPageOp(MemoryArea, AddressSpace->Process->UniqueProcessId,
+    PageOp = MmGetPageOp(MemoryArea, Process->UniqueProcessId,
                          (PVOID)PAGE_ROUND_DOWN(Address), NULL, 0,
                          MM_PAGEOP_PAGEIN, FALSE);
     if (PageOp == NULL)
     {
        SWAPENTRY SwapEntry;
  
-       MmDeletePageFileMapping(AddressSpace->Process, Address, &SwapEntry);
+       MmDeletePageFileMapping(Process, Address, &SwapEntry);
        Status = MmReadFromSwapPage(SwapEntry, Page);
        if (!NT_SUCCESS(Status))
        {
      * Set the page. If we fail because we are out of memory then
      * try again
      */
-    Status = MmCreateVirtualMapping(AddressSpace->Process,
+    Status = MmCreateVirtualMapping(Process,
                                     (PVOID)PAGE_ROUND_DOWN(Address),
                                     Region->Protect,
                                     &Page,
     while (Status == STATUS_NO_MEMORY)
     {
        MmUnlockAddressSpace(AddressSpace);
-       Status = MmCreateVirtualMapping(AddressSpace->Process,
+       Status = MmCreateVirtualMapping(Process,
                                        Address,
                                        Region->Protect,
                                        &Page,
     /*
      * Add the page to the process's working set
      */
-    MmInsertRmap(Page, AddressSpace->Process, (PVOID)PAGE_ROUND_DOWN(Address));
+    MmInsertRmap(Page, Process, (PVOID)PAGE_ROUND_DOWN(Address));
  
     /*
      * Finish the operation
  }
  
  VOID static
- MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
+ MmModifyAttributes(PMM_AVL_TABLE AddressSpace,
                     PVOID BaseAddress,
                     ULONG RegionSize,
                     ULONG OldType,
   * FUNCTION: Modify the attributes of a memory region
   */
  {
+    PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+     
     /*
      * If we are switching a previously committed region to reserved then
      * free any allocated pages within the region
        {
           PFN_TYPE Page;
  
-          if (MmIsPageSwapEntry(AddressSpace->Process,
+          if (MmIsPageSwapEntry(Process,
                                 (char*)BaseAddress + (i * PAGE_SIZE)))
           {
              SWAPENTRY SwapEntry;
  
-             MmDeletePageFileMapping(AddressSpace->Process,
+             MmDeletePageFileMapping(Process,
                                      (char*)BaseAddress + (i * PAGE_SIZE),
                                      &SwapEntry);
              MmFreeSwapPage(SwapEntry);
           }
           else
           {
-             MmDeleteVirtualMapping(AddressSpace->Process,
+             MmDeleteVirtualMapping(Process,
                                     (char*)BaseAddress + (i*PAGE_SIZE),
                                     FALSE, NULL, &Page);
              if (Page != 0)
                    MmFreeSwapPage(SavedSwapEntry);
                    MmSetSavedSwapEntryPage(Page, 0);
                 }
-                MmDeleteRmap(Page, AddressSpace->Process,
+                MmDeleteRmap(Page, Process,
                              (char*)BaseAddress + (i * PAGE_SIZE));
                 MmReleasePageMemoryConsumer(MC_USER, Page);
              }
  
        for (i=0; i < PAGE_ROUND_UP(RegionSize)/PAGE_SIZE; i++)
        {
-          if (MmIsPagePresent(AddressSpace->Process,
+          if (MmIsPagePresent(Process,
                               (char*)BaseAddress + (i*PAGE_SIZE)))
           {
-             MmSetPageProtect(AddressSpace->Process,
+             MmSetPageProtect(Process,
                               (char*)BaseAddress + (i*PAGE_SIZE),
                               NewProtect);
           }
@@@ -518,7 -523,7 +523,7 @@@ NTSTATUS STDCAL
  NtAllocateVirtualMemory(IN     HANDLE ProcessHandle,
                          IN OUT PVOID* UBaseAddress,
                          IN     ULONG  ZeroBits,
 -                        IN OUT PULONG URegionSize,
 +                        IN OUT PSIZE_T URegionSize,
                          IN     ULONG  AllocationType,
                          IN     ULONG  Protect)
  /*
     ULONG_PTR MemoryAreaLength;
     ULONG Type;
     NTSTATUS Status;
-    PMADDRESS_SPACE AddressSpace;
+    PMM_AVL_TABLE AddressSpace;
     PVOID BaseAddress;
     ULONG RegionSize;
     PVOID PBaseAddress;
     Type = (AllocationType & MEM_COMMIT) ? MEM_COMMIT : MEM_RESERVE;
     DPRINT("Type %x\n", Type);
  
-    AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
+    AddressSpace = &Process->VadRoot;
     MmLockAddressSpace(AddressSpace);
  
     if (PBaseAddress != 0)
@@@ -856,7 -861,7 +861,7 @@@ MmFreeVirtualMemory(PEPROCESS Process
           if (PageOp != NULL)
           {
              NTSTATUS Status;
-             MmUnlockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
+             MmUnlockAddressSpace(&Process->VadRoot);
              Status = KeWaitForSingleObject(&PageOp->CompletionEvent,
                                             0,
                                             KernelMode,
                 DPRINT1("Failed to wait for page op\n");
                 KEBUGCHECK(0);
              }
-             MmLockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
+             MmLockAddressSpace(&Process->VadRoot);
              MmReleasePageOp(PageOp);
           }
        }
     }
  
     /* Actually free the memory area. */
-    MmFreeMemoryArea((PMADDRESS_SPACE)&Process->VadRoot,
+    MmFreeMemoryArea(&Process->VadRoot,
                      MemoryArea,
                      MmFreeVirtualMemoryPage,
                      (PVOID)Process);
  NTSTATUS STDCALL
  NtFreeVirtualMemory(IN HANDLE ProcessHandle,
                      IN PVOID*  PBaseAddress,
 -                    IN PULONG PRegionSize,
 +                    IN PSIZE_T PRegionSize,
                      IN ULONG FreeType)
  /*
   * FUNCTION: Frees a range of virtual memory
     MEMORY_AREA* MemoryArea;
     NTSTATUS Status;
     PEPROCESS Process;
-    PMADDRESS_SPACE AddressSpace;
+    PMM_AVL_TABLE AddressSpace;
     PVOID BaseAddress;
     ULONG RegionSize;
  
        return(Status);
     }
  
-    AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
+    AddressSpace = &Process->VadRoot;
  
     MmLockAddressSpace(AddressSpace);
     MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
@@@ -986,7 -991,7 +991,7 @@@ unlock_deref_and_return
  
  NTSTATUS
  NTAPI
- MmProtectAnonMem(PMADDRESS_SPACE AddressSpace,
+ MmProtectAnonMem(PMM_AVL_TABLE AddressSpace,
                   PMEMORY_AREA MemoryArea,
                   PVOID BaseAddress,
                   ULONG Length,
@@@ -339,7 -339,7 +339,7 @@@ co_IntCallHookProc(INT HookId
  {
     ULONG ArgumentLength;
     PVOID Argument;
-    LRESULT Result;
+    LRESULT Result = 0;
     NTSTATUS Status;
     PVOID ResultPointer;
     ULONG ResultLength;
                 {
                    RtlCopyMemory(Extra, ClassName->Buffer, ClassName->Length);
                    CbtCreatewndExtra->Cs.lpszClass =
 -                     (LPCWSTR) MAKELONG(Extra - (PCHAR) CbtCreatewndExtra, 1);
 +                     (LPCWSTR)(ULONG_PTR) MAKELONG(Extra - (PCHAR) CbtCreatewndExtra, 1);
                    Extra += ClassName->Length;
                    *((WCHAR *) Extra) = L'\0';
                 }
                                 &ResultPointer,
                                 &ResultLength);
  
-    /* Simulate old behaviour: copy into our local buffer */
-    Result = *(LRESULT*)ResultPointer;
     UserEnterCo();
  
+    _SEH_TRY
+    {
+       ProbeForRead((PVOID)*(LRESULT*)ResultPointer,
+                                    sizeof(LRESULT),
+                                                  1);
+       /* Simulate old behaviour: copy into our local buffer */
+       Result = *(LRESULT*)ResultPointer;
+    }
+    _SEH_HANDLE
+    {
+       Result = 0;
+    }
+    _SEH_END;
     IntCbFreeMemory(Argument);
  
     if (!NT_SUCCESS(Status))
@@@ -562,7 -573,7 +573,7 @@@ co_IntCallEventProc(HWINEVENTHOOK hook
     IntRestoreTebWndCallback (hWnd, pWnd);
  
     IntCbFreeMemory(Argument);
 -  
 +
     if (!NT_SUCCESS(Status))
     {
        return 0;
@@@ -161,7 -161,8 +161,8 @@@ IntGetFirstValidHook(PHOOKTABLE Table, 
  }
  
  /* find the next hook in the chain, skipping the deleted ones */
- static PHOOK FASTCALL
+ PHOOK
+ FASTCALL
  IntGetNextHook(PHOOK Hook)
  {
     PHOOKTABLE Table = IntGetTable(Hook);
@@@ -273,17 -274,22 +274,22 @@@ IntCallLowLevelHook(INT HookId, INT Cod
  
     /* FIXME should get timeout from
      * HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
 -   Status = co_MsqSendMessage(((PW32THREAD)Hook->Thread->Tcb.Win32Thread)->MessageQueue, (HWND) Code, HookId,
 +   Status = co_MsqSendMessage(((PW32THREAD)Hook->Thread->Tcb.Win32Thread)->MessageQueue, (HWND)(INT_PTR) Code, HookId,
                                wParam, lParam, 5000, TRUE, TRUE, &uResult);
  
     return NT_SUCCESS(Status) ? uResult : 0;
  }
  
- LRESULT FASTCALL
+ /*
+   Called from inside kernel space.
+  */
+ LRESULT
+ FASTCALL
  co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam)
  {
-    PHOOK Hook;
+    PHOOK Hook, SaveHook;
     PW32THREAD Win32Thread;
+    PW32CLIENTINFO ClientInfo;
     PHOOKTABLE Table;
     LRESULT Result;
     PWINSTATION_OBJECT WinStaObj;
        GlobalHooks->Counts[HOOKID_TO_INDEX(HookId)]++;
     }
  
+    ClientInfo = GetWin32ClientInfo();
+    SaveHook = ClientInfo->phkCurrent;
+    ClientInfo->phkCurrent = Hook;     // Load the call.
     Result = co_IntCallHookProc(HookId, Code, wParam, lParam, Hook->Proc,
                                 Hook->Ansi, &Hook->ModuleName);
  
+    ClientInfo->phkCurrent = SaveHook;
     Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
                                             KernelMode,
                                             0,
@@@ -397,9 -409,20 +409,20 @@@ HOOK_DestroyThreadHooks(PETHREAD Thread
     }
  }
  
+ static LRESULT
+ FASTCALL
+ co_HOOK_CallHookNext(PHOOK Hook, INT Code, WPARAM wParam, LPARAM lParam)
+ {
+    DPRINT("CALLING HOOK %d\n",Hook->HookId);
+    return co_IntCallHookProc(Hook->HookId, Code, wParam, lParam, Hook->Proc,
+                                   Hook->Ansi, &Hook->ModuleName);
+ }
  LRESULT
  FASTCALL
  IntCallDebugHook(
+    PHOOK Hook,
     int Code,
     WPARAM wParam,
     LPARAM lParam)
     }
  
     if (HooklParam) Debug.lParam = (LPARAM)HooklParam;
-    lResult = co_HOOK_CallHooks(WH_DEBUG, Code, wParam, (LPARAM)&Debug);
+    lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&Debug);
     if (HooklParam) ExFreePool(HooklParam);
     return lResult;
  }
  
+ /*
+    Called from user space via CallNextHook.
+  */
  LRESULT
  FASTCALL
  UserCallNextHookEx(
-    int HookId,
+    PHOOK Hook,
     int Code,
     WPARAM wParam,
     LPARAM lParam,
    BOOL BadChk = FALSE;
  
  // Handle this one first.
-   if ((HookId == WH_MOUSE) || (HookId == WH_CBT && Code == HCBT_CLICKSKIPPED))
+   if ((Hook->HookId == WH_MOUSE) ||
+       (Hook->HookId == WH_CBT && Code == HCBT_CLICKSKIPPED))
    {
       MOUSEHOOKSTRUCTEX Mouse;
       if (lParam)
       }
       if (!BadChk)
       {
-         lResult = co_HOOK_CallHooks(HookId, Code, wParam, (LPARAM)&Mouse);
+         lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&Mouse);
       }
       return lResult;
    }
  
-   switch(HookId)
+   switch(Hook->HookId)
    {
        case WH_MOUSE_LL:
        {
           }
           if (!BadChk)
           {
-             lResult = co_HOOK_CallHooks(HookId, Code, wParam, (LPARAM)&Mouse);
+             lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&Mouse);
           }
           break;
        }
           }
           if (!BadChk)
           {
-             lResult = co_HOOK_CallHooks(HookId, Code, wParam, (LPARAM)&Keyboard);
+             lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&Keyboard);
           }
           break;
        }
           }
           if (!BadChk)
           {
-             lResult = co_HOOK_CallHooks(HookId, Code, wParam, (LPARAM)&Msg);
-             if (lParam && (HookId == WH_GETMESSAGE))
+             lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&Msg);
+             if (lParam && (Hook->HookId == WH_GETMESSAGE))
              {
                 _SEH_TRY
                 {
        }
  
        case WH_CBT:
+          DPRINT1("HOOK WH_CBT!\n");
           switch (Code)
           {
              case HCBT_CREATEWND: // Use Ansi.
-                lResult = co_HOOK_CallHooks(HookId, Code, wParam, lParam);
+                DPRINT1("HOOK HCBT_CREATEWND\n");
+ //               lResult = co_HOOK_CallHookNext(Hook, Code, wParam, lParam);
                 break;
  
              case HCBT_MOVESIZE:
              {
                 RECT rt;
+                DPRINT1("HOOK HCBT_MOVESIZE\n");
                 if (lParam)
                 {
                    _SEH_TRY
                 }
                 if (!BadChk)
                 {
-                    lResult = co_HOOK_CallHooks(HookId, Code, wParam, (LPARAM)&rt);
+                    lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&rt);
                 }
                 break;
              }
              case HCBT_ACTIVATE:
              {
                 CBTACTIVATESTRUCT CbAs;
+                DPRINT1("HOOK HCBT_ACTIVATE\n");
                 if (lParam)
                 {
                    _SEH_TRY
                 }
                 if (!BadChk)
                 {
-                    lResult = co_HOOK_CallHooks(HookId, Code, wParam, (LPARAM)&CbAs);
+                    lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&CbAs);
                 }
                 break;
              }
                  The rest just use default.
               */
              default:
-                lResult = co_HOOK_CallHooks(HookId, Code, wParam, lParam);
+                DPRINT1("HOOK HCBT_ %d\n",Code);
+                lResult = co_HOOK_CallHookNext(Hook, Code, wParam, lParam);
                 break;
           }
           break;
           }
           if (!BadChk) 
           {               
-             lResult = co_HOOK_CallHooks(HookId, Code, wParam, (LPARAM)(lParam ? &EventMsg : NULL));
+             lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)(lParam ? &EventMsg : NULL));
              if (lParam)
              {
                 _SEH_TRY
        }
  
        case WH_DEBUG:
-          lResult = IntCallDebugHook( Code, wParam, lParam);
+          lResult = IntCallDebugHook(Hook, Code, wParam, lParam);
           break;
  /*
      Default the rest like, WH_FOREGROUNDIDLE, WH_KEYBOARD and WH_SHELL.
        case WH_FOREGROUNDIDLE:
        case WH_KEYBOARD:
        case WH_SHELL:
-          lResult = co_HOOK_CallHooks(HookId, Code, wParam, lParam);      
+          lResult = co_HOOK_CallHookNext(Hook, Code, wParam, lParam);      
           break;
  
        default:
-          DPRINT1("Unsupported HOOK Id -> %d\n",HookId);
+          DPRINT1("Unsupported HOOK Id -> %d\n",Hook->HookId);
           break;
    }
    return lResult; 
@@@ -844,8 -874,6 +874,6 @@@ NtUserCallNextHookEx
     PW32CLIENTINFO ClientInfo;
     PWINSTATION_OBJECT WinStaObj;
     NTSTATUS Status;
-    LRESULT lResult;
-    INT HookId;
     DECLARE_RETURN(LRESULT);
  
     DPRINT("Enter NtUserCallNextHookEx\n");
                                             KernelMode,
                                             0,
                                             &WinStaObj);
     if (!NT_SUCCESS(Status))
     {
        SetLastNtError(Status);
  
     ClientInfo = GetWin32ClientInfo();
  
-    HookObj = ClientInfo->phkCurrent; // Use this one set from SetWindowHook.
+    if (!ClientInfo) RETURN( 0);
+    HookObj = ClientInfo->phkCurrent;
+    if (!HookObj) RETURN( 0);
+    UserReferenceObject(HookObj);
  
-    HookId = HookObj->HookId;
     Ansi = HookObj->Ansi;
  
     if (NULL != HookObj->Thread && (HookObj->Thread != PsGetCurrentThread()))
     }
     
     NextObj = IntGetNextHook(HookObj);
+    ClientInfo->phkCurrent = NextObj; // Preset next hook from list.
+    UserCallNextHookEx( HookObj, Code, wParam, lParam, Ansi);
     UserDereferenceObject(HookObj);
-    if (NULL != NextObj)
-    {
-       lResult = UserCallNextHookEx( HookId, Code, wParam, lParam, Ansi);
-       ClientInfo->phkCurrent = NextObj;
-       if (lResult == 0) RETURN( 0);
-       RETURN( (LRESULT)NextObj);
-    }
-    ClientInfo->phkCurrent = NextObj;
  
-    RETURN( 0);
+    RETURN( (LRESULT)NextObj);
  
  CLEANUP:
     DPRINT("Leave NtUserCallNextHookEx, ret=%i\n",_ret_);
  HHOOK
  STDCALL
  NtUserSetWindowsHookAW(
 -   int idHook, 
 +   int idHook,
     HOOKPROC lpfn,
     BOOL Ansi)
  {
@@@ -957,7 -981,7 +981,7 @@@ NtUserSetWindowsHookEx
        }
        Mod = NULL;
        Global = FALSE;
 -      if (! NT_SUCCESS(PsLookupThreadByThreadId((HANDLE) ThreadId, &Thread)))
 +      if (! NT_SUCCESS(PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)ThreadId, &Thread)))
        {
           DPRINT1("Invalid thread id 0x%x\n", ThreadId);
           SetLastWin32Error(ERROR_INVALID_PARAMETER);
     /* We only (partially) support local WH_CBT hooks and
      * WH_KEYBOARD_LL, WH_MOUSE_LL and WH_GETMESSAGE hooks for now 
      */
-    if  (WH_DEBUG == HookId ||
+    if  (Global ||
+         WH_DEBUG == HookId ||
          WH_JOURNALPLAYBACK == HookId ||
          WH_JOURNALRECORD == HookId ||
          WH_FOREGROUNDIDLE == HookId ||
     Hook->Ansi = Ansi;
     Handle = Hook->Self;
  
- // Set the client threads next hook based on the hooks type.
-    ClientInfo->phkCurrent    = IntGetNextHook( Hook); 
+ // Clear the client threads next hook.
+    ClientInfo->phkCurrent = 0;
     
     UserDereferenceObject(Hook);
     ObDereferenceObject(WinStaObj);
@@@ -1170,5 -1195,5 +1195,5 @@@ CLEANUP
     UserLeave();
     END_CLEANUP;
  }
 - 
 +
  /* EOF */
@@@ -1,5 -1,6 +1,6 @@@
  /*
   * Copyright (C) 2005 Casper S. Hornstrup
+  * Copyright (C) 2008 HervĂ© Poussineau
   *
   * 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
@@@ -210,8 -211,6 +211,6 @@@ IfableData::~IfableData(
                delete compilerFlags[i];
        for ( i = 0; i < modules.size(); i++ )
                delete modules[i];
-       for ( i = 0; i < ifs.size (); i++ )
-               delete ifs[i];
        for ( i = 0; i < compilationUnits.size (); i++ )
                delete compilationUnits[i];
  }
@@@ -229,8 -228,6 +228,6 @@@ void IfableData::ProcessXML (
                properties[i]->ProcessXML ();
        for ( i = 0; i < compilerFlags.size(); i++ )
                compilerFlags[i]->ProcessXML ();
-       for ( i = 0; i < ifs.size (); i++ )
-               ifs[i]->ProcessXML ();
        for ( i = 0; i < compilationUnits.size (); i++ )
                compilationUnits[i]->ProcessXML ();
  }
@@@ -606,7 -603,6 +603,6 @@@ Module::ProcessXMLSubElement ( const XM
                                   const string& relative_path,
                                 ParseContext& parseContext )
  {
-       If* pOldIf = parseContext.ifData;
        CompilationUnit* pOldCompilationUnit = parseContext.compilationUnit;
        bool subs_invalid = false;
        string subpath ( relative_path );
                else
                {
                        CompilationUnit* pCompilationUnit = new CompilationUnit ( pFile );
-                       if ( parseContext.ifData )
-                               parseContext.ifData->data.compilationUnits.push_back ( pCompilationUnit );
+                       string ext = ToLower ( GetExtension ( e.value ) );
+                       if ( ext == ".idl" )
+                       {
+                               // put .idl files at the start of the module
+                               non_if_data.compilationUnits.insert (
+                                       non_if_data.compilationUnits.begin(),
+                                       pCompilationUnit );
+                       }
+                       else if ( ext == ".asm" || ext == ".s" )
+                       {
+                               // put .asm files at the end of the module
+                               non_if_data.compilationUnits.push_back ( pCompilationUnit );
+                               non_if_data.asmFiles++;
+                       }
                        else
                        {
-                               string ext = ToLower ( GetExtension ( e.value ) );
-                               if ( ext == ".idl" )
-                               {
-                                       // put .idl files at the start of the module
-                                       non_if_data.compilationUnits.insert (
-                                               non_if_data.compilationUnits.begin(),
-                                               pCompilationUnit );
-                               }
-                               else if ( ext == ".asm" || ext == ".s" )
-                               {
-                                       // put .asm files at the end of the module
-                                       non_if_data.compilationUnits.push_back ( pCompilationUnit );
-                                       non_if_data.asmFiles++;
-                               }
-                               else
-                               {
-                                       // put other files in the middle
-                                       non_if_data.compilationUnits.insert (
-                                               non_if_data.compilationUnits.end() - non_if_data.asmFiles,
-                                               pCompilationUnit );
-                               }
+                               // put other files in the middle
+                               non_if_data.compilationUnits.insert (
+                                       non_if_data.compilationUnits.end() - non_if_data.asmFiles,
+                                       pCompilationUnit );
                        }
                }
-               if ( parseContext.ifData )
-                       parseContext.ifData->data.files.push_back ( pFile );
-               else
-                       non_if_data.files.push_back ( pFile );
+               non_if_data.files.push_back ( pFile );
                subs_invalid = true;
        }
        else if ( e.name == "library" && e.value.size () )
        {
                Library* pLibrary = new Library ( e, *this, e.value );
-               if ( parseContext.ifData )
-                       parseContext.ifData->data.libraries.push_back ( pLibrary );
-               else
-                       non_if_data.libraries.push_back ( pLibrary );
+               non_if_data.libraries.push_back ( pLibrary );
                subs_invalid = true;
        }
        else if ( e.name == "directory" )
        else if ( e.name == "include" )
        {
                Include* include = new Include ( project, &e, this );
-               if ( parseContext.ifData )
-                       parseContext.ifData->data.includes.push_back ( include );
-               else
-                       non_if_data.includes.push_back ( include );
+               non_if_data.includes.push_back ( include );
                subs_invalid = true;
        }
        else if ( e.name == "define" )
        {
                Define* pDefine = new Define ( project, this, e );
-               if ( parseContext.ifData )
-                       parseContext.ifData->data.defines.push_back ( pDefine );
-               else
-                       non_if_data.defines.push_back ( pDefine );
+               non_if_data.defines.push_back ( pDefine );
                subs_invalid = true;
        }
        else if ( e.name == "metadata" )
        {
-               if ( parseContext.ifData )
-               {
-                       throw XMLInvalidBuildFileException (
-                               e.location,
-                               "<metadata> is not a valid sub-element of <if>" );
-               }
                metadata = new Metadata ( e, *this );
                subs_invalid = false;
        }
        else if ( e.name == "invoke" )
        {
-               if ( parseContext.ifData )
-               {
-                       throw XMLInvalidBuildFileException (
-                               e.location,
-                               "<invoke> is not a valid sub-element of <if>" );
-               }
                invocations.push_back ( new Invoke ( e, *this ) );
                subs_invalid = false;
        }
        else if ( e.name == "dependency" )
        {
-               if ( parseContext.ifData )
-               {
-                       throw XMLInvalidBuildFileException (
-                               e.location,
-                               "<dependency> is not a valid sub-element of <if>" );
-               }
                dependencies.push_back ( new Dependency ( e, *this ) );
                subs_invalid = true;
        }
        else if ( e.name == "bootsector" )
        {
-               if ( parseContext.ifData )
-               {
-                       throw XMLInvalidBuildFileException (
-                               e.location,
-                               "<bootsector> is not a valid sub-element of <if>" );
-               }
                bootSector = new Bootsector ( e, this );
                subs_invalid = true;
        }
        else if ( e.name == "importlibrary" )
        {
-               if ( parseContext.ifData )
-               {
-                       throw XMLInvalidBuildFileException (
-                               e.location,
-                               "<importlibrary> is not a valid sub-element of <if>" );
-               }
                if ( importLibrary )
                {
                        throw XMLInvalidBuildFileException (
                SetImportLibrary ( new ImportLibrary ( project, e, this ) );
                subs_invalid = true;
        }
-       else if ( e.name == "if" )
+       else if ( e.name == "if" || e.name == "ifnot" )
        {
-               parseContext.ifData = new If ( e, project, this );
-               if ( pOldIf )
-                       pOldIf->data.ifs.push_back ( parseContext.ifData );
-               else
-                       non_if_data.ifs.push_back ( parseContext.ifData );
-               subs_invalid = false;
-       }
-       else if ( e.name == "ifnot" )
-       {
-               parseContext.ifData = new If ( e, project, this, true );
-               if ( pOldIf )
-                       pOldIf->data.ifs.push_back ( parseContext.ifData );
-               else
-                       non_if_data.ifs.push_back ( parseContext.ifData );
+               const XMLAttribute* name;
+               name = e.GetAttribute ( "property", true );
+               assert( name );
+               const Property *property = project.LookupProperty( name->value );
+               if ( !property )
+               {
+                       // Property not found
+                       throw InvalidOperationException ( __FILE__,
+                                                         __LINE__,
+                                                         "Test on unknown property '%s' at %s",
+                                                         name->value.c_str (), e.location.c_str () );
+               }
+               const XMLAttribute* value;
+               value = e.GetAttribute ( "value", true );
+               assert( value );
+               bool negate = ( e.name == "ifnot" );
+               bool equality = ( property->value == value->value );
+               if ( equality == negate )
+               {
+                       // Failed, skip this element
+                       if ( project.configuration.Verbose )
+                               printf("Skipping 'If' at %s\n", e.location.c_str () );
+                       return;
+               }
                subs_invalid = false;
        }
        else if ( e.name == "compilerflag" )
        {
                CompilerFlag* pCompilerFlag = new CompilerFlag ( project, this, e );
-               if ( parseContext.ifData )
-                       parseContext.ifData->data.compilerFlags.push_back ( pCompilerFlag );
-               else
-                       non_if_data.compilerFlags.push_back ( pCompilerFlag );
+               non_if_data.compilerFlags.push_back ( pCompilerFlag );
                subs_invalid = true;
        }
        else if ( e.name == "linkerflag" )
        }
        else if ( e.name == "linkerscript" )
        {
-               if ( parseContext.ifData )
-               {
-                       throw XMLInvalidBuildFileException (
-                               e.location,
-                               "<linkerscript> is not a valid sub-element of <if>" );
-               }
                if ( linkerScript )
                {
                        throw XMLInvalidBuildFileException (
        }
        else if ( e.name == "pch" )
        {
-               if ( parseContext.ifData )
-               {
-                       throw XMLInvalidBuildFileException (
-                               e.location,
-                               "<pch> is not a valid sub-element of <if>" );
-               }
                if ( pch )
                {
                        throw XMLInvalidBuildFileException (
                if ( project.configuration.CompilationUnitsEnabled )
                {
                        CompilationUnit* pCompilationUnit = new CompilationUnit ( &project, this, &e );
-                       if ( parseContext.ifData )
-                               parseContext.ifData->data.compilationUnits.push_back ( pCompilationUnit );
-                       else
-                               non_if_data.compilationUnits.push_back ( pCompilationUnit );
+                       non_if_data.compilationUnits.push_back ( pCompilationUnit );
                        parseContext.compilationUnit = pCompilationUnit;
                }
                subs_invalid = false;
        }
        for ( size_t i = 0; i < e.subElements.size (); i++ )
                ProcessXMLSubElement ( *e.subElements[i], subdirectory, subpath, parseContext );
-       parseContext.ifData = pOldIf;
        parseContext.compilationUnit = pOldCompilationUnit;
  }
  
@@@ -1128,13 -1070,17 +1070,17 @@@ Module::GetDefaultModuleEntrypoint () c
                case KeyboardLayout:
                case KernelModeDLL:
                case KernelModeDriver:
+             if (Environment::GetArch() == "arm") return "DriverEntry";
                        return "DriverEntry@8";
                case NativeDLL:
-                       return "DllMainCRTStartup@12";
+             if (Environment::GetArch() == "arm") return "DllMainCRTStartup";
+             return "DllMainCRTStartup@12";
                case NativeCUI:
-                       return "NtProcessStartup@4";
+             if (Environment::GetArch() == "arm") return "NtProcessStartup";
+             return "NtProcessStartup@4";            
                case Win32DLL:
                case Win32OCX:
+             if (Environment::GetArch() == "arm") return "DllMain";
                        return "DllMain@12";
                case Win32CUI:
                case Test:
@@@ -1316,14 -1262,6 +1262,14 @@@ Module::GetEntryPoint(bool leadingUnder
                result = "_";
  
        result += entrypoint;
 +
 +      if (Environment::GetArch() == "amd64")
 +      {
 +              size_t at_index = result.find_last_of( '@' );
 +              if ( at_index != result.npos )
 +                      return result.substr (0, at_index );
 +      }
 +
        return result;
  }
  
@@@ -1339,11 -1277,6 +1285,6 @@@ Module::HasFileWithExtension 
                if ( compilationUnit->HasFileWithExtension ( extension ) )
                        return true;
        }
-       for ( i = 0; i < data.ifs.size (); i++ )
-       {
-               if ( HasFileWithExtension ( data.ifs[i]->data, extension ) )
-                       return true;
-       }
        return false;
  }
  
@@@ -1832,34 -1765,6 +1773,6 @@@ ImportLibrary::ImportLibrary ( const Pr
  }
  
  
- If::If ( const XMLElement& node_,
-          const Project& project_,
-          const Module* module_,
-          const bool negated_ )
-       : node(node_), project(project_), module(module_), negated(negated_)
- {
-       const XMLAttribute* att;
-       att = node.GetAttribute ( "property", true );
-       assert(att);
-       property = att->value;
-       att = node.GetAttribute ( "value", true );
-       assert(att);
-       value = att->value;
- }
- If::~If ()
- {
- }
- void
- If::ProcessXML()
- {
- }
  Property::Property ( const XMLElement& node_,
                       const Project& project_,
                       const Module* module_ )
@@@ -577,23 -577,25 +577,25 @@@ void BuildDef32File( DLLSPEC *spec 
  
          if (!(odp->flags & FLAG_PRIVATE)) total++;
  
-         output( "  %s", name );
          switch(odp->type)
          {
          case TYPE_EXTERN:
+             output( "  %s", name );
              is_data = 1;
-             /* fall through */
+             if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD))
+                 output( "=%s", odp->link_name );
+             break;
          case TYPE_VARARGS:
          case TYPE_CDECL:
              /* try to reduce output */
+             output( "  %s", name );
              if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD))
                  output( "=%s", odp->link_name );
              break;
          case TYPE_STDCALL:
          {
              int at_param = strlen(odp->u.func.arg_types) * get_ptr_size();
+             output( "  %s", name );
              if (!kill_at) output( "@%d", at_param );
              if  (odp->flags & FLAG_FORWARD)
              {
              }
              break;
          }
+         case TYPE_FASTCALL:
+         {
+             int at_param = strlen(odp->u.func.arg_types) * get_ptr_size();
+             output( "  @%s", name );
+             if (!kill_at) output( "@%d", at_param );
+             if  (odp->flags & FLAG_FORWARD)
+             {
+                 output( "=@%s", odp->link_name );
+             }
+             else if (strcmp(name, odp->link_name)) /* try to reduce output */
+             {
+                 output( "=@%s", odp->link_name );
+                 if (!kill_at) output( "@%d", at_param );
+             }
+             break;
+         }
          case TYPE_STUB:
          {
+             output( "  %s", name );
              if (!kill_at)
              {
                  const char *check = name + strlen(name);
@@@ -668,16 -687,20 +687,16 @@@ void BuildPedllFile( DLLSPEC *spec 
          return;
      }
  
 -    output( "#include <stdarg.h>\n");
 -    output( "#include \"windef.h\"\n");
 -    output( "#include \"winbase.h\"\n");
 -    output( "#include \"wine/config.h\"\n");
 -    output( "#include \"wine/exception.h\"\n\n");
 +    output( "#include <windows.h>\n");
 +    output( "#include <reactos/debug.h>\n");
  
 -    output( "void __wine_spec_unimplemented_stub( const char *module, const char *function )\n");
 +    output( "DWORD __wine_spec_unimplemented_stub( const char *module, const char *function )\n");
      output( "{\n");
 -    output( "    ULONG_PTR args[2];\n");
 +    output( "    DPRINT1(\"%%s hit stub for %%s\\n\",module,function);");
      output( "\n");
 -    output( "    args[0] = (ULONG_PTR)module;\n");
 -    output( "    args[1] = (ULONG_PTR)function;\n");
 -    output( "    RaiseException( EXCEPTION_WINE_STUB, EH_NONCONTINUABLE, 2, args );\n");
 -    output( "}\n\n");
 +    output( "    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);\n");
 +    output( "    return -1;\n");
 +    output( "}\n");
  
      output( "static const char __wine_spec_file_name[] = \"%s\";\n\n", spec->file_name );