[DDK/XDK/NTOSKRNL/DRIVERS]

Fix incompatible definition of a number of NTOSKRNL data imports. These imports are declared in MS DDK in a way that is usually not how you would declare data imports. The proper way of doing it is using _DECLSPEC_INTRIN_TYPE(dllimport) or in this case NTKERNELAPI, which will cause the compiler to directly dereference the __imp__FooBar symbol. MS has declared some of these variables directly as pointers without using dllimport. This works with MS DDK, since it's import libraries contain aliases (like _FooBar) to the import symbols (__imp__FooBar). Neither MS LINK nor DLLTOOL create these aliases in the import libs, which is good, since hacks like these are dangerous. To make the original declarations work without using macros (which can conflict with other things, like for example the KdDebuggerEnabled member in KUSER_SHARED_DATA) these aliases have to be generated differently. Luckily both MSVC and GCC support a pragma that does exactly this. Fix the incompatible use in our drivers and the broen(!) use of KdDebuggerEnabled in kdcom (which was writing a PBOOLEAN value (FALSE == 0 == NULL, so no warning) into the location that is really a BOOLEAN, possibly overwriting other data. Finally get rid of a number of hacks in ntoskrnl, where prefixed versions were used to not conflict with the DDK definitions.

svn path=/trunk/; revision=63247
This commit is contained in:
Timo Kreuzer 2014-05-11 23:11:16 +00:00
parent bbfd5abfca
commit df0efd5556
51 changed files with 318 additions and 293 deletions

View file

@ -38,7 +38,7 @@ KdpSendBuffer(
* \brief Receives data from the KD port and fills a buffer.
* \param Buffer Pointer to a buffer that receives the data.
* \param Size Size of data to receive in bytes.
* \return KDP_PACKET_RECEIVED if successful.
* \return KDP_PACKET_RECEIVED if successful.
* KDP_PACKET_TIMEOUT if the receice timed out.
*/
KDP_STATUS
@ -69,7 +69,7 @@ KdpReceiveBuffer(
* \name KdpReceivePacketLeader
* \brief Receives a packet leadr from the KD port.
* \param PacketLeader Pointer to an ULONG that receives the packet leader.
* \return KDP_PACKET_RECEIVED if successful.
* \return KDP_PACKET_RECEIVED if successful.
* KDP_PACKET_TIMEOUT if the receive timed out.
* KDP_PACKET_RESEND if a breakin byte was detected.
*/
@ -141,7 +141,7 @@ KdpReceivePacketLeader(
while (Index < 4);
/* Enable the debugger */
KdDebuggerNotPresent = FALSE;
KD_DEBUGGER_NOT_PRESENT = FALSE;
SharedUserData->KdDebuggerEnabled |= 0x00000002;
/* Return the received packet leader */

View file

@ -14,7 +14,7 @@
NTSTATUS
NTAPI
BatteryIoctl(IN ULONG IoControlCode,
BatteryIoctl(IN ULONG IoControlCode,
IN PDEVICE_OBJECT DeviceObject,
IN PVOID InputBuffer,
IN ULONG InputBufferLength,
@ -50,11 +50,11 @@ BatteryIoctl(IN ULONG IoControlCode,
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
Status = IoStatusBlock.Status;
}
/* Print failure */
if (!(NT_SUCCESS(Status)) && (CompBattDebug & 8))
DbgPrint("BatteryIoctl: Irp failed - %x\n", Status);
/* Done */
if (CompBattDebug & 0x100) DbgPrint("CompBatt: EXITING BatteryIoctl\n");
}
@ -64,7 +64,7 @@ BatteryIoctl(IN ULONG IoControlCode,
if (CompBattDebug & 8) DbgPrint("BatteryIoctl: couldn't create Irp\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
}
/* Return status */
return Status;
}
@ -82,7 +82,7 @@ CompBattGetDeviceObjectPointer(IN PUNICODE_STRING DeviceName,
PFILE_OBJECT LocalFileObject;
HANDLE DeviceHandle;
PAGED_CODE();
/* Open a file object handle to the device */
InitializeObjectAttributes(&ObjectAttributes, DeviceName, 0, NULL, NULL);
Status = ZwCreateFile(&DeviceHandle,
@ -101,7 +101,7 @@ CompBattGetDeviceObjectPointer(IN PUNICODE_STRING DeviceName,
/* Reference the file object */
Status = ObReferenceObjectByHandle(DeviceHandle,
0,
IoFileObjectType,
*IoFileObjectType,
KernelMode,
(PVOID)&LocalFileObject,
NULL);
@ -111,11 +111,11 @@ CompBattGetDeviceObjectPointer(IN PUNICODE_STRING DeviceName,
*FileObject = LocalFileObject;
*DeviceObject = IoGetRelatedDeviceObject(LocalFileObject);
}
/* Close the handle */
ZwClose(DeviceHandle);
}
/* Return status */
return Status;
}

View file

@ -1552,7 +1552,7 @@ MountMgrVolumeMountPointChanged(IN PDEVICE_EXTENSION DeviceExtension,
}
/* Reference it */
Status = ObReferenceObjectByHandle(Handle, 0, IoFileObjectType, KernelMode, (PVOID *)&FileObject, NULL);
Status = ObReferenceObjectByHandle(Handle, 0, *IoFileObjectType, KernelMode, (PVOID *)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
goto Cleanup;

View file

@ -99,7 +99,7 @@ KspEnableEvent(
KSEVENT Event;
PKSEVENT_ITEM EventItem, FoundEventItem;
PKSEVENTDATA EventData;
const KSEVENT_SET* FoundEventSet;
const KSEVENT_SET *FoundEventSet;
PKSEVENT_ENTRY EventEntry;
ULONG Index, SubIndex, Size;
PVOID Object;
@ -234,7 +234,7 @@ KspEnableEvent(
if (EventData->NotificationType == KSEVENTF_SEMAPHORE_HANDLE)
{
/* get semaphore object handle */
Status = ObReferenceObjectByHandle(EventData->SemaphoreHandle.Semaphore, SEMAPHORE_MODIFY_STATE, ExSemaphoreObjectType, Irp->RequestorMode, &Object, NULL);
Status = ObReferenceObjectByHandle(EventData->SemaphoreHandle.Semaphore, SEMAPHORE_MODIFY_STATE, *ExSemaphoreObjectType, Irp->RequestorMode, &Object, NULL);
if (!NT_SUCCESS(Status))
{
@ -245,7 +245,7 @@ KspEnableEvent(
else if (EventData->NotificationType == KSEVENTF_EVENT_HANDLE)
{
/* get event object handle */
Status = ObReferenceObjectByHandle(EventData->EventHandle.Event, EVENT_MODIFY_STATE, ExEventObjectType, Irp->RequestorMode, &Object, NULL);
Status = ObReferenceObjectByHandle(EventData->EventHandle.Event, EVENT_MODIFY_STATE, *ExEventObjectType, Irp->RequestorMode, &Object, NULL);
if (!NT_SUCCESS(Status))
{

View file

@ -193,7 +193,7 @@ IKsPin_PinMasterClock(
{
Mode = ExGetPreviousMode();
Status = ObReferenceObjectByHandle(*Handle, SYNCHRONIZE | DIRECTORY_QUERY, IoFileObjectType, Mode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(*Handle, SYNCHRONIZE | DIRECTORY_QUERY, *IoFileObjectType, Mode, (PVOID*)&FileObject, NULL);
DPRINT("IKsPin_PinMasterClock ObReferenceObjectByHandle %lx\n", Status);
if (NT_SUCCESS(Status))
@ -2221,7 +2221,7 @@ IKsPin_DispatchCreateClock(
pResolution = &Resolution;
}
Status = KsAllocateDefaultClockEx(&This->DefaultClock,
Status = KsAllocateDefaultClockEx(&This->DefaultClock,
(PVOID)&This->Pin,
(PFNKSSETTIMER)This->Pin.Descriptor->Dispatch->Clock->SetTimer,
(PFNKSCANCELTIMER)This->Pin.Descriptor->Dispatch->Clock->CancelTimer,
@ -2265,7 +2265,7 @@ IKsPin_DispatchCreateNode(
return STATUS_NOT_IMPLEMENTED;
}
static KSDISPATCH_TABLE PinDispatchTable =
static KSDISPATCH_TABLE PinDispatchTable =
{
IKsPin_DispatchDeviceIoControl,
KsDispatchInvalidDeviceRequest,
@ -2329,10 +2329,10 @@ KspCreatePin(
DPRINT("KspCreatePin Index %lu FileAlignment %lx\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].FileAlignment);
DPRINT("KspCreatePin Index %lu MemoryTypeWeight %lx\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].MemoryTypeWeight);
DPRINT("KspCreatePin Index %lu PhysicalRange MinFrameSize %lu MaxFrameSize %lu Stepping %lu\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].PhysicalRange.MinFrameSize,
Descriptor->AllocatorFraming->FramingItem[Index].PhysicalRange.MaxFrameSize,
Descriptor->AllocatorFraming->FramingItem[Index].PhysicalRange.MaxFrameSize,
Descriptor->AllocatorFraming->FramingItem[Index].PhysicalRange.Stepping);
DPRINT("KspCreatePin Index %lu FramingRange MinFrameSize %lu MaxFrameSize %lu Stepping %lu InPlaceWeight %lu NotInPlaceWeight %lu\n",
DPRINT("KspCreatePin Index %lu FramingRange MinFrameSize %lu MaxFrameSize %lu Stepping %lu InPlaceWeight %lu NotInPlaceWeight %lu\n",
Index,
Descriptor->AllocatorFraming->FramingItem[Index].FramingRange.Range.MinFrameSize,
Descriptor->AllocatorFraming->FramingItem[Index].FramingRange.Range.MaxFrameSize,

View file

@ -105,7 +105,7 @@ AfdBindSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp,
0,
NULL,
MAXIMUM_ALLOWED,
IoFileObjectType,
*IoFileObjectType,
Irp->RequestorMode,
&UserHandle);
if (NT_SUCCESS(Status))

View file

@ -289,7 +289,7 @@ AfdEventSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp,
Status = ObReferenceObjectByHandle( (PVOID)EventSelectInfo->
EventObject,
EVENT_ALL_ACCESS,
ExEventObjectType,
*ExEventObjectType,
UserMode,
(PVOID *)&FCB->EventSelect,
NULL );
@ -346,7 +346,7 @@ AfdEnumEvents( PDEVICE_OBJECT DeviceObject, PIRP Irp,
Status = ObReferenceObjectByHandle(EnumReq->Event,
EVENT_ALL_ACCESS,
ExEventObjectType,
*ExEventObjectType,
UserMode,
(PVOID *)&UserEvent,
NULL);

View file

@ -144,7 +144,7 @@ static NTSTATUS TdiOpenDevice(
if (NT_SUCCESS(Status)) {
Status = ObReferenceObjectByHandle(*Handle, /* Handle to open file */
GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, /* Access mode */
IoFileObjectType, /* Object type */
*IoFileObjectType, /* Object type */
KernelMode, /* Access mode */
(PVOID*)Object, /* Pointer to object */
NULL); /* Handle information */

View file

@ -173,7 +173,7 @@ VOID NTAPI DispCancelRequest(
case TDI_CONNECT:
DequeuedIrp = TCPRemoveIRP(TranContext->Handle.ConnectionContext, Irp);
break;
case TDI_DISCONNECT:
Connection = (PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext;
@ -303,7 +303,7 @@ NTSTATUS DispTdiAssociateAddress(
Status = ObReferenceObjectByHandle(
Parameters->AddressHandle,
0,
IoFileObjectType,
*IoFileObjectType,
KernelMode,
(PVOID*)&FileObject,
NULL);
@ -511,7 +511,7 @@ NTSTATUS DispTdiDisconnect(
Status = STATUS_INVALID_PARAMETER;
goto done;
}
Status = DispPrepareIrpForCancel
(TranContext->Handle.ConnectionContext,
Irp,
@ -716,7 +716,7 @@ NTSTATUS DispTdiQueryInformation(
case TDI_CONNECTION_FILE:
Endpoint =
(PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext;
Address->TAAddressCount = 1;
Address->Address[0].AddressLength = TDI_ADDRESS_LENGTH_IP;
Address->Address[0].AddressType = TDI_ADDRESS_TYPE_IP;
@ -761,12 +761,12 @@ NTSTATUS DispTdiQueryInformation(
case TDI_QUERY_MAX_DATAGRAM_INFO:
{
PTDI_MAX_DATAGRAM_INFO MaxDatagramInfo;
if (MmGetMdlByteCount(Irp->MdlAddress) < sizeof(*MaxDatagramInfo)) {
TI_DbgPrint(MID_TRACE, ("MDL buffer too small.\n"));
return STATUS_BUFFER_TOO_SMALL;
}
MaxDatagramInfo = (PTDI_MAX_DATAGRAM_INFO)
MmGetSystemAddressForMdl(Irp->MdlAddress);
@ -1560,7 +1560,7 @@ NTSTATUS DispTdiSetIPAddress( PIRP Irp, PIO_STACK_LOCATION IrpSp ) {
IF->Netmask.Type = IP_ADDRESS_V4;
IF->Netmask.Address.IPv4Address = IpAddrChange->Netmask;
IF->Broadcast.Type = IP_ADDRESS_V4;
IF->Broadcast.Address.IPv4Address =
IF->Unicast.Address.IPv4Address |

View file

@ -761,9 +761,9 @@ InitController(PCONTROLLER_INFO ControllerInfo)
HeadLoadTime = SPECIFY_HLT_500K;
HeadUnloadTime = SPECIFY_HUT_500K;
StepRateTime = SPECIFY_SRT_500K;
INFO_(FLOPPY, "InitController: setting data rate\n");
/* Set data rate */
if(HwSetDataRate(ControllerInfo, DRSR_DSEL_500KBPS) != STATUS_SUCCESS)
{
@ -1176,7 +1176,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
return STATUS_INSUFFICIENT_RESOURCES;
}
if(ObReferenceObjectByHandle(ThreadHandle, STANDARD_RIGHTS_ALL, PsThreadType, KernelMode, &QueueThreadObject, NULL) != STATUS_SUCCESS)
if(ObReferenceObjectByHandle(ThreadHandle, STANDARD_RIGHTS_ALL, *PsThreadType, KernelMode, &QueueThreadObject, NULL) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "Unable to reference returned thread handle; failing init\n");
return STATUS_UNSUCCESSFUL;

View file

@ -97,7 +97,7 @@ WdmAudControlDeviceState(
DPRINT("WdmAudControlDeviceState\n");
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_READ | GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_READ | GENERIC_WRITE, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Error: invalid device handle provided %p Type %x\n", DeviceInfo->hDevice, DeviceInfo->DeviceType);
@ -197,7 +197,7 @@ WdmAudFrameSize(
NTSTATUS Status;
/* Get sysaudio pin file object */
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_WRITE, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Invalid buffer handle %p\n", DeviceInfo->hDevice);
@ -290,7 +290,7 @@ WdmAudResetStream(
DPRINT("WdmAudResetStream\n");
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_READ | GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_READ | GENERIC_WRITE, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Error: invalid device handle provided %p Type %x\n", DeviceInfo->hDevice, DeviceInfo->DeviceType);
@ -528,7 +528,7 @@ WdmAudReadWrite(
ASSERT(DeviceInfo);
/* now get sysaudio file object */
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_WRITE, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Invalid pin handle %p\n", DeviceInfo->hDevice);

View file

@ -165,7 +165,7 @@ WdmAudOpenSysAudioDevices(
}
/* get the file object */
Status = ObReferenceObjectByHandle(hSysAudio, FILE_READ_DATA | FILE_WRITE_DATA, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(hSysAudio, FILE_READ_DATA | FILE_WRITE_DATA, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to reference FileObject %x\n", Status);
@ -200,7 +200,7 @@ WdmAudRegisterDeviceInterface(
}
/* failed to register device interface
* create a symbolic link instead
* create a symbolic link instead
*/
DeviceExtension->DeviceInterfaceSupport = FALSE;

View file

@ -202,7 +202,7 @@ Control(
PFILE_OBJECT FileObject;
/* get file object */
Status = ObReferenceObjectByHandle(hMixer, GENERIC_READ | GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(hMixer, GENERIC_READ | GENERIC_WRITE, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT("failed to reference %p with %lx\n", hMixer, Status);
@ -420,7 +420,7 @@ WdmAudControlOpenMixer(
if (DeviceInfo->u.hNotifyEvent)
{
Status = ObReferenceObjectByHandle(DeviceInfo->u.hNotifyEvent, EVENT_MODIFY_STATE, ExEventObjectType, UserMode, (LPVOID*)&EventObject, NULL);
Status = ObReferenceObjectByHandle(DeviceInfo->u.hNotifyEvent, EVENT_MODIFY_STATE, *ExEventObjectType, UserMode, (LPVOID*)&EventObject, NULL);
if (!NT_SUCCESS(Status))
{

View file

@ -420,7 +420,7 @@ OpenDevice(
if (FileObject)
{
Status = ObReferenceObjectByHandle(hDevice, FILE_READ_DATA | FILE_WRITE_DATA, IoFileObjectType, KernelMode, (PVOID*)FileObject, NULL);
Status = ObReferenceObjectByHandle(hDevice, FILE_READ_DATA | FILE_WRITE_DATA, *IoFileObjectType, KernelMode, (PVOID*)FileObject, NULL);
if (!NT_SUCCESS(Status))
{

View file

@ -50,7 +50,7 @@ OpenDevice(
return Status;
}
Status = ObReferenceObjectByHandle(NodeHandle, GENERIC_READ | GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(NodeHandle, GENERIC_READ | GENERIC_WRITE, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
ZwClose(NodeHandle);

View file

@ -35,7 +35,7 @@ Pin_fnDeviceIoControl(
ASSERT(Context);
/* acquire real pin file object */
Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
Irp->IoStatus.Information = 0;
@ -94,7 +94,7 @@ Pin_fnWrite(
}
/* acquire real pin file object */
Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, *IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("failed\n");
@ -235,8 +235,8 @@ CreateMixerPinAndSetFormat(
}
Status = ObReferenceObjectByHandle(PinHandle,
GENERIC_READ | GENERIC_WRITE,
IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
GENERIC_READ | GENERIC_WRITE,
*IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{

View file

@ -1666,14 +1666,12 @@ typedef struct {
#endif
} HAL_DISPATCH, *PHAL_DISPATCH;
/* GCC/MSVC and WDK compatible declaration */
extern NTKERNELAPI HAL_DISPATCH HalDispatchTable;
#if defined(_NTOSKRNL_) || defined(_BLDR_)
#ifdef _NTSYSTEM_
extern HAL_DISPATCH HalDispatchTable;
#define HALDISPATCH (&HalDispatchTable)
#else
/* This is a WDK compatibility definition */
#define HalDispatchTable (&HalDispatchTable)
extern PHAL_DISPATCH HalDispatchTable;
__CREATE_NTOS_DATA_IMPORT_ALIAS(HalDispatchTable)
#define HALDISPATCH HalDispatchTable
#endif

View file

@ -870,11 +870,11 @@ typedef VOID
(NTAPI *PRTL_FREE_STRING_ROUTINE)(
_In_ __drv_freesMem(Mem) _Post_invalid_ PVOID Buffer);
extern const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
extern const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
extern NTKERNELAPI const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
extern NTKERNELAPI const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
#if _WIN32_WINNT >= 0x0600
extern const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
extern NTKERNELAPI const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
#endif
_Function_class_(RTL_HEAP_COMMIT_ROUTINE)
@ -4937,35 +4937,13 @@ FsRtlNotifyStreamFileObject(
_In_ BOOLEAN SafeToRecurse);
#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
#define DO_VERIFY_VOLUME 0x00000002
#define DO_BUFFERED_IO 0x00000004
#define DO_EXCLUSIVE 0x00000008
#define DO_DIRECT_IO 0x00000010
#define DO_MAP_IO_BUFFER 0x00000020
#define DO_DEVICE_HAS_NAME 0x00000040
#define DO_DEVICE_INITIALIZING 0x00000080
#define DO_SYSTEM_BOOT_PARTITION 0x00000100
#define DO_LONG_TERM_REQUESTS 0x00000200
#define DO_NEVER_LAST_DEVICE 0x00000400
#define DO_SHUTDOWN_REGISTERED 0x00000800
#define DO_BUS_ENUMERATED_DEVICE 0x00001000
#define DO_POWER_PAGABLE 0x00002000
#define DO_POWER_INRUSH 0x00004000
#define DO_LOW_PRIORITY_FILESYSTEM 0x00010000
#define DO_SUPPORTS_TRANSACTIONS 0x00040000
#define DO_FORCE_NEITHER_IO 0x00080000
#define DO_VOLUME_DEVICE_OBJECT 0x00100000
#define DO_SYSTEM_SYSTEM_PARTITION 0x00200000
#define DO_SYSTEM_CRITICAL_PARTITION 0x00400000
#define DO_DISALLOW_EXECUTE 0x00800000
extern KSPIN_LOCK IoStatisticsLock;
extern ULONG IoReadOperationCount;
extern ULONG IoWriteOperationCount;
extern ULONG IoOtherOperationCount;
extern LARGE_INTEGER IoReadTransferCount;
extern LARGE_INTEGER IoWriteTransferCount;
extern LARGE_INTEGER IoOtherTransferCount;
extern NTKERNELAPI KSPIN_LOCK IoStatisticsLock;
extern NTKERNELAPI ULONG IoReadOperationCount;
extern NTKERNELAPI ULONG IoWriteOperationCount;
extern NTKERNELAPI ULONG IoOtherOperationCount;
extern NTKERNELAPI LARGE_INTEGER IoReadTransferCount;
extern NTKERNELAPI LARGE_INTEGER IoWriteTransferCount;
extern NTKERNELAPI LARGE_INTEGER IoOtherTransferCount;
#define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64
#define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024
@ -5731,6 +5709,7 @@ SeLocateProcessImageName(
((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->PrimaryToken )
extern NTKERNELAPI PSE_EXPORTS SeExports;
/******************************************************************************
* Process Manager Functions *
******************************************************************************/
@ -8413,26 +8392,31 @@ FsRtlRemovePerFileObjectContext(
(InterlockedDecrement((LONG volatile *)&((FL)->LockRequestsInProgress)));\
}
/* GCC compatible definition, MS one is retarded */
extern NTKERNELAPI const UCHAR * const FsRtlLegalAnsiCharacterArray;
#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray
#ifdef _NTSYSTEM_
extern const UCHAR * const FsRtlLegalAnsiCharacterArray;
#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray
#else
extern const UCHAR * const *FsRtlLegalAnsiCharacterArray;
__CREATE_NTOS_DATA_IMPORT_ALIAS(FsRtlLegalAnsiCharacterArray)
#define LEGAL_ANSI_CHARACTER_ARRAY (*FsRtlLegalAnsiCharacterArray)
#endif
#define FsRtlIsAnsiCharacterWild(C) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
)
#define FsRtlIsAnsiCharacterLegalFat(C, WILD) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_FAT_LEGAL) | \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_FAT_LEGAL) | \
((WILD) ? FSRTL_WILD_CHARACTER : 0 )) \
)
#define FsRtlIsAnsiCharacterLegalHpfs(C, WILD) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_HPFS_LEGAL) | \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_HPFS_LEGAL) | \
((WILD) ? FSRTL_WILD_CHARACTER : 0 )) \
)
#define FsRtlIsAnsiCharacterLegalNtfs(C, WILD) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_NTFS_LEGAL) | \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_NTFS_LEGAL) | \
((WILD) ? FSRTL_WILD_CHARACTER : 0 )) \
)
@ -8460,7 +8444,7 @@ extern NTKERNELAPI const UCHAR * const FsRtlLegalAnsiCharacterArray;
#define FsRtlIsUnicodeCharacterWild(C) ( \
(((C) >= 0x40) ? \
FALSE : \
FlagOn(FsRtlLegalAnsiCharacterArray[(C)], FSRTL_WILD_CHARACTER )) \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(C)], FSRTL_WILD_CHARACTER )) \
)
#define FsRtlInitPerFileContext( _fc, _owner, _inst, _cb) \
@ -8623,7 +8607,7 @@ typedef VOID
(((PSECTION_OBJECT_POINTERS)(FO)->SectionObjectPointer)->SharedCacheMap != NULL) \
)
extern ULONG CcFastMdlReadWait;
extern NTKERNELAPI ULONG CcFastMdlReadWait;
#if (NTDDI_VERSION >= NTDDI_WIN2K)
@ -11005,13 +10989,14 @@ HalGetDmaAlignmentRequirement(
#define HalGetDmaAlignmentRequirement() 1L
#endif
extern NTKERNELAPI PUSHORT NlsOemLeadByteInfo;
#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
#ifdef NLS_MB_CODE_PAGE_TAG
#undef NLS_MB_CODE_PAGE_TAG
#ifdef _NTSYSTEM_
extern PUSHORT NlsOemLeadByteInfo;
#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
#else
extern PUSHORT *NlsOemLeadByteInfo;
__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsOemLeadByteInfo)
#define NLS_OEM_LEAD_BYTE_INFO (*NlsOemLeadByteInfo)
#endif
#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag
#if (NTDDI_VERSION >= NTDDI_VISTA)

View file

@ -25,6 +25,9 @@
#ifndef _WDMDDK_
#define _WDMDDK_
// TEMP HACK!
#define _PROPER_NT_EXPORTS 1
#define WDM_MAJORVERSION 0x06
#define WDM_MINORVERSION 0x00
@ -82,10 +85,13 @@ extern "C" {
#endif
/* For ReactOS */
#if !defined(_NTOSKRNL_) && !defined(_BLDR_)
#if !defined(_NTOSKRNL_) && !defined(_BLDR_) && !defined(_NTSYSTEM_)
#define NTKERNELAPI DECLSPEC_IMPORT
#else
#define NTKERNELAPI
#ifndef _NTSYSTEM_
#define _NTSYSTEM_
#endif
#endif
#if defined(_X86_) && !defined(_NTHAL_)
@ -129,6 +135,29 @@ extern "C" {
#define ALLOC_DATA_PRAGMA 1
#endif
#endif /* _MSC_VER */
/* These macros are used to create aliases for imported data. We need to do
this to have declarations that are compatible with MS DDK */
#ifdef _M_IX86
#define __SYMBOL(_Name) "_"#_Name
#define __IMPORTSYMBOL(_Name) "__imp__"#_Name
#define __IMPORTNAME(_Name) _imp__##_Name
#else
#define __SYMBOL(_Name) #_Name
#define __IMPORTSYMBOL(_Name) "__imp_"#_Name
#define __IMPORTNAME(_Name) __imp_##_Name
#endif
#ifdef _MSC_VER
#define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name) \
__pragma(comment(linker, "/alternatename:"__SYMBOL(_Name) "=" __IMPORTSYMBOL(_Name)))
#else /* !_MSC_VER */
#ifndef __STRINGIFY
#define __STRINGIFY(_exp) #_exp
#endif
#define _Pragma_redifine_extname(_Name, _Target) _Pragma(__STRINGIFY(redefine_extname _Name _Target))
#define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name) \
_Pragma_redifine_extname(_Name,__IMPORTNAME(_Name))
#endif
#if defined(_WIN64)
@ -599,11 +628,19 @@ typedef struct _EXCEPTION_POINTERS {
PCONTEXT ContextRecord;
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
/* MS definition is broken! */
extern BOOLEAN NTSYSAPI NlsMbCodePageTag;
extern BOOLEAN NTSYSAPI NlsMbOemCodePageTag;
#ifdef _NTSYSTEM_
extern BOOLEAN NlsMbCodePageTag;
#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
extern BOOLEAN NlsMbOemCodePageTag;
#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
#else
extern BOOLEAN *NlsMbCodePageTag;
__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsMbCodePageTag)
#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag)
extern BOOLEAN *NlsMbOemCodePageTag;
__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsMbOemCodePageTag)
#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag)
#endif
#define SHORT_LEAST_SIGNIFICANT_BIT 0
#define SHORT_MOST_SIGNIFICANT_BIT 1
@ -1673,6 +1710,7 @@ extern NTSYSAPI volatile CCHAR KeNumberProcessors;
extern NTSYSAPI CCHAR KeNumberProcessors;
#else
extern PCCHAR KeNumberProcessors;
__CREATE_NTOS_DATA_IMPORT_ALIAS(KeNumberProcessors)
#endif
@ -1824,8 +1862,11 @@ typedef enum _MM_SYSTEM_SIZE {
MmLargeSystem
} MM_SYSTEMSIZE;
extern NTKERNELAPI BOOLEAN Mm64BitPhysicalAddress;
extern PVOID MmBadPointer;
#ifndef _NTSYSTEM_
extern PBOOLEAN Mm64BitPhysicalAddress;
__CREATE_NTOS_DATA_IMPORT_ALIAS(Mm64BitPhysicalAddress)
#endif
extern NTKERNELAPI PVOID MmBadPointer;
/******************************************************************************
@ -2098,7 +2139,7 @@ typedef struct _RESOURCE_PERFORMANCE_DATA {
/* Global debug flag */
#if DEVL
extern ULONG NtGlobalFlag;
extern NTKERNELAPI ULONG NtGlobalFlag;
#define IF_NTOS_DEBUG(FlagName) if (NtGlobalFlag & (FLG_##FlagName))
#else
#define IF_NTOS_DEBUG(FlagName) if(FALSE)
@ -7857,6 +7898,7 @@ typedef struct _OBJECT_NAME_INFORMATION {
} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
/* Exported object types */
#ifdef _NTSYSTEM_
extern POBJECT_TYPE NTSYSAPI CmKeyObjectType;
extern POBJECT_TYPE NTSYSAPI ExEventObjectType;
extern POBJECT_TYPE NTSYSAPI ExSemaphoreObjectType;
@ -7864,6 +7906,30 @@ extern POBJECT_TYPE NTSYSAPI IoFileObjectType;
extern POBJECT_TYPE NTSYSAPI PsThreadType;
extern POBJECT_TYPE NTSYSAPI SeTokenObjectType;
extern POBJECT_TYPE NTSYSAPI PsProcessType;
#else
extern POBJECT_TYPE *CmKeyObjectType;
extern POBJECT_TYPE *IoFileObjectType;
extern POBJECT_TYPE *ExEventObjectType;
extern POBJECT_TYPE *ExSemaphoreObjectType;
extern POBJECT_TYPE *TmTransactionManagerObjectType;
extern POBJECT_TYPE *TmResourceManagerObjectType;
extern POBJECT_TYPE *TmEnlistmentObjectType;
extern POBJECT_TYPE *TmTransactionObjectType;
extern POBJECT_TYPE *PsProcessType;
extern POBJECT_TYPE *PsThreadType;
extern POBJECT_TYPE *SeTokenObjectType;
__CREATE_NTOS_DATA_IMPORT_ALIAS(CmKeyObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(IoFileObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(ExEventObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(ExSemaphoreObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(TmTransactionManagerObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(TmResourceManagerObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(TmEnlistmentObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(TmTransactionObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(PsProcessType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(PsThreadType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(SeTokenObjectType)
#endif
/******************************************************************************
@ -8339,7 +8405,7 @@ KeRestoreFloatingPointState(PVOID FloatingState)
#define HIGH_LEVEL 15
#define KI_USER_SHARED_DATA ((ULONG_PTR)(KADDRESS_BASE + 0xFFFE0000))
extern volatile LARGE_INTEGER KeTickCount;
extern NTKERNELAPI volatile LARGE_INTEGER KeTickCount;
#define PAUSE_PROCESSOR __yield();
@ -15770,27 +15836,18 @@ DbgSetDebugPrintCallback(
#endif /* !DBG */
#if defined(__GNUC__)
extern NTKERNELAPI BOOLEAN KdDebuggerNotPresent;
extern NTKERNELAPI BOOLEAN KdDebuggerEnabled;
#define KD_DEBUGGER_ENABLED KdDebuggerEnabled
#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
#elif defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
extern NTKERNELAPI PBOOLEAN KdDebuggerNotPresent;
extern NTKERNELAPI PBOOLEAN KdDebuggerEnabled;
#define KD_DEBUGGER_ENABLED *KdDebuggerEnabled
#define KD_DEBUGGER_NOT_PRESENT *KdDebuggerNotPresent
#else
extern BOOLEAN KdDebuggerNotPresent;
#ifdef _NTSYSTEM_
extern BOOLEAN KdDebuggerEnabled;
#define KD_DEBUGGER_ENABLED KdDebuggerEnabled
extern BOOLEAN KdDebuggerNotPresent;
#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
#else
extern BOOLEAN *KdDebuggerEnabled;
__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerEnabled)
#define KD_DEBUGGER_ENABLED (*KdDebuggerEnabled)
extern BOOLEAN *KdDebuggerNotPresent;
__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerNotPresent)
#define KD_DEBUGGER_NOT_PRESENT (*KdDebuggerNotPresent)
#endif
#if (NTDDI_VERSION >= NTDDI_WIN2K)

View file

@ -120,7 +120,7 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter
#define _SEH3$_EnforceFramePointer() asm volatile ("#\n" : : "m"(*(char*)__builtin_alloca(4)) : "%esp", "memory")
/* CLANG doesn't have asm goto! */
#define _SEH3$_ASM_GOTO(_Label, ...)
#define _SEH3$_ASM_GOTO(...)
int
__attribute__((regparm(3)))
@ -167,7 +167,7 @@ _SEH3$_RegisterTryLevelWithNonVolatiles(
/* This will make GCC use ebp, even if it was disabled by -fomit-frame-pointer */
#define _SEH3$_EnforceFramePointer() asm volatile ("#\n" : : "m"(*(char*)__builtin_alloca(0)) : "%esp", "memory")
#define _SEH3$_ASM_GOTO(_Label, ...) asm goto ("#\n" : : : "memory", ## __VA_ARGS__ : _Label)
#define _SEH3$_ASM_GOTO(...) asm goto ("#\n" : : : "memory" : __VA_ARGS__)
#ifdef __cplusplus
#define _SEH3$_CALL_WRAPPER(_Function, _TrylevelFrame, _DataTable) \
@ -177,7 +177,7 @@ _SEH3$_RegisterTryLevelWithNonVolatiles(
: \
: "m" (*(_TrylevelFrame)), "m" (*(_DataTable)), "c"(__builtin_alloca(0)) \
: "eax", "edx", "memory" \
: _SEH3$_l_HandlerTarget, _SEH3$_l_FilterOrFinally)
: _SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally)
#else
#define _SEH3$_CALL_WRAPPER(_Function, _TrylevelFrame, _DataTable) \
@ -187,7 +187,7 @@ _SEH3$_RegisterTryLevelWithNonVolatiles(
: \
: "m" (*(_TrylevelFrame)), "m" (*(_DataTable)) \
: "eax", "edx", "ecx", "memory" \
: _SEH3$_l_HandlerTarget)
: _SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally)
#endif
/* This is an asm wrapper around _SEH3$_RegisterFrame */
@ -202,10 +202,8 @@ _SEH3$_RegisterTryLevelWithNonVolatiles(
around into places that are never executed. */
#define _SEH3$_SCARE_GCC() \
void *plabel; \
_SEH3$_ASM_GOTO(_SEH3$_l_BeforeTry); \
_SEH3$_ASM_GOTO(_SEH3$_l_HandlerTarget); \
_SEH3$_ASM_GOTO(_SEH3$_l_OnException); \
asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException) \
_SEH3$_ASM_GOTO(_SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally); \
asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException), "p"(&&_SEH3$_l_FilterOrFinally) \
: "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" ); \
goto _SEH3$_l_OnException;

View file

@ -6,7 +6,7 @@ $if (_NTIFS_)
(((PSECTION_OBJECT_POINTERS)(FO)->SectionObjectPointer)->SharedCacheMap != NULL) \
)
extern ULONG CcFastMdlReadWait;
extern NTKERNELAPI ULONG CcFastMdlReadWait;
#if (NTDDI_VERSION >= NTDDI_WIN2K)

View file

@ -271,7 +271,7 @@ typedef struct _RESOURCE_PERFORMANCE_DATA {
/* Global debug flag */
#if DEVL
extern ULONG NtGlobalFlag;
extern NTKERNELAPI ULONG NtGlobalFlag;
#define IF_NTOS_DEBUG(FlagName) if (NtGlobalFlag & (FLG_##FlagName))
#else
#define IF_NTOS_DEBUG(FlagName) if(FALSE)

View file

@ -1580,26 +1580,31 @@ FsRtlRemovePerFileObjectContext(
(InterlockedDecrement((LONG volatile *)&((FL)->LockRequestsInProgress)));\
}
/* GCC compatible definition, MS one is retarded */
extern NTKERNELAPI const UCHAR * const FsRtlLegalAnsiCharacterArray;
#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray
#ifdef _NTSYSTEM_
extern const UCHAR * const FsRtlLegalAnsiCharacterArray;
#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray
#else
extern const UCHAR * const *FsRtlLegalAnsiCharacterArray;
__CREATE_NTOS_DATA_IMPORT_ALIAS(FsRtlLegalAnsiCharacterArray)
#define LEGAL_ANSI_CHARACTER_ARRAY (*FsRtlLegalAnsiCharacterArray)
#endif
#define FsRtlIsAnsiCharacterWild(C) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
)
#define FsRtlIsAnsiCharacterLegalFat(C, WILD) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_FAT_LEGAL) | \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_FAT_LEGAL) | \
((WILD) ? FSRTL_WILD_CHARACTER : 0 )) \
)
#define FsRtlIsAnsiCharacterLegalHpfs(C, WILD) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_HPFS_LEGAL) | \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_HPFS_LEGAL) | \
((WILD) ? FSRTL_WILD_CHARACTER : 0 )) \
)
#define FsRtlIsAnsiCharacterLegalNtfs(C, WILD) ( \
FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_NTFS_LEGAL) | \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_NTFS_LEGAL) | \
((WILD) ? FSRTL_WILD_CHARACTER : 0 )) \
)
@ -1627,7 +1632,7 @@ extern NTKERNELAPI const UCHAR * const FsRtlLegalAnsiCharacterArray;
#define FsRtlIsUnicodeCharacterWild(C) ( \
(((C) >= 0x40) ? \
FALSE : \
FlagOn(FsRtlLegalAnsiCharacterArray[(C)], FSRTL_WILD_CHARACTER )) \
FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(C)], FSRTL_WILD_CHARACTER )) \
)
#define FsRtlInitPerFileContext( _fc, _owner, _inst, _cb) \

View file

@ -269,14 +269,12 @@ typedef struct {
#endif
} HAL_DISPATCH, *PHAL_DISPATCH;
/* GCC/MSVC and WDK compatible declaration */
extern NTKERNELAPI HAL_DISPATCH HalDispatchTable;
#if defined(_NTOSKRNL_) || defined(_BLDR_)
#ifdef _NTSYSTEM_
extern HAL_DISPATCH HalDispatchTable;
#define HALDISPATCH (&HalDispatchTable)
#else
/* This is a WDK compatibility definition */
#define HalDispatchTable (&HalDispatchTable)
extern PHAL_DISPATCH HalDispatchTable;
__CREATE_NTOS_DATA_IMPORT_ALIAS(HalDispatchTable)
#define HALDISPATCH HalDispatchTable
#endif

View file

@ -17,7 +17,7 @@ $if (_WDMDDK_)
#define HIGH_LEVEL 15
#define KI_USER_SHARED_DATA ((ULONG_PTR)(KADDRESS_BASE + 0xFFFE0000))
extern volatile LARGE_INTEGER KeTickCount;
extern NTKERNELAPI volatile LARGE_INTEGER KeTickCount;
#define PAUSE_PROCESSOR __yield();

View file

@ -7037,35 +7037,13 @@ FsRtlNotifyStreamFileObject(
_In_ BOOLEAN SafeToRecurse);
#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
#define DO_VERIFY_VOLUME 0x00000002
#define DO_BUFFERED_IO 0x00000004
#define DO_EXCLUSIVE 0x00000008
#define DO_DIRECT_IO 0x00000010
#define DO_MAP_IO_BUFFER 0x00000020
#define DO_DEVICE_HAS_NAME 0x00000040
#define DO_DEVICE_INITIALIZING 0x00000080
#define DO_SYSTEM_BOOT_PARTITION 0x00000100
#define DO_LONG_TERM_REQUESTS 0x00000200
#define DO_NEVER_LAST_DEVICE 0x00000400
#define DO_SHUTDOWN_REGISTERED 0x00000800
#define DO_BUS_ENUMERATED_DEVICE 0x00001000
#define DO_POWER_PAGABLE 0x00002000
#define DO_POWER_INRUSH 0x00004000
#define DO_LOW_PRIORITY_FILESYSTEM 0x00010000
#define DO_SUPPORTS_TRANSACTIONS 0x00040000
#define DO_FORCE_NEITHER_IO 0x00080000
#define DO_VOLUME_DEVICE_OBJECT 0x00100000
#define DO_SYSTEM_SYSTEM_PARTITION 0x00200000
#define DO_SYSTEM_CRITICAL_PARTITION 0x00400000
#define DO_DISALLOW_EXECUTE 0x00800000
extern KSPIN_LOCK IoStatisticsLock;
extern ULONG IoReadOperationCount;
extern ULONG IoWriteOperationCount;
extern ULONG IoOtherOperationCount;
extern LARGE_INTEGER IoReadTransferCount;
extern LARGE_INTEGER IoWriteTransferCount;
extern LARGE_INTEGER IoOtherTransferCount;
extern NTKERNELAPI KSPIN_LOCK IoStatisticsLock;
extern NTKERNELAPI ULONG IoReadOperationCount;
extern NTKERNELAPI ULONG IoWriteOperationCount;
extern NTKERNELAPI ULONG IoOtherOperationCount;
extern NTKERNELAPI LARGE_INTEGER IoReadTransferCount;
extern NTKERNELAPI LARGE_INTEGER IoWriteTransferCount;
extern NTKERNELAPI LARGE_INTEGER IoOtherTransferCount;
#define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64
#define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024

View file

@ -119,27 +119,18 @@ DbgSetDebugPrintCallback(
#endif /* !DBG */
#if defined(__GNUC__)
extern NTKERNELAPI BOOLEAN KdDebuggerNotPresent;
extern NTKERNELAPI BOOLEAN KdDebuggerEnabled;
#define KD_DEBUGGER_ENABLED KdDebuggerEnabled
#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
#elif defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
extern NTKERNELAPI PBOOLEAN KdDebuggerNotPresent;
extern NTKERNELAPI PBOOLEAN KdDebuggerEnabled;
#define KD_DEBUGGER_ENABLED *KdDebuggerEnabled
#define KD_DEBUGGER_NOT_PRESENT *KdDebuggerNotPresent
#else
extern BOOLEAN KdDebuggerNotPresent;
#ifdef _NTSYSTEM_
extern BOOLEAN KdDebuggerEnabled;
#define KD_DEBUGGER_ENABLED KdDebuggerEnabled
extern BOOLEAN KdDebuggerNotPresent;
#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
#else
extern BOOLEAN *KdDebuggerEnabled;
__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerEnabled)
#define KD_DEBUGGER_ENABLED (*KdDebuggerEnabled)
extern BOOLEAN *KdDebuggerNotPresent;
__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerNotPresent)
#define KD_DEBUGGER_NOT_PRESENT (*KdDebuggerNotPresent)
#endif
#if (NTDDI_VERSION >= NTDDI_WIN2K)

View file

@ -987,6 +987,7 @@ extern NTSYSAPI volatile CCHAR KeNumberProcessors;
extern NTSYSAPI CCHAR KeNumberProcessors;
#else
extern PCCHAR KeNumberProcessors;
__CREATE_NTOS_DATA_IMPORT_ALIAS(KeNumberProcessors)
#endif
$endif (_WDMDDK_)

View file

@ -147,8 +147,11 @@ typedef enum _MM_SYSTEM_SIZE {
MmLargeSystem
} MM_SYSTEMSIZE;
extern NTKERNELAPI BOOLEAN Mm64BitPhysicalAddress;
extern PVOID MmBadPointer;
#ifndef _NTSYSTEM_
extern PBOOLEAN Mm64BitPhysicalAddress;
__CREATE_NTOS_DATA_IMPORT_ALIAS(Mm64BitPhysicalAddress)
#endif
extern NTKERNELAPI PVOID MmBadPointer;
$endif (_WDMDDK_)
$if (_NTDDK_)

View file

@ -1124,13 +1124,14 @@ HalGetDmaAlignmentRequirement(
#define HalGetDmaAlignmentRequirement() 1L
#endif
extern NTKERNELAPI PUSHORT NlsOemLeadByteInfo;
#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
#ifdef NLS_MB_CODE_PAGE_TAG
#undef NLS_MB_CODE_PAGE_TAG
#ifdef _NTSYSTEM_
extern PUSHORT NlsOemLeadByteInfo;
#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
#else
extern PUSHORT *NlsOemLeadByteInfo;
__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsOemLeadByteInfo)
#define NLS_OEM_LEAD_BYTE_INFO (*NlsOemLeadByteInfo)
#endif
#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag
#if (NTDDI_VERSION >= NTDDI_VISTA)

View file

@ -125,6 +125,7 @@ typedef struct _OBJECT_NAME_INFORMATION {
} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
/* Exported object types */
#ifdef _NTSYSTEM_
extern POBJECT_TYPE NTSYSAPI CmKeyObjectType;
extern POBJECT_TYPE NTSYSAPI ExEventObjectType;
extern POBJECT_TYPE NTSYSAPI ExSemaphoreObjectType;
@ -132,6 +133,30 @@ extern POBJECT_TYPE NTSYSAPI IoFileObjectType;
extern POBJECT_TYPE NTSYSAPI PsThreadType;
extern POBJECT_TYPE NTSYSAPI SeTokenObjectType;
extern POBJECT_TYPE NTSYSAPI PsProcessType;
#else
extern POBJECT_TYPE *CmKeyObjectType;
extern POBJECT_TYPE *IoFileObjectType;
extern POBJECT_TYPE *ExEventObjectType;
extern POBJECT_TYPE *ExSemaphoreObjectType;
extern POBJECT_TYPE *TmTransactionManagerObjectType;
extern POBJECT_TYPE *TmResourceManagerObjectType;
extern POBJECT_TYPE *TmEnlistmentObjectType;
extern POBJECT_TYPE *TmTransactionObjectType;
extern POBJECT_TYPE *PsProcessType;
extern POBJECT_TYPE *PsThreadType;
extern POBJECT_TYPE *SeTokenObjectType;
__CREATE_NTOS_DATA_IMPORT_ALIAS(CmKeyObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(IoFileObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(ExEventObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(ExSemaphoreObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(TmTransactionManagerObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(TmResourceManagerObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(TmEnlistmentObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(TmTransactionObjectType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(PsProcessType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(PsThreadType)
__CREATE_NTOS_DATA_IMPORT_ALIAS(SeTokenObjectType)
#endif
$endif (_WDMDDK_)
$if (_NTIFS_)

View file

@ -197,11 +197,19 @@ typedef struct _EXCEPTION_POINTERS {
PCONTEXT ContextRecord;
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
/* MS definition is broken! */
extern BOOLEAN NTSYSAPI NlsMbCodePageTag;
extern BOOLEAN NTSYSAPI NlsMbOemCodePageTag;
#ifdef _NTSYSTEM_
extern BOOLEAN NlsMbCodePageTag;
#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
extern BOOLEAN NlsMbOemCodePageTag;
#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
#else
extern BOOLEAN *NlsMbCodePageTag;
__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsMbCodePageTag)
#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag)
extern BOOLEAN *NlsMbOemCodePageTag;
__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsMbOemCodePageTag)
#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag)
#endif
#define SHORT_LEAST_SIGNIFICANT_BIT 0
#define SHORT_MOST_SIGNIFICANT_BIT 1
@ -551,11 +559,11 @@ typedef VOID
(NTAPI *PRTL_FREE_STRING_ROUTINE)(
_In_ __drv_freesMem(Mem) _Post_invalid_ PVOID Buffer);
extern const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
extern const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
extern NTKERNELAPI const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
extern NTKERNELAPI const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
#if _WIN32_WINNT >= 0x0600
extern const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
extern NTKERNELAPI const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
#endif
_Function_class_(RTL_HEAP_COMMIT_ROUTINE)

View file

@ -588,4 +588,5 @@ SeLocateProcessImageName(
((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->PrimaryToken )
extern NTKERNELAPI PSE_EXPORTS SeExports;
$endif (_NTIFS_)

View file

@ -82,10 +82,13 @@ extern "C" {
#endif
/* For ReactOS */
#if !defined(_NTOSKRNL_) && !defined(_BLDR_)
#if !defined(_NTOSKRNL_) && !defined(_BLDR_) && !defined(_NTSYSTEM_)
#define NTKERNELAPI DECLSPEC_IMPORT
#else
#define NTKERNELAPI
#ifndef _NTSYSTEM_
#define _NTSYSTEM_
#endif
#endif
#if defined(_X86_) && !defined(_NTHAL_)
@ -129,6 +132,29 @@ extern "C" {
#define ALLOC_DATA_PRAGMA 1
#endif
#endif /* _MSC_VER */
/* These macros are used to create aliases for imported data. We need to do
this to have declarations that are compatible with MS DDK */
#ifdef _M_IX86
#define __SYMBOL(_Name) "_"#_Name
#define __IMPORTSYMBOL(_Name) "__imp__"#_Name
#define __IMPORTNAME(_Name) _imp__##_Name
#else
#define __SYMBOL(_Name) #_Name
#define __IMPORTSYMBOL(_Name) "__imp_"#_Name
#define __IMPORTNAME(_Name) __imp_##_Name
#endif
#ifdef _MSC_VER
#define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name) \
__pragma(comment(linker, "/alternatename:"__SYMBOL(_Name) "=" __IMPORTSYMBOL(_Name)))
#else /* !_MSC_VER */
#ifndef __STRINGIFY
#define __STRINGIFY(_exp) #_exp
#endif
#define _Pragma_redifine_extname(_Name, _Target) _Pragma(__STRINGIFY(redefine_extname _Name _Target))
#define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name) \
_Pragma_redifine_extname(_Name,__IMPORTNAME(_Name))
#endif
#if defined(_WIN64)

View file

@ -31,13 +31,12 @@ BOOLEAN NlsMbOemCodePageTag = FALSE; /* exported */
PWCHAR NlsOemToUnicodeTable = NULL;
PCHAR NlsUnicodeToOemTable =NULL;
PWCHAR NlsDbcsUnicodeToOemTable = NULL;
PUSHORT _NlsOemLeadByteInfo = NULL; /* exported */
PUSHORT NlsOemLeadByteInfo = NULL; /* exported */
USHORT NlsOemDefaultChar = '\0';
USHORT NlsUnicodeDefaultChar = 0;
#define NlsOemLeadByteInfo _NlsOemLeadByteInfo
#define INIT_FUNCTION
/* FUNCTIONS *****************************************************************/

View file

@ -19,7 +19,7 @@
/* GLOBALS *******************************************************************/
POBJECT_TYPE _ExEventObjectType = NULL;
POBJECT_TYPE ExEventObjectType = NULL;
GENERIC_MAPPING ExpEventMapping =
{

View file

@ -19,7 +19,7 @@
/* GLOBALS ******************************************************************/
POBJECT_TYPE _ExSemaphoreObjectType;
POBJECT_TYPE ExSemaphoreObjectType;
GENERIC_MAPPING ExSemaphoreMapping =
{

View file

@ -18,7 +18,7 @@ PERESOURCE FsRtlPagingIoResources;
ULONG FsRtlPagingIoResourceSelector;
NTSTATUS NTAPI INIT_FUNCTION FsRtlInitializeWorkerThread(VOID);
static UCHAR LegalAnsiCharacterArray[] =
static const UCHAR LegalAnsiCharacterArray[] =
{
0, /* CTRL+@, 0x00 */
0, /* CTRL+A, 0x01 */
@ -150,7 +150,7 @@ static UCHAR LegalAnsiCharacterArray[] =
FSRTL_FAT_LEGAL | FSRTL_HPFS_LEGAL | FSRTL_NTFS_LEGAL /* 0x7f */
};
PUCHAR FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray;
const UCHAR * const FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray;
/* PRIVATE FUNCTIONS *********************************************************/

View file

@ -133,5 +133,4 @@ FsRtlInitSystem(
// Global data inside the File System Runtime Library
//
extern PERESOURCE FsRtlPagingIoResources;
extern PUCHAR _FsRtlLegalAnsiCharacterArray;
extern PAGED_LOOKASIDE_LIST FsRtlFileLockLookasideList;

View file

@ -2,18 +2,11 @@
#include <cportlib/cportlib.h>
#ifdef _M_PPC
#define KdDebuggerEnabled _KdDebuggerEnabled
#define KdDebuggerNotPresent _KdDebuggerNotPresent
#endif
//
// Kernel Debugger Port Definition
//
struct _KD_DISPATCH_TABLE;
extern CPPORT GdbPortInfo;
extern BOOLEAN _KdDebuggerEnabled;
extern BOOLEAN _KdDebuggerNotPresent;
extern BOOLEAN KdBreakAfterSymbolLoad;
extern BOOLEAN KdPitchDebugger;
extern BOOLEAN KdIgnoreUmExceptions;

View file

@ -494,8 +494,6 @@ extern PKDEBUG_ROUTINE KiDebugRoutine;
extern PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine;
extern BOOLEAN KdBreakAfterSymbolLoad;
extern BOOLEAN KdPitchDebugger;
extern BOOLEAN _KdDebuggerNotPresent;
extern BOOLEAN _KdDebuggerEnabled;
extern BOOLEAN KdAutoEnableOnEvent;
extern BOOLEAN KdBlockEnable;
extern BOOLEAN KdIgnoreUmExceptions;

View file

@ -90,31 +90,8 @@
//
// Define the internal versions of external and public global data
//
#define IoFileObjectType _IoFileObjectType
#define PsThreadType _PsThreadType
#define PsProcessType _PsProcessType
#define ExEventObjectType _ExEventObjectType
#define ExSemaphoreObjectType _ExSemaphoreObjectType
#define KdDebuggerEnabled _KdDebuggerEnabled
#define KdDebuggerNotPresent _KdDebuggerNotPresent
#define NlsOemLeadByteInfo _NlsOemLeadByteInfo
extern PUSHORT _NlsOemLeadByteInfo;
#define KeNumberProcessors _KeNumberProcessors
extern UCHAR _KeNumberProcessors;
#define FsRtlLegalAnsiCharacterArray _FsRtlLegalAnsiCharacterArray
#undef LEGAL_ANSI_CHARACTER_ARRAY
#undef NLS_MB_CODE_PAGE_TAG
#undef NLS_OEM_LEAD_BYTE_INFO
#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray
#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag
#define NLS_OEM_LEAD_BYTE_INFO _NlsOemLeadByteInfo
#undef KD_DEBUGGER_ENABLED
#undef KD_DEBUGGER_NOT_PRESENT
#define KD_DEBUGGER_ENABLED KdDebuggerEnabled
#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
#define HalDispatchTable _HalDispatchTable
#undef HALDISPATCH
#define HALDISPATCH (&HalDispatchTable)
#define ExRaiseStatus RtlRaiseStatus
/* Internal Headers */

View file

@ -1903,9 +1903,7 @@ KdDisableDebuggerWithLock(IN BOOLEAN NeedLock)
/* We are disabled now */
KdDebuggerEnabled = FALSE;
#undef KdDebuggerEnabled
SharedUserData->KdDebuggerEnabled = FALSE;
#define KdDebuggerEnabled _KdDebuggerEnabled
}
}

View file

@ -79,8 +79,8 @@ PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine;
//
BOOLEAN KdBreakAfterSymbolLoad;
BOOLEAN KdPitchDebugger;
BOOLEAN _KdDebuggerNotPresent;
BOOLEAN _KdDebuggerEnabled;
BOOLEAN KdDebuggerNotPresent;
BOOLEAN KdDebuggerEnabled;
BOOLEAN KdAutoEnableOnEvent;
BOOLEAN KdBlockEnable;
BOOLEAN KdIgnoreUmExceptions;

View file

@ -310,9 +310,7 @@ KdInitSystem(IN ULONG BootPhase,
KdDebuggerEnabled = TRUE;
/* Let user-mode know that it's enabled as well */
#undef KdDebuggerEnabled
SharedUserData->KdDebuggerEnabled = TRUE;
#define KdDebuggerEnabled _KdDebuggerEnabled
/* Check if the debugger should be disabled initially */
if (DisableKdAfterInit)

View file

@ -82,7 +82,7 @@
@ stdcall ExEnterCriticalRegionAndAcquireResourceShared(ptr)
@ stdcall ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(ptr)
@ stdcall ExEnumHandleTable(ptr ptr ptr ptr)
@ extern ExEventObjectType _ExEventObjectType
@ extern ExEventObjectType
@ stdcall ExExtendZone(ptr ptr long)
@ stdcall ExFreeCacheAwareRundownProtection(ptr)
@ stdcall ExFreePool(ptr)
@ -144,7 +144,7 @@
@ fastcall ExReleaseRundownProtectionEx(ptr long) ExfReleaseRundownProtectionEx
@ fastcall ExRundownCompleted(ptr) ExfRundownCompleted
@ fastcall ExRundownCompletedCacheAware(ptr) ExfRundownCompletedCacheAware
@ extern ExSemaphoreObjectType _ExSemaphoreObjectType
@ extern ExSemaphoreObjectType
@ stdcall ExSetResourceOwnerPointer(ptr ptr)
@ stdcall ExSetTimerResolution(long long)
@ stdcall ExSizeOfRundownProtectionCacheAware()
@ -241,7 +241,7 @@
@ stdcall FsRtlIsNtstatusExpected(long)
@ stdcall FsRtlIsPagingFile(ptr)
@ stdcall FsRtlIsTotalDeviceFailure(ptr)
@ extern FsRtlLegalAnsiCharacterArray _FsRtlLegalAnsiCharacterArray
@ extern FsRtlLegalAnsiCharacterArray
@ stdcall FsRtlLookupBaseMcbEntry(ptr long long ptr ptr ptr ptr ptr)
@ stdcall FsRtlLookupLargeMcbEntry(ptr long long ptr ptr ptr ptr ptr)
@ stdcall FsRtlLookupLastBaseMcbEntry(ptr ptr ptr)
@ -302,7 +302,7 @@
@ stdcall FsRtlUninitializeLargeMcb(ptr)
@ stdcall FsRtlUninitializeMcb(ptr)
@ stdcall FsRtlUninitializeOplock(ptr)
@ extern HalDispatchTable _HalDispatchTable
@ extern HalDispatchTable
@ fastcall HalExamineMBR(ptr long long ptr)
@ extern HalPrivateDispatchTable
@ stdcall HeadlessDispatch(long ptr long ptr ptr)
@ -393,7 +393,7 @@
@ stdcall IoEnumerateDeviceObjectList(ptr ptr long ptr)
@ stdcall IoEnumerateRegisteredFiltersList(ptr long ptr)
@ stdcall IoFastQueryNetworkAttributes(ptr long long ptr ptr)
@ extern IoFileObjectType _IoFileObjectType
@ extern IoFileObjectType
@ stdcall IoForwardAndCatchIrp(ptr ptr) IoForwardIrpSynchronously
@ stdcall IoForwardIrpSynchronously(ptr ptr)
@ stdcall IoFreeController(ptr)
@ -533,8 +533,8 @@
@ fastcall IofCallDriver(ptr ptr)
@ fastcall IofCompleteRequest(ptr long)
@ stdcall KdChangeOption(long long ptr long ptr ptr)
@ extern KdDebuggerEnabled _KdDebuggerEnabled
@ extern KdDebuggerNotPresent _KdDebuggerNotPresent
@ extern KdDebuggerEnabled
@ extern KdDebuggerNotPresent
@ stdcall KdDisableDebugger()
@ stdcall KdEnableDebugger()
@ extern KdEnteredDebugger
@ -830,7 +830,7 @@
@ extern NlsMbCodePageTag
@ extern NlsMbOemCodePageTag
@ extern NlsOemCodePage
@ extern NlsOemLeadByteInfo _NlsOemLeadByteInfo
@ extern NlsOemLeadByteInfo
@ stdcall NtAddAtom(wstr long ptr)
@ stdcall NtAdjustPrivilegesToken(ptr long ptr long ptr ptr)
@ stdcall -arch=i386,arm NtAlertThread(ptr)
@ -1011,7 +1011,7 @@
@ stdcall PsLookupProcessByProcessId(ptr ptr)
@ stdcall PsLookupProcessThreadByCid(ptr ptr ptr)
@ stdcall PsLookupThreadByThreadId(ptr ptr)
@ extern PsProcessType _PsProcessType
@ extern PsProcessType
@ stdcall PsReferenceImpersonationToken(ptr ptr ptr ptr)
@ stdcall PsReferencePrimaryToken(ptr)
@ stdcall PsRemoveCreateThreadNotifyRoutine(ptr)
@ -1036,7 +1036,7 @@
@ stdcall PsSetThreadHardErrorsAreDisabled(ptr long)
@ stdcall PsSetThreadWin32Thread(ptr ptr ptr)
@ stdcall PsTerminateSystemThread(long)
@ extern PsThreadType _PsThreadType
@ extern PsThreadType
;PsWrapApcWow64Thread
@ stdcall -arch=i386,arm READ_REGISTER_BUFFER_UCHAR(ptr ptr long)
@ stdcall -arch=i386,arm READ_REGISTER_BUFFER_ULONG(ptr ptr long)

View file

@ -52,7 +52,6 @@ enum
FL_STUB = 2,
FL_NONAME = 4,
FL_ORDINAL = 8,
FL_DATA_ALIAS = 16
};
enum
@ -508,9 +507,7 @@ OutputLine_def(FILE *fileDest, EXPORT *pexp)
fprintf(fileDest, " PRIVATE");
}
/* Make this a data export, unless this is MSVC and -withalias was given */
if ((pexp->nCallingConvention == CC_EXTERN) &&
!(gbMSComp && (pexp->uFlags & FL_DATA_ALIAS)))
if (pexp->nCallingConvention == CC_EXTERN)
{
fprintf(fileDest, " DATA");
}
@ -663,15 +660,6 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine)
{
exp.uFlags |= FL_STUB;
}
else if (CompareToken(pc, "-withalias"))
{
/* This flag is to create a nin _imp_ prefixed alias for a
data export, so that the hacked DDK declarations work */
if (exp.nCallingConvention != CC_EXTERN)
fprintf(stderr, "error: line %d -withalias on non-data export\n", nLine);
else
exp.uFlags |= FL_DATA_ALIAS;
}
else if (CompareToken(pc, "-norelay") ||
CompareToken(pc, "-register") ||
CompareToken(pc, "-ret64"))

View file

@ -134,7 +134,7 @@ EngMapEvent(
/* Create a handle, and have Ob fill out the pKEvent field */
Status = ObReferenceObjectByHandle(EngEvent,
EVENT_ALL_ACCESS,
ExEventObjectType,
*ExEventObjectType,
UserMode,
&EngEvent->pKEvent,
NULL);

View file

@ -320,7 +320,7 @@ UserCreateThreadInfo(struct _ETHREAD *Thread)
goto error;
}
Status = ObReferenceObjectByHandle(ptiCurrent->hEventQueueClient, 0,
ExEventObjectType, KernelMode,
*ExEventObjectType, KernelMode,
(PVOID*)&ptiCurrent->pEventQueueServer, NULL);
if (!NT_SUCCESS(Status))
{

View file

@ -1548,7 +1548,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
{
RETURN(FALSE);
}
ptiSendTo = IntSendTo(Window, Win32Thread, Msg);
if (Msg & 0x80000000 &&
@ -2755,7 +2755,7 @@ NtUserMessageCall( HWND hWnd,
((ClientInfo->CI_flags & CI_CURTHPRHOOK) ? 1 : 0),
(LPARAM)&CWP,
Hook->Proc,
Hook->ihmod,
Hook->ihmod,
Hook->offPfn,
Hook->Ansi,
&Hook->ModuleName);
@ -2774,7 +2774,7 @@ NtUserMessageCall( HWND hWnd,
((ClientInfo->CI_flags & CI_CURTHPRHOOK) ? 1 : 0),
(LPARAM)&CWPR,
Hook->Proc,
Hook->ihmod,
Hook->ihmod,
Hook->offPfn,
Hook->Ansi,
&Hook->ModuleName);
@ -2833,7 +2833,7 @@ NtUserWaitForInputIdle( IN HANDLE hProcess,
Status = ObReferenceObjectByHandle(hProcess,
PROCESS_QUERY_INFORMATION,
PsProcessType,
*PsProcessType,
UserMode,
(PVOID*)&Process,
NULL);

View file

@ -223,7 +223,7 @@ NtUserGetThreadState(
break;
case THREADSTATE_INSENDMESSAGE:
{
PUSER_SENT_MESSAGE Message =
PUSER_SENT_MESSAGE Message =
((PTHREADINFO)PsGetCurrentThreadWin32Thread())->pusmCurrent;
ERR("THREADSTATE_INSENDMESSAGE\n");
@ -243,7 +243,7 @@ NtUserGetThreadState(
if (Message->QS_Flags & QS_SMRESULT) ret |= ISMEX_REPLIED;
}
break;
break;
}
case THREADSTATE_GETMESSAGETIME:
ret = ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->timeLast;
@ -289,7 +289,7 @@ NtUserSetThreadState(
DWORD Ret = 0;
// Test the only flags user can change.
if (Set & ~(QF_FF10STATUS|QF_DIALOGACTIVE|QF_TABSWITCHING|QF_FMENUSTATUS|QF_FMENUSTATUSBREAK)) return 0;
if (Flags & ~(QF_FF10STATUS|QF_DIALOGACTIVE|QF_TABSWITCHING|QF_FMENUSTATUS|QF_FMENUSTATUSBREAK)) return 0;
if (Flags & ~(QF_FF10STATUS|QF_DIALOGACTIVE|QF_TABSWITCHING|QF_FMENUSTATUS|QF_FMENUSTATUSBREAK)) return 0;
UserEnterExclusive();
pti = PsGetCurrentThreadWin32Thread();
if (pti->MessageQueue)
@ -448,7 +448,7 @@ NtUserGetGuiResources(
Status = ObReferenceObjectByHandle(hProcess,
PROCESS_QUERY_INFORMATION,
PsProcessType,
*PsProcessType,
ExGetPreviousMode(),
(PVOID*)&Process,
NULL);
@ -656,7 +656,7 @@ void UserDbgAssertThreadInfo(BOOL showCaller)
ASSERT(pci->ulClientDelta == DesktopHeapGetUserDelta());
if (pti->pcti && pci->pDeskInfo)
ASSERT(pci->pClientThreadInfo == (PVOID)((ULONG_PTR)pti->pcti - pci->ulClientDelta));
if (pti->KeyboardLayout)
if (pti->KeyboardLayout)
ASSERT(pci->hKL == pti->KeyboardLayout->hkl);
if(pti->rpdesk != NULL)
ASSERT(pti->pDeskInfo == pti->rpdesk->pDeskInfo);