ntfs.sys=,,,,,,,,,,,,4
pci.sys=,,,,,,,,,,,,4
scsiport.sys=,,,,,,x,,,,,,4
- uniata.sys=,,,,,,,,,,,,4
fastfat.sys=,,,,,,x,,,,,,4
-ramdisk.sys=,,,,,,x,,,,,,4
-ext2.sys=,,,,,,x,,,,,,4
+;ramdisk.sys=,,,,,,x,,,,,,4
+;ext2.sys=,,,,,,x,,,,,,4
[HardwareIdsDatabase]
*PNP0C08 = acpi
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="idndl" type="win32dll" installname="idndl.dll" entrypoint="0">
<library>kernel32</library>
- <compilerflag compiler="cxx">-fno-exceptions</compilerflag>
- <compilerflag compiler="cxx">-fno-rtti</compilerflag>
+ <group compilerset="gcc">
+ <compilerflag compiler="cxx">-fno-exceptions</compilerflag>
+ <compilerflag compiler="cxx">-fno-rtti</compilerflag>
+ </group>
<redefine name="WINVER">0x600</redefine>
<file>idndl.cpp</file>
- <importlibrary definition="idndl.def" />
+ <importlibrary definition="idndl-$(ARCH).def" />
</module>
InsertTailList(&Peb->Ldr->InLoadOrderModuleList,
&NtModule->InLoadOrderLinks);
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
- &NtModule->InInitializationOrderModuleList);
+ &NtModule->InInitializationOrderLinks);
- #if defined(DBG) || defined(KDBG)
+ #if DBG || defined(KDBG)
LdrpLoadUserModuleSymbols(NtModule);
<file>thread.S</file>
</directory>
</if>
+ <if property="ARCH" value="amd64">
+ <directory name="amd64">
+ <file>fiber.S</file>
+ <file>thread.S</file>
+ </directory>
+ </if>
</directory>
- <compilerflag compiler="cxx">-fno-exceptions</compilerflag>
- <compilerflag compiler="cxx">-fno-rtti</compilerflag>
-
<directory name="misc">
<file>icustubs.cpp</file>
</directory>
Result = GetFreeBytesShare(TotalNumberOfFreeBytes, TotalNumberOfBytes);\r
/* set free bytes percentage */\r
swprintf(szResult, L"%02d%%", Result.QuadPart);\r
- SendDlgItemMessageW(hwndDlg, 14007, WM_SETTEXT, (WPARAM)0, (LPARAM)szResult);\r
+ SendDlgItemMessageW(hwndDlg, 14006, WM_SETTEXT, (WPARAM)0, (LPARAM)szResult);\r
/* store used share amount */\r
- Result = LargeIntegerSubtract(ConvertUlongToLargeInteger(100), Result);\r
+ Result.QuadPart = 100 - Result.QuadPart;\r
swprintf(szResult, L"%02d%%", Result.QuadPart);\r
- SendDlgItemMessageW(hwndDlg, 14005, WM_SETTEXT, (WPARAM)0, (LPARAM)szResult);\r
- if (LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)))\r
- SendDlgItemMessageW(hwndDlg, 14002, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuffer);\r
- \r
+ SendDlgItemMessageW(hwndDlg, 14004, WM_SETTEXT, (WPARAM)0, (LPARAM)szResult);\r
+ if (DriveType == DRIVE_FIXED)\r
+ {\r
+ if (LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)))\r
+ SendDlgItemMessageW(hwndDlg, 14001, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuffer);\r
+ }\r
+ else /* DriveType == DRIVE_CDROM) */\r
+ {\r
+ if (LoadStringW(shell32_hInstance, IDS_DRIVE_CDROM, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)))\r
+ SendDlgItemMessageW(hwndDlg, 14001, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuffer);\r
+ }\r
}\r
}\r
/* set drive description */\r
static const IPersistFolder2Vtbl vt_NP_PersistFolder2;
-#define _IPersistFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpVtblPersistFolder2)))
+#define _IPersistFolder2_Offset ((INT_PTR)(&(((IGenericSFImpl*)0)->lpVtblPersistFolder2)))
#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset);
- #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
- #define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
- #define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2)
+ #define _IUnknown_(This) ((IUnknown*)&(This)->lpVtbl)
+ #define _IShellFolder_(This) ((IShellFolder*)&(This)->lpVtbl)
+ #define _IPersistFolder2_(This) (&(This)->lpVtblPersistFolder2)
static shvheader NetworkPlacesSFHeader[] = {
{IDS_SHV_COLUMN8, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
--- /dev/null
- ;NdisCompareAnsiString ?
- ;NdisCompareUnicodeString ?
+; NDIS Kernel Module - ReactOS Operating System
+
+LIBRARY NDIS.SYS
+
+EXPORTS
+ArcFilterDprIndicateReceive
+ArcFilterDprIndicateReceiveComplete
+EthFilterDprIndicateReceive
+EthFilterDprIndicateReceiveComplete
+FddiFilterDprIndicateReceive
+FddiFilterDprIndicateReceiveComplete
+NDIS_BUFFER_TO_SPAN_PAGES
+NdisAcquireReadWriteLock
+NdisAcquireSpinLock
+NdisAdjustBufferLength
+NdisAllocateBuffer
+NdisAllocateBufferPool
+NdisAllocateDmaChannel
+NdisAllocateMemory
++NdisAllocateFromBlockPool
+NdisAllocateMemoryWithTag
+NdisAllocatePacket
+NdisAllocatePacketPool
+NdisAllocatePacketPoolEx
+NdisAllocateSharedMemory
+NdisAllocateSpinLock
+NdisAnsiStringToUnicodeString
+NdisBufferLength
+NdisBufferVirtualAddress
++NdisCancelSendPackets
+NdisCancelTimer
+NdisClAddParty
+NdisClCloseAddressFamily
+NdisClCloseCall
+NdisClDeregisterSap
+NdisClDropParty
++NdisClGetProtocolVcContextFromTapiCallId
+NdisClIncomingCallComplete
+NdisClMakeCall
+NdisClModifyCallQoS
+NdisClOpenAddressFamily
+NdisClRegisterSap
+NdisCloseAdapter
+NdisCloseConfiguration
+NdisCloseFile
+NdisCmActivateVc
+NdisCmAddPartyComplete
+NdisCmCloseAddressFamilyComplete
+NdisCmCloseCallComplete
+NdisCmDeactivateVc
+NdisCmDeregisterSapComplete
+NdisCmDispatchCallConnected
+NdisCmDispatchIncomingCall
+NdisCmDispatchIncomingCallQoSChange
+NdisCmDispatchIncomingCloseCall
+NdisCmDispatchIncomingDropParty
+NdisCmDropPartyComplete
+NdisCmMakeCallComplete
+NdisCmModifyCallQoSComplete
+NdisCmOpenAddressFamilyComplete
+NdisCmRegisterAddressFamily
+NdisCmRegisterSapComplete
++NdisCoAssignInstanceName
+NdisCoCreateVc
+NdisCoDeleteVc
++NdisCoGetTapiCallId
+NdisCoRequest
+NdisCoRequestComplete
+NdisCoSendPackets
- ;NdisInterlockedAddLargeInterger ?
++NdisCompareAnsiString
++NdisCompareUnicodeString
+NdisCompleteBindAdapter
+NdisCompleteCloseAdapter
+NdisCompleteDmaTransfer
+NdisCompleteOpenAdapter
+NdisCompletePnPEvent
+NdisCompleteQueryStatistics
+NdisCompleteUnbindAdapter
+NdisConvertStringToAtmAddress
+NdisCopyBuffer
+NdisCopyFromPacketToPacket
++NdisCopyFromPacketToPacketSafe
++NdisCreateBlockPool
+NdisDeregisterAdapter
+NdisDeregisterAdapterShutdownHandler
+NdisDeregisterMac
+NdisDeregisterProtocol
++NdisDeregisterTdiCallBack
++NdisDestroyBlockPool
+NdisDprAcquireSpinLock
+NdisDprAllocatePacket
+NdisDprAllocatePacketNonInterlocked
+NdisDprFreePacket
+NdisDprFreePacketNonInterlocked
+NdisDprReleaseSpinLock
+NdisEqualString
+NdisFreeBuffer
+NdisFreeBufferPool
+NdisFreeDmaChannel
++NdisFreeToBlockPool
+NdisFreeMemory
+NdisFreePacket
+NdisFreePacketPool
+NdisFreeSharedMemory
+NdisFreeSpinLock
++NdisGeneratePartialCancelId
+NdisGetBufferPhysicalArraySize
+NdisGetCurrentProcessorCounts
+NdisGetCurrentProcessorCpuUsage
+NdisGetCurrentSystemTime
+NdisGetDriverHandle
+NdisGetFirstBufferFromPacket
++NdisGetFirstBufferFromPacketSafe
++NdisGetPacketCancelId
++NdisGetPoolFromPacket
+NdisGetReceivedPacket
++NdisGetRoutineAddress
++NdisGetSharedDataAlignment
+NdisGetSystemUpTime
++NdisGetVersion
+NdisIMAssociateMiniport
+NdisIMCancelInitializeDeviceInstance
+NdisIMCopySendCompletePerPacketInfo
+NdisIMCopySendPerPacketInfo
+NdisIMDeInitializeDeviceInstance
+NdisIMDeregisterLayeredMiniport
+NdisIMGetBindingContext
++NdisIMGetCurrentPacketStack
+NdisIMGetDeviceContext
+NdisIMInitializeDeviceInstance
+NdisIMInitializeDeviceInstanceEx
++NdisIMNotifyPnPEvent
+NdisImmediateReadPciSlotInformation
+NdisImmediateReadPortUchar
+NdisImmediateReadPortUlong
+NdisImmediateReadPortUshort
+NdisImmediateReadSharedMemory
+NdisImmediateWritePciSlotInformation
+NdisImmediateWritePortUchar
+NdisImmediateWritePortUlong
+NdisImmediateWritePortUshort
+NdisImmediateWriteSharedMemory
+NdisIMQueueMiniportCallback
+NdisIMRegisterLayeredMiniport
+NdisIMRevertBack
+NdisIMSwitchToMiniport
+NdisInitAnsiString
+NdisInitializeEvent
+NdisInitializeReadWriteLock
+NdisInitializeString
+NdisInitializeTimer
+NdisInitializeWrapper
+NdisInitUnicodeString
- ;NdisOverrideBusNumber ?
++NdisInterlockedAddLargeInteger
+NdisInterlockedAddUlong
+NdisInterlockedDecrement
+NdisInterlockedIncrement
+NdisInterlockedInsertHeadList
+NdisInterlockedInsertTailList
+NdisInterlockedPopEntrySList
+NdisInterlockedPushEntrySList
+NdisInterlockedRemoveHeadList
+NdisMAllocateMapRegisters
+NdisMAllocateSharedMemory
+NdisMAllocateSharedMemoryAsync
+NdisMapFile
+NdisMapIoSpace
+;NdisMatchPdoWithPacket ?
+NdisMCancelTimer
+NdisMCloseLog
+NdisMCmActivateVc
+NdisMCmCreateVc
+NdisMCmDeactivateVc
+NdisMCmDeleteVc
+NdisMCmRegisterAddressFamily
+NdisMCmRequest
+NdisMCoActivateVcComplete
+NdisMCoDeactivateVcComplete
+NdisMCoIndicateReceivePacket
+NdisMCoIndicateStatus
+NdisMCompleteBufferPhysicalMapping
+NdisMCoReceiveComplete
+NdisMCoRequestComplete
+NdisMCoSendComplete
+NdisMCreateLog
+NdisMDeregisterAdapterShutdownHandler
+NdisMDeregisterDevice
+NdisMDeregisterDmaChannel
+NdisMDeregisterInterrupt
+NdisMDeregisterIoPortRange
+NdisMFlushLog
+NdisMFreeMapRegisters
+NdisMFreeSharedMemory
+NdisMGetDeviceProperty
+NdisMGetDmaAlignment
+NdisMIndicateStatus
+NdisMIndicateStatusComplete
+NdisMInitializeScatterGatherDma
+NdisMInitializeTimer
+NdisMMapIoSpace
+NdisMPciAssignResources
+NdisMPromoteMiniport
+NdisMQueryAdapterInstanceName
+NdisMQueryAdapterResources
+NdisMQueryInformationComplete
+NdisMReadDmaCounter
+NdisMRegisterAdapterShutdownHandler
+NdisMRegisterDevice
+NdisMRegisterDmaChannel
+NdisMRegisterInterrupt
+NdisMRegisterIoPortRange
+NdisMRegisterMiniport
+NdisMRegisterUnloadHandler
+NdisMRemoveMiniport
+NdisMResetComplete
+NdisMSendComplete
+NdisMSendResourcesAvailable
+NdisMSetAttributes
+NdisMSetAttributesEx
+NdisMSetInformationComplete
+NdisMSetMiniportSecondary
+NdisMSetPeriodicTimer
+NdisMSetTimer
+NdisMSleep
+NdisMStartBufferPhysicalMapping
+NdisMSynchronizeWithInterrupt
+NdisMTransferDataComplete
+NdisMUnmapIoSpace
+NdisMWanIndicateReceive
+NdisMWanIndicateReceiveComplete
+NdisMWanSendComplete
+NdisMWriteLogData
+NdisOpenAdapter
+NdisOpenConfiguration
+NdisOpenConfigurationKeyByIndex
+NdisOpenConfigurationKeyByName
+NdisOpenFile
+NdisOpenProtocolConfiguration
- ;NdisQueryBindInstanceName?
++NdisOverrideBusNumber
+NdisPacketPoolUsage
++NdisPacketSize
+NdisPciAssignResources
+NdisQueryAdapterInstanceName
- ;NdisReEnumerateProtocolBindings ?
++NdisQueryBindInstanceName
+NdisQueryBuffer
+NdisQueryBufferOffset
+NdisQueryBufferSafe
+NdisQueryMapRegisterCount
++NdisQueryPendingIOCount
+NdisReadConfiguration
+NdisReadEisaSlotInformation
+NdisReadEisaSlotInformationEx
+NdisReadMcaPosInformation
+NdisReadNetworkAddress
+NdisReadPciSlotInformation
+NdisReadPcmciaAttributeMemory
- ;NdisRegisterTdiCallBack ?
++NdisReEnumerateProtocolBindings
+NdisRegisterAdapter
+NdisRegisterAdapterShutdownHandler
+NdisRegisterProtocol
- ;NdisSetPacketPoolProtocolId ?
- ;NdisSetProtocolFilter ?
++NdisRegisterTdiCallBack
+NdisReleaseAdapterResources
+NdisReleaseReadWriteLock
+NdisReleaseSpinLock
+NdisRequest
+NdisReset
+NdisResetEvent
+NdisReturnPackets
+NdisSend
+NdisSendPackets
+NdisSetEvent
++NdisSetPacketCancelId
++NdisSetPacketPoolProtocolId
++NdisSetPacketStatus
++NdisSetProtocolFilter
+NdisSetTimer
++NdisSetTimerEx
+NdisSetupDmaTransfer
+NdisSystemProcessorCount
+NdisTerminateWrapper
+NdisTransferData
+NdisUnchainBufferAtBack
+NdisUnchainBufferAtFront
+NdisUnicodeStringToAnsiString
+NdisUnmapFile
+NdisUpcaseUnicodeString
+NdisUpdateSharedMemory
+NdisWaitEvent
+NdisWriteConfiguration
+NdisWriteErrorLogEntry
+NdisWritePciSlotInformation
+NdisWritePcmciaAttributeMemory
+TrFilterDprIndicateReceive
+TrFilterDprIndicateReceiveComplete
+NdisScheduleWorkItem
+
+; EOF
@ stdcall VideoPortAllocateCommonBuffer(ptr ptr long ptr long ptr)
@ stdcall VideoPortAllocateContiguousMemory(ptr long long long)
@ stdcall VideoPortAllocatePool(ptr long long long)
- ;VideoPortAssociateEventsWithDmaHandle
+ @ stdcall VideoPortAssociateEventsWithDmaHandle(ptr ptr ptr ptr)
@ stdcall VideoPortCheckForDeviceExistence(ptr long long long long long long)
+;VideoPortCheckForDeviceExistence there's a second dummy export with the same name on ms videoprt
@ stdcall VideoPortClearEvent(ptr ptr)
@ stdcall VideoPortCompareMemory(ptr ptr long) NTOSKRNL.RtlCompareMemory
- ;VideoPortCompleteDma
+ @ stdcall VideoPortCompleteDma(ptr ptr ptr long)
@ stdcall VideoPortCreateEvent(ptr long ptr ptr)
@ stdcall VideoPortCreateSecondaryDisplay(ptr ptr long)
@ stdcall VideoPortCreateSpinLock(ptr ptr)
@ fastcall VideoPortInterlockedExchange(ptr long) NTOSKRNL.InterlockedExchange
@ fastcall VideoPortInterlockedIncrement(ptr) NTOSKRNL.InterlockedIncrement
@ stdcall VideoPortLockBuffer(ptr ptr long long)
- ;VideoPortLockPages
+;VideoPortIsNoVesa // 2003 and later
+ @ stdcall VideoPortLockPages(ptr ptr ptr ptr long)
@ stdcall VideoPortLogError(ptr ptr long long)
@ stdcall VideoPortMapBankedMemory(ptr long long ptr ptr ptr long long ptr ptr)
- ;VideoPortMapDmaMemory
+ @ stdcall VideoPortMapDmaMemory(ptr ptr double ptr ptr ptr ptr ptr)
@ stdcall VideoPortMapMemory(ptr long long ptr ptr ptr)
@ stdcall VideoPortMoveMemory(ptr ptr long) NTOSKRNL.RtlMoveMemory
+;VideoPortNotification
@ stdcall VideoPortPutDmaAdapter(ptr ptr)
@ stdcall VideoPortQueryPerformanceCounter(ptr ptr)
@ stdcall VideoPortQueryServices(ptr long ptr)
@ stdcall VideoPortQuerySystemTime(ptr) NTOSKRNL.KeQuerySystemTime
@ stdcall VideoPortQueueDpc(ptr ptr ptr)
-@ stdcall VideoPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR
-@ stdcall VideoPortReadPortUshort(ptr) HAL.READ_PORT_USHORT
-@ stdcall VideoPortReadPortUlong(ptr) HAL.READ_PORT_ULONG
@ stdcall VideoPortReadPortBufferUchar(ptr ptr long) HAL.READ_PORT_BUFFER_UCHAR
-@ stdcall VideoPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT
@ stdcall VideoPortReadPortBufferUlong(ptr ptr long) HAL.READ_PORT_BUFFER_ULONG
-@ stdcall VideoPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR
-@ stdcall VideoPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT
-@ stdcall VideoPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG
+@ stdcall VideoPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT
+@ stdcall VideoPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR
+@ stdcall VideoPortReadPortUlong(ptr) HAL.READ_PORT_ULONG
+@ stdcall VideoPortReadPortUshort(ptr) HAL.READ_PORT_USHORT
@ stdcall VideoPortReadRegisterBufferUchar(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_UCHAR
-@ stdcall VideoPortReadRegisterBufferUshort(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_USHORT
@ stdcall VideoPortReadRegisterBufferUlong(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_ULONG
- ;VideoPortReadStateEvent
+@ stdcall VideoPortReadRegisterBufferUshort(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_USHORT
+@ stdcall VideoPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR
+@ stdcall VideoPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG
+@ stdcall VideoPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT
+ @ stdcall VideoPortReadStateEvent(ptr ptr)
@ stdcall VideoPortRegisterBugcheckCallback(ptr long ptr long)
@ stdcall VideoPortReleaseBuffer(ptr ptr)
@ stdcall VideoPortReleaseCommonBuffer(ptr ptr long long long ptr long)
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
- static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * Destination, const char Exchange, const char Comperand)
-__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
++__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * Destination, const char Exchange, const char Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
- static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * Destination, const short Exchange, const short Comperand)
-__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
++__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * Destination, const short Exchange, const short Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
- static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * Destination, const long Exchange, const long Comperand)
-__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
++__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * Destination, const long Exchange, const long Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
- static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * Destination, void * const Exchange, void * const Comperand)
-__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
++__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * Destination, void * const Exchange, void * const Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
- static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * Target, const long Value)
-__INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value)
++__INTRIN_INLINE long _InterlockedExchange(volatile long * Target, const long Value)
{
/* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
__sync_synchronize();
}
#if defined(_M_AMD64)
- static __inline__ __attribute__((always_inline)) long long _InterlockedExchange64(volatile long long * Target, const long long Value)
-__INTRIN_INLINE long long _InterlockedExchange64(volatile long long * const Target, const long long Value)
++__INTRIN_INLINE long long _InterlockedExchange64(volatile long long * Target, const long long Value)
{
/* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
__sync_synchronize();
}
#endif
- static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * Target, void * const Value)
-__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
++__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * Target, void * const Value)
{
/* NOTE: ditto */
__sync_synchronize();
return __sync_lock_test_and_set(Target, Value);
}
- static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd16(volatile short * Addend, const short Value)
-__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
++__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * Addend, const short Value)
{
return __sync_fetch_and_add(Addend, Value);
}
- static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * Addend, const long Value)
-__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value)
++__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * Addend, const long Value)
{
return __sync_fetch_and_add(Addend, Value);
}
#if defined(_M_AMD64)
- static __inline__ __attribute__((always_inline)) long long _InterlockedExchangeAdd64(volatile long long * Addend, const long long Value)
-__INTRIN_INLINE long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value)
++__INTRIN_INLINE long long _InterlockedExchangeAdd64(volatile long long * Addend, const long long Value)
{
return __sync_fetch_and_add(Addend, Value);
}
#endif
- static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * value, const char mask)
-__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask)
++__INTRIN_INLINE char _InterlockedAnd8(volatile char * value, const char mask)
{
return __sync_fetch_and_and(value, mask);
}
- static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * value, const short mask)
-__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask)
++__INTRIN_INLINE short _InterlockedAnd16(volatile short * value, const short mask)
{
return __sync_fetch_and_and(value, mask);
}
- static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * value, const long mask)
-__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask)
++__INTRIN_INLINE long _InterlockedAnd(volatile long * value, const long mask)
{
return __sync_fetch_and_and(value, mask);
}
#if defined(_M_AMD64)
- static __inline__ __attribute__((always_inline)) long _InterlockedAnd64(volatile long long * value, const long long mask)
-__INTRIN_INLINE long _InterlockedAnd64(volatile long long * const value, const long long mask)
++__INTRIN_INLINE long _InterlockedAnd64(volatile long long * value, const long long mask)
{
return __sync_fetch_and_and(value, mask);
}
#endif
- static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * value, const char mask)
-__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask)
++__INTRIN_INLINE char _InterlockedOr8(volatile char * value, const char mask)
{
return __sync_fetch_and_or(value, mask);
}
- static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * value, const short mask)
-__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask)
++__INTRIN_INLINE short _InterlockedOr16(volatile short * value, const short mask)
{
return __sync_fetch_and_or(value, mask);
}
- static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * value, const long mask)
-__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask)
++__INTRIN_INLINE long _InterlockedOr(volatile long * value, const long mask)
{
return __sync_fetch_and_or(value, mask);
}
#if defined(_M_AMD64)
- static __inline__ __attribute__((always_inline)) long _InterlockedOr64(volatile long long * value, const long long mask)
-__INTRIN_INLINE long _InterlockedOr64(volatile long long * const value, const long long mask)
++__INTRIN_INLINE long _InterlockedOr64(volatile long long * value, const long long mask)
{
return __sync_fetch_and_or(value, mask);
}
#endif
- static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * value, const char mask)
-__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask)
++__INTRIN_INLINE char _InterlockedXor8(volatile char * value, const char mask)
{
return __sync_fetch_and_xor(value, mask);
}
- static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * value, const short mask)
-__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask)
++__INTRIN_INLINE short _InterlockedXor16(volatile short * value, const short mask)
{
return __sync_fetch_and_xor(value, mask);
}
- static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask)
-__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask)
++__INTRIN_INLINE long _InterlockedXor(volatile long * value, const long mask)
{
return __sync_fetch_and_xor(value, mask);
}
#else
- static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * Destination, const char Exchange, const char Comperand)
-__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
++__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * Destination, const char Exchange, const char Comperand)
{
char retval = Comperand;
__asm__("lock; cmpxchgb %b[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange) : "memory");
return retval;
}
- static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * Destination, const short Exchange, const short Comperand)
-__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
++__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * Destination, const short Exchange, const short Comperand)
{
short retval = Comperand;
__asm__("lock; cmpxchgw %w[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory");
return retval;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * Destination, const long Exchange, const long Comperand)
-__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
++__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * Destination, const long Exchange, const long Comperand)
{
long retval = Comperand;
__asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory");
return retval;
}
- static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * Destination, void * const Exchange, void * const Comperand)
-__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
++__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * Destination, void * const Exchange, void * const Comperand)
{
void * retval = (void *)Comperand;
__asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "=a" (retval) : "[retval]" (retval), [Destination] "m" (*Destination), [Exchange] "q" (Exchange) : "memory");
return retval;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * Target, const long Value)
-__INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value)
++__INTRIN_INLINE long _InterlockedExchange(volatile long * Target, const long Value)
{
long retval = Value;
__asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
return retval;
}
- static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * Target, void * const Value)
-__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
++__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * Target, void * const Value)
{
void * retval = Value;
__asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
return retval;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd16(volatile short * Addend, const short Value)
-__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
++__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * Addend, const short Value)
{
long retval = Value;
__asm__("lock; xaddw %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
return retval;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * Addend, const long Value)
-__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value)
++__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * Addend, const long Value)
{
long retval = Value;
__asm__("lock; xaddl %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
return retval;
}
- static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * value, const char mask)
-__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask)
++__INTRIN_INLINE char _InterlockedAnd8(volatile char * value, const char mask)
{
char x;
char y;
return y;
}
- static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * value, const short mask)
-__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask)
++__INTRIN_INLINE short _InterlockedAnd16(volatile short * value, const short mask)
{
short x;
short y;
return y;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * value, const long mask)
-__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask)
++__INTRIN_INLINE long _InterlockedAnd(volatile long * value, const long mask)
{
long x;
long y;
return y;
}
- static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * value, const char mask)
-__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask)
++__INTRIN_INLINE char _InterlockedOr8(volatile char * value, const char mask)
{
char x;
char y;
return y;
}
- static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * value, const short mask)
-__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask)
++__INTRIN_INLINE short _InterlockedOr16(volatile short * value, const short mask)
{
short x;
short y;
return y;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * value, const long mask)
-__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask)
++__INTRIN_INLINE long _InterlockedOr(volatile long * value, const long mask)
{
long x;
long y;
return y;
}
- static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * value, const char mask)
-__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask)
++__INTRIN_INLINE char _InterlockedXor8(volatile char * value, const char mask)
{
char x;
char y;
return y;
}
- static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * value, const short mask)
-__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask)
++__INTRIN_INLINE short _InterlockedXor16(volatile short * value, const short mask)
{
short x;
short y;
return y;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * value, const long mask)
-__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask)
++__INTRIN_INLINE long _InterlockedXor(volatile long * value, const long mask)
{
long x;
long y;
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 && defined(__x86_64__)
- static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * Destination, const long long Exchange, const long long Comperand)
-__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand)
++__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * Destination, const long long Exchange, const long long Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
#else
- static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * Destination, const long long Exchange, const long long Comperand)
-__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand)
++__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * Destination, const long long Exchange, const long long Comperand)
{
long long retval = Comperand;
#endif
- static __inline__ __attribute__((always_inline)) long _InterlockedAddLargeStatistic(volatile long long * Addend, const long Value)
-__INTRIN_INLINE long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value)
++__INTRIN_INLINE long _InterlockedAddLargeStatistic(volatile long long * Addend, const long Value)
{
__asm__
(
return Value;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedDecrement(volatile long * lpAddend)
-__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend)
++__INTRIN_INLINE long _InterlockedDecrement(volatile long * lpAddend)
{
return _InterlockedExchangeAdd(lpAddend, -1) - 1;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedIncrement(volatile long * lpAddend)
-__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend)
++__INTRIN_INLINE long _InterlockedIncrement(volatile long * lpAddend)
{
return _InterlockedExchangeAdd(lpAddend, 1) + 1;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedDecrement16(volatile short * lpAddend)
-__INTRIN_INLINE short _InterlockedDecrement16(volatile short * const lpAddend)
++__INTRIN_INLINE short _InterlockedDecrement16(volatile short * lpAddend)
{
return _InterlockedExchangeAdd16(lpAddend, -1) - 1;
}
- static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(volatile short * lpAddend)
-__INTRIN_INLINE short _InterlockedIncrement16(volatile short * const lpAddend)
++__INTRIN_INLINE short _InterlockedIncrement16(volatile short * lpAddend)
{
return _InterlockedExchangeAdd16(lpAddend, 1) + 1;
}
#if defined(_M_AMD64)
- static __inline__ __attribute__((always_inline)) long long _InterlockedDecrement64(volatile long long * lpAddend)
-__INTRIN_INLINE long long _InterlockedDecrement64(volatile long long * const lpAddend)
++__INTRIN_INLINE long long _InterlockedDecrement64(volatile long long * lpAddend)
{
return _InterlockedExchangeAdd64(lpAddend, -1) - 1;
}
- static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement64(volatile long long * lpAddend)
-__INTRIN_INLINE long long _InterlockedIncrement64(volatile long long * const lpAddend)
++__INTRIN_INLINE long long _InterlockedIncrement64(volatile long long * lpAddend)
{
return _InterlockedExchangeAdd64(lpAddend, 1) + 1;
}
Result = KdpPrintString(Buffer1, Buffer1Length);
break;
- #ifdef DBG
+ #if DBG
case TAG('R', 'o', 's', ' '): /* ROS-INTERNAL */
{
- switch ((ULONG)Buffer1)
+ switch ((ULONG_PTR)Buffer1)
{
case DumpNonPagedPool:
MiDebugDumpNonPagedPool(FALSE);
}
/* release a hook chain, removing deleted hooks if the use count drops to 0 */
- static VOID FASTCALL
+ static
+ VOID
+ FASTCALL
IntReleaseHookChain(PHOOKTABLE Table, int HookId, PWINSTATION_OBJECT WinStaObj)
{
- PLIST_ENTRY Elem;
- PHOOK HookObj;
-
- if (NULL == Table)
- {
- return;
- }
-
- /* use count shouldn't already be 0 */
- ASSERT(0 != Table->Counts[HOOKID_TO_INDEX(HookId)]);
- if (0 == Table->Counts[HOOKID_TO_INDEX(HookId)])
- {
- return;
- }
- if (0 == --Table->Counts[HOOKID_TO_INDEX(HookId)])
- {
- Elem = Table->Hooks[HOOKID_TO_INDEX(HookId)].Flink;
- while (Elem != &Table->Hooks[HOOKID_TO_INDEX(HookId)])
- {
- HookObj = CONTAINING_RECORD(Elem, HOOK, Chain);
- Elem = Elem->Flink;
- if (NULL == HookObj->Proc)
- {
- IntFreeHook(Table, HookObj, WinStaObj);
- }
- }
- }
+ PLIST_ENTRY Elem;
+ PHOOK HookObj;
+
+ if (NULL == Table)
+ {
+ return;
+ }
+
+ /* use count shouldn't already be 0 */
+ ASSERT(0 != Table->Counts[HOOKID_TO_INDEX(HookId)]);
+
+ if (0 == Table->Counts[HOOKID_TO_INDEX(HookId)])
+ {
+ return;
+ }
+
+ if (0 == --Table->Counts[HOOKID_TO_INDEX(HookId)])
+ {
+ Elem = Table->Hooks[HOOKID_TO_INDEX(HookId)].Flink;
+
+ while (Elem != &Table->Hooks[HOOKID_TO_INDEX(HookId)])
+ {
+ HookObj = CONTAINING_RECORD(Elem, HOOK, Chain);
+ Elem = Elem->Flink;
+
+ if (NULL == HookObj->Proc)
+ {
+ IntFreeHook(Table, HookObj, WinStaObj);
+ }
+ }
+ }
}
- static LRESULT FASTCALL
+ static
+ LRESULT
+ FASTCALL
IntCallLowLevelHook(PHOOK Hook, INT Code, WPARAM wParam, LPARAM lParam)
{
- NTSTATUS Status;
- ULONG_PTR uResult;
-
- /* FIXME should get timeout from
- * HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
- Status = co_MsqSendMessage(((PTHREADINFO)Hook->Thread->Tcb.Win32Thread)->MessageQueue,
- (HWND)(UINT_PTR)Code,
- Hook->HookId,
- wParam,
- lParam,
- 5000,
- TRUE,
- MSQ_ISHOOK,
- &uResult);
-
- return NT_SUCCESS(Status) ? uResult : 0;
+ NTSTATUS Status;
+ ULONG_PTR uResult;
+
+ /* FIXME should get timeout from
+ * HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
+ Status = co_MsqSendMessage(((PTHREADINFO)Hook->Thread->Tcb.Win32Thread)->MessageQueue,
- (HWND)Code,
++ (HWND)(UINT_PTR)Code,
+ Hook->HookId,
+ wParam,
+ lParam,
+ 5000,
+ TRUE,
+ MSQ_ISHOOK,
+ &uResult);
+
+ return NT_SUCCESS(Status) ? uResult : 0;
}
/*
BOOL
APIENTRY
- NtUserUnhookWindowsHookEx(
- HHOOK Hook)
+ NtUserUnhookWindowsHookEx(HHOOK Hook)
{
- PWINSTATION_OBJECT WinStaObj;
- PHOOK HookObj;
- NTSTATUS Status;
- DECLARE_RETURN(BOOL);
-
- DPRINT("Enter NtUserUnhookWindowsHookEx\n");
- UserEnterExclusive();
-
- Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
- KernelMode,
- 0,
- &WinStaObj);
-
- if (! NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- RETURN( FALSE);
- }
-
- // Status = UserReferenceObjectByHandle(gHandleTable, Hook,
- // otHookProc, (PVOID *) &HookObj);
- if (!(HookObj = IntGetHookObject(Hook)))
- {
- DPRINT1("Invalid handle passed to NtUserUnhookWindowsHookEx\n");
- ObDereferenceObject(WinStaObj);
- // SetLastNtError(Status);
- RETURN( FALSE);
- }
- ASSERT(Hook == HookObj->Self);
-
- IntRemoveHook(HookObj, WinStaObj, FALSE);
-
- UserDereferenceObject(HookObj);
- ObDereferenceObject(WinStaObj);
-
- RETURN( TRUE);
+ PWINSTATION_OBJECT WinStaObj;
+ PHOOK HookObj;
+ NTSTATUS Status;
+ DECLARE_RETURN(BOOL);
+
+ DPRINT("Enter NtUserUnhookWindowsHookEx\n");
+ UserEnterExclusive();
+
+ Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
+ KernelMode,
+ 0,
+ &WinStaObj);
+
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ RETURN( FALSE);
+ }
+
+ /* Status = UserReferenceObjectByHandle(gHandleTable, Hook,
+ otHookProc, (PVOID *) &HookObj); */
+ if (!(HookObj = IntGetHookObject(Hook)))
+ {
+ DPRINT1("Invalid handle passed to NtUserUnhookWindowsHookEx\n");
+ ObDereferenceObject(WinStaObj);
+ /* SetLastNtError(Status); */
+ RETURN( FALSE);
+ }
+
+ ASSERT(Hook == HookObj->Self);
+
+ IntRemoveHook(HookObj, WinStaObj, FALSE);
+
+ UserDereferenceObject(HookObj);
+ ObDereferenceObject(WinStaObj);
+
+ RETURN( TRUE);
CLEANUP:
- DPRINT("Leave NtUserUnhookWindowsHookEx, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
+ DPRINT("Leave NtUserUnhookWindowsHookEx, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
}
-
+
/* EOF */