ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[cwittich] 45797: [PSDK] sync shlwapi.h to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Mar 3 20:40:51 2010 New Revision: 45797 URL:
http://svn.reactos.org/svn/reactos?rev=45797&view=rev
Log: [PSDK] sync shlwapi.h to wine 1.1.39 Modified: trunk/reactos/include/psdk/shlwapi.h Modified: trunk/reactos/include/psdk/shlwapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlwapi.h?rev…
============================================================================== --- trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] Wed Mar 3 20:40:51 2010 @@ -84,6 +84,34 @@ #define SHCopyKey WINELIB_NAME_AW(SHCopyKey) HKEY WINAPI SHRegDuplicateHKey(HKEY); + +/* SHRegGetValue flags */ +typedef INT SRRF; + +#define SRRF_RT_REG_NONE 0x1 +#define SRRF_RT_REG_SZ 0x2 +#define SRRF_RT_REG_EXPAND_SZ 0x4 +#define SRRF_RT_REG_BINARY 0x8 +#define SRRF_RT_REG_DWORD 0x10 +#define SRRF_RT_REG_MULTI_SZ 0x20 +#define SRRF_RT_REG_QWORD 0x40 + +#define SRRF_RT_DWORD (SRRF_RT_REG_BINARY|SRRF_RT_REG_DWORD) +#define SRRF_RT_QWORD (SRRF_RT_REG_BINARY|SRRF_RT_REG_QWORD) +#define SRRF_RT_ANY 0xffff + +#define SRRF_RM_ANY 0 +#define SRRF_RM_NORMAL 0x10000 +#define SRRF_RM_SAFE 0x20000 +#define SRRF_RM_SAFENETWORK 0x40000 + +#define SRRF_NOEXPAND 0x10000000 +#define SRRF_ZEROONFAILURE 0x20000000 +#define SRRF_NOVIRT 0x40000000 + +LSTATUS WINAPI SHRegGetValueA(HKEY,LPCSTR,LPCSTR,SRRF,LPDWORD,LPVOID,LPDWORD); +LSTATUS WINAPI SHRegGetValueW(HKEY,LPCWSTR,LPCWSTR,SRRF,LPDWORD,LPVOID,LPDWORD); +#define SHRegGetValue WINELIB_NAME_AW(SHRegGetValue) /* Undocumented registry functions */ @@ -388,7 +416,7 @@ BOOL WINAPI PathIsFileSpecA(LPCSTR); BOOL WINAPI PathIsFileSpecW(LPCWSTR); -#define PathIsFileSpec WINELIB_NAME_AW(PathIsFileSpec) +#define PathIsFileSpec WINELIB_NAME_AW(PathIsFileSpec); BOOL WINAPI PathIsPrefixA(LPCSTR,LPCSTR); BOOL WINAPI PathIsPrefixW(LPCWSTR,LPCWSTR);
14 years, 9 months
1
0
0
0
[akhaldi] 45796: - Move more stuff to wdm.h - Improve more Io* definitions - Convert IoSetCompletionRoutine, IoSetNextIrpStackLocation and IoSkipCurrentIrpStackLocation to inline functions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 20:24:25 2010 New Revision: 45796 URL:
http://svn.reactos.org/svn/reactos?rev=45796&view=rev
Log: - Move more stuff to wdm.h - Improve more Io* definitions - Convert IoSetCompletionRoutine, IoSetNextIrpStackLocation and IoSkipCurrentIrpStackLocation to inline functions Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 20:24:25 2010 @@ -6574,6 +6574,66 @@ IN PFILE_OBJECT FileObject, IN OUT PSHARE_ACCESS ShareAccess); +NTKERNELAPI +NTSTATUS +IoReportTargetDeviceChange( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PVOID NotificationStructure); + +NTKERNELAPI +NTSTATUS +IoReportTargetDeviceChangeAsynchronous( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PVOID NotificationStructure, + IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, + IN PVOID Context OPTIONAL); + +NTKERNELAPI +VOID +IoRequestDeviceEject( + IN PDEVICE_OBJECT PhysicalDeviceObject); + +NTKERNELAPI +VOID +IoReuseIrp( + IN OUT PIRP Irp, + IN NTSTATUS Status); + +NTKERNELAPI +NTSTATUS +IoSetDeviceInterfaceState( + IN PUNICODE_STRING SymbolicLinkName, + IN BOOLEAN Enable); + +NTKERNELAPI +VOID +IoSetShareAccess( + IN ACCESS_MASK DesiredAccess, + IN ULONG DesiredShareAccess, + IN OUT PFILE_OBJECT FileObject, + OUT PSHARE_ACCESS ShareAccess); + +NTKERNELAPI +VOID +IoStartNextPacket( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN Cancelable); + +NTKERNELAPI +VOID +IoStartNextPacketByKey( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN Cancelable, + IN ULONG Key); + +NTKERNELAPI +VOID +IoStartPacket( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PULONG Key OPTIONAL, + IN PDRIVER_CANCEL CancelFunction OPTIONAL); + #endif #if (NTDDI_VERSION >= NTDDI_WINXP) @@ -6621,7 +6681,105 @@ IoFreeErrorLogEntry( PVOID ElEntry); +NTKERNELAPI +NTSTATUS +IoSetCompletionRoutineEx( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PIO_COMPLETION_ROUTINE CompletionRoutine, + IN PVOID Context, + IN BOOLEAN InvokeOnSuccess, + IN BOOLEAN InvokeOnError, + IN BOOLEAN InvokeOnCancel); + +NTKERNELAPI +VOID +NTAPI +IoSetStartIoAttributes( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN DeferredStartIo, + IN BOOLEAN NonCancelable); + #endif + +/* + * USHORT + * IoSizeOfIrp( + * IN CCHAR StackSize) + */ +#define IoSizeOfIrp(_StackSize) \ + ((USHORT) (sizeof(IRP) + ((_StackSize) * (sizeof(IO_STACK_LOCATION))))) + +FORCEINLINE +VOID +IoSkipCurrentIrpStackLocation ( + IN OUT PIRP Irp) +{ + ASSERT(Irp->CurrentLocation <= Irp->StackCount); + Irp->CurrentLocation++; + Irp->Tail.Overlay.CurrentStackLocation++; +} + +FORCEINLINE +VOID +IoSetNextIrpStackLocation ( + IN OUT PIRP Irp) +{ + ASSERT(Irp->CurrentLocation > 0); + Irp->CurrentLocation--; + Irp->Tail.Overlay.CurrentStackLocation--; +} + +FORCEINLINE +VOID +IoSetCompletionRoutine( + IN PIRP Irp, + IN PIO_COMPLETION_ROUTINE CompletionRoutine OPTIONAL, + IN PVOID Context OPTIONAL, + IN BOOLEAN InvokeOnSuccess, + IN BOOLEAN InvokeOnError, + IN BOOLEAN InvokeOnCancel) +{ + PIO_STACK_LOCATION irpSp; + ASSERT( (InvokeOnSuccess || InvokeOnError || InvokeOnCancel) ? (CompletionRoutine != NULL) : TRUE ); + irpSp = IoGetNextIrpStackLocation(Irp); + irpSp->CompletionRoutine = CompletionRoutine; + irpSp->Context = Context; + irpSp->Control = 0; + + if (InvokeOnSuccess) { + irpSp->Control = SL_INVOKE_ON_SUCCESS; + } + + if (InvokeOnError) { + irpSp->Control |= SL_INVOKE_ON_ERROR; + } + + if (InvokeOnCancel) { + irpSp->Control |= SL_INVOKE_ON_CANCEL; + } +} + +/* + * PDRIVER_CANCEL + * IoSetCancelRoutine( + * IN PIRP Irp, + * IN PDRIVER_CANCEL CancelRoutine) + */ +#define IoSetCancelRoutine(_Irp, \ + _CancelRoutine) \ + ((PDRIVER_CANCEL) (ULONG_PTR) InterlockedExchangePointer( \ + (PVOID *) &(_Irp)->CancelRoutine, (PVOID) (ULONG_PTR) (_CancelRoutine))) + +/* + * VOID + * IoRequestDpc( + * IN PDEVICE_OBJECT DeviceObject, + * IN PIRP Irp, + * IN PVOID Context); + */ +#define IoRequestDpc(DeviceObject, Irp, Context)( \ + KeInsertQueueDpc(&(DeviceObject)->Dpc, (Irp), (Context))) /* * VOID Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 20:24:25 2010 @@ -2755,120 +2755,11 @@ OUT PBOOLEAN ConflictDetected); NTKERNELAPI -NTSTATUS -NTAPI -IoReportTargetDeviceChange( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PVOID NotificationStructure); - -NTKERNELAPI -NTSTATUS -NTAPI -IoReportTargetDeviceChangeAsynchronous( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PVOID NotificationStructure, - IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, - IN PVOID Context OPTIONAL); - -NTKERNELAPI -VOID -NTAPI -IoRequestDeviceEject( - IN PDEVICE_OBJECT PhysicalDeviceObject); - -/* - * VOID - * IoRequestDpc( - * IN PDEVICE_OBJECT DeviceObject, - * IN PIRP Irp, - * IN PVOID Context); - */ -#define IoRequestDpc(DeviceObject, Irp, Context)( \ - KeInsertQueueDpc(&(DeviceObject)->Dpc, (Irp), (Context))) - -NTKERNELAPI -VOID -NTAPI -IoReuseIrp( - IN OUT PIRP Irp, - IN NTSTATUS Status); - -/* - * PDRIVER_CANCEL - * IoSetCancelRoutine( - * IN PIRP Irp, - * IN PDRIVER_CANCEL CancelRoutine) - */ -#define IoSetCancelRoutine(_Irp, \ - _CancelRoutine) \ - ((PDRIVER_CANCEL) InterlockedExchangePointer( \ - (PVOID *) &(_Irp)->CancelRoutine, (PVOID) (_CancelRoutine))) - -/* - * VOID - * IoSetCompletionRoutine( - * IN PIRP Irp, - * IN PIO_COMPLETION_ROUTINE CompletionRoutine, - * IN PVOID Context, - * IN BOOLEAN InvokeOnSuccess, - * IN BOOLEAN InvokeOnError, - * IN BOOLEAN InvokeOnCancel) - */ -#define IoSetCompletionRoutine(_Irp, \ - _CompletionRoutine, \ - _Context, \ - _InvokeOnSuccess, \ - _InvokeOnError, \ - _InvokeOnCancel) \ -{ \ - PIO_STACK_LOCATION _IrpSp; \ - ASSERT((_InvokeOnSuccess) || (_InvokeOnError) || (_InvokeOnCancel) ? \ - (_CompletionRoutine) != NULL : TRUE); \ - _IrpSp = IoGetNextIrpStackLocation(_Irp); \ - _IrpSp->CompletionRoutine = (PIO_COMPLETION_ROUTINE)(_CompletionRoutine); \ - _IrpSp->Context = (_Context); \ - _IrpSp->Control = 0; \ - if (_InvokeOnSuccess) _IrpSp->Control = SL_INVOKE_ON_SUCCESS; \ - if (_InvokeOnError) _IrpSp->Control |= SL_INVOKE_ON_ERROR; \ - if (_InvokeOnCancel) _IrpSp->Control |= SL_INVOKE_ON_CANCEL; \ -} - -NTKERNELAPI -NTSTATUS -NTAPI -IoSetCompletionRoutineEx( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PIO_COMPLETION_ROUTINE CompletionRoutine, - IN PVOID Context, - IN BOOLEAN InvokeOnSuccess, - IN BOOLEAN InvokeOnError, - IN BOOLEAN InvokeOnCancel); - -NTKERNELAPI -NTSTATUS -NTAPI -IoSetDeviceInterfaceState( - IN PUNICODE_STRING SymbolicLinkName, - IN BOOLEAN Enable); - -NTKERNELAPI VOID NTAPI IoSetHardErrorOrVerifyDevice( IN PIRP Irp, IN PDEVICE_OBJECT DeviceObject); - -/* - * VOID - * IoSetNextIrpStackLocation( - * IN OUT PIRP Irp) - */ -#define IoSetNextIrpStackLocation(_Irp) \ -{ \ - (_Irp)->CurrentLocation--; \ - (_Irp)->Tail.Overlay.CurrentStackLocation--; \ -} NTKERNELAPI NTSTATUS @@ -2888,23 +2779,6 @@ IN struct _SET_PARTITION_INFORMATION_EX *PartitionInfo); NTKERNELAPI -VOID -NTAPI -IoSetShareAccess( - IN ACCESS_MASK DesiredAccess, - IN ULONG DesiredShareAccess, - IN OUT PFILE_OBJECT FileObject, - OUT PSHARE_ACCESS ShareAccess); - -NTKERNELAPI -VOID -NTAPI -IoSetStartIoAttributes( - IN PDEVICE_OBJECT DeviceObject, - IN BOOLEAN DeferredStartIo, - IN BOOLEAN NonCancelable); - -NTKERNELAPI NTSTATUS NTAPI IoSetSystemPartition( @@ -2916,48 +2790,8 @@ IoSetThreadHardErrorMode( IN BOOLEAN EnableHardErrors); -/* - * USHORT - * IoSizeOfIrp( - * IN CCHAR StackSize) - */ -#define IoSizeOfIrp(_StackSize) \ - ((USHORT) (sizeof(IRP) + ((_StackSize) * (sizeof(IO_STACK_LOCATION))))) - -/* - * VOID - * IoSkipCurrentIrpStackLocation( - * IN PIRP Irp) - */ -#define IoSkipCurrentIrpStackLocation(_Irp) \ -{ \ - (_Irp)->CurrentLocation++; \ - (_Irp)->Tail.Overlay.CurrentStackLocation++; \ -} - -NTKERNELAPI -VOID -NTAPI -IoStartNextPacket( - IN PDEVICE_OBJECT DeviceObject, - IN BOOLEAN Cancelable); - -NTKERNELAPI -VOID -NTAPI -IoStartNextPacketByKey( - IN PDEVICE_OBJECT DeviceObject, - IN BOOLEAN Cancelable, - IN ULONG Key); - -NTKERNELAPI -VOID -NTAPI -IoStartPacket( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PULONG Key OPTIONAL, - IN PDRIVER_CANCEL CancelFunction OPTIONAL); + + NTKERNELAPI VOID
14 years, 9 months
1
0
0
0
[akhaldi] 45795: - Move more stuff to wdm.h - Improve IoIs32bitProcess and more Io* definitions - Convert IoMarkIrpPending to an inline function- Move more stuff to wdm.h
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 19:30:50 2010 New Revision: 45795 URL:
http://svn.reactos.org/svn/reactos?rev=45795&view=rev
Log: - Move more stuff to wdm.h - Improve IoIs32bitProcess and more Io* definitions - Convert IoMarkIrpPending to an inline function- Move more stuff to wdm.h Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 19:30:50 2010 @@ -6490,6 +6490,90 @@ IN PIO_TIMER_ROUTINE TimerRoutine, IN PVOID Context OPTIONAL); +NTKERNELAPI +VOID +IoInvalidateDeviceRelations( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_RELATION_TYPE Type); + +NTKERNELAPI +VOID +IoInvalidateDeviceState( + IN PDEVICE_OBJECT PhysicalDeviceObject); + +NTKERNELAPI +BOOLEAN +IoIsWdmVersionAvailable( + IN UCHAR MajorVersion, + IN UCHAR MinorVersion); + +NTKERNELAPI +NTSTATUS +IoOpenDeviceInterfaceRegistryKey( + IN PUNICODE_STRING SymbolicLinkName, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE DeviceInterfaceKey); + +NTKERNELAPI +NTSTATUS +IoOpenDeviceRegistryKey( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG DevInstKeyType, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE DevInstRegKey); + +NTKERNELAPI +NTSTATUS +NTAPI +IoRegisterDeviceInterface( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN CONST GUID *InterfaceClassGuid, + IN PUNICODE_STRING ReferenceString OPTIONAL, + OUT PUNICODE_STRING SymbolicLinkName); + +NTKERNELAPI +NTSTATUS +IoRegisterPlugPlayNotification( + IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, + IN ULONG EventCategoryFlags, + IN PVOID EventCategoryData OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, + IN OUT PVOID Context OPTIONAL, + OUT PVOID *NotificationEntry); + +NTKERNELAPI +NTSTATUS +IoRegisterShutdownNotification( + IN PDEVICE_OBJECT DeviceObject); + +NTKERNELAPI +VOID +IoReleaseCancelSpinLock( + IN KIRQL Irql); + +NTKERNELAPI +VOID +NTAPI +IoReleaseRemoveLockAndWaitEx( + IN PIO_REMOVE_LOCK RemoveLock, + IN PVOID Tag OPTIONAL, + IN ULONG RemlockSize); + +NTKERNELAPI +VOID +NTAPI +IoReleaseRemoveLockEx( + IN PIO_REMOVE_LOCK RemoveLock, + IN PVOID Tag OPTIONAL, + IN ULONG RemlockSize); + +NTKERNELAPI +VOID +IoRemoveShareAccess( + IN PFILE_OBJECT FileObject, + IN OUT PSHARE_ACCESS ShareAccess); + #endif #if (NTDDI_VERSION >= NTDDI_WINXP) @@ -6538,6 +6622,61 @@ PVOID ElEntry); #endif + +/* + * VOID + * IoReleaseRemoveLock( + * IN PIO_REMOVE_LOCK RemoveLock, + * IN PVOID Tag) + */ +#define IoReleaseRemoveLock(_RemoveLock, \ + _Tag) \ + IoReleaseRemoveLockEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK)) + +/* + * VOID + * IoReleaseRemoveLockAndWait( + * IN PIO_REMOVE_LOCK RemoveLock, + * IN PVOID Tag) + */ +#define IoReleaseRemoveLockAndWait(_RemoveLock, \ + _Tag) \ + IoReleaseRemoveLockAndWaitEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK)) + +#if defined(_WIN64) + +NTKERNELAPI +BOOLEAN +IoIs32bitProcess( + IN PIRP Irp OPTIONAL); + +#endif + +#define PLUGPLAY_REGKEY_DEVICE 1 +#define PLUGPLAY_REGKEY_DRIVER 2 +#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE 4 + +FORCEINLINE +VOID +IoMarkIrpPending( + IN OUT PIRP Irp) +{ + IoGetCurrentIrpStackLocation( (Irp) )->Control |= SL_PENDING_RETURNED; +} + +/* + * BOOLEAN + * IoIsErrorUserInduced( + * IN NTSTATUS Status); + */ +#define IoIsErrorUserInduced(Status) \ + ((BOOLEAN)(((Status) == STATUS_DEVICE_NOT_READY) || \ + ((Status) == STATUS_IO_TIMEOUT) || \ + ((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \ + ((Status) == STATUS_NO_MEDIA_IN_DEVICE) || \ + ((Status) == STATUS_VERIFY_REQUIRED) || \ + ((Status) == STATUS_UNRECOGNIZED_MEDIA) || \ + ((Status) == STATUS_WRONG_VOLUME))) /* VOID * IoInitializeRemoveLock( Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 19:30:50 2010 @@ -2632,80 +2632,11 @@ VOID); NTKERNELAPI -VOID -NTAPI -IoInvalidateDeviceRelations( - IN PDEVICE_OBJECT DeviceObject, - IN DEVICE_RELATION_TYPE Type); - -NTKERNELAPI -VOID -NTAPI -IoInvalidateDeviceState( - IN PDEVICE_OBJECT PhysicalDeviceObject); - -NTKERNELAPI -BOOLEAN -NTAPI -IoIs32bitProcess( - IN PIRP Irp OPTIONAL); - -/* - * BOOLEAN - * IoIsErrorUserInduced( - * IN NTSTATUS Status); - */ -#define IoIsErrorUserInduced(Status) \ - ((BOOLEAN)(((Status) == STATUS_DEVICE_NOT_READY) || \ - ((Status) == STATUS_IO_TIMEOUT) || \ - ((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \ - ((Status) == STATUS_NO_MEDIA_IN_DEVICE) || \ - ((Status) == STATUS_VERIFY_REQUIRED) || \ - ((Status) == STATUS_UNRECOGNIZED_MEDIA) || \ - ((Status) == STATUS_WRONG_VOLUME))) - -NTKERNELAPI -BOOLEAN -NTAPI -IoIsWdmVersionAvailable( - IN UCHAR MajorVersion, - IN UCHAR MinorVersion); - -NTKERNELAPI PIRP NTAPI IoMakeAssociatedIrp( IN PIRP Irp, IN CCHAR StackSize); - -/* - * VOID - * IoMarkIrpPending( - * IN OUT PIRP Irp) - */ -#define IoMarkIrpPending(_Irp) \ - (IoGetCurrentIrpStackLocation(_Irp)->Control |= SL_PENDING_RETURNED) - -NTKERNELAPI -NTSTATUS -NTAPI -IoOpenDeviceInterfaceRegistryKey( - IN PUNICODE_STRING SymbolicLinkName, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE DeviceInterfaceKey); - -#define PLUGPLAY_REGKEY_DEVICE 1 -#define PLUGPLAY_REGKEY_DRIVER 2 -#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE 4 - -NTKERNELAPI -NTSTATUS -NTAPI -IoOpenDeviceRegistryKey( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG DevInstKeyType, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE DevInstRegKey); NTKERNELAPI NTSTATUS @@ -2777,88 +2708,12 @@ IN PVOID Context); NTKERNELAPI -NTSTATUS -NTAPI -IoRegisterDeviceInterface( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN CONST GUID *InterfaceClassGuid, - IN PUNICODE_STRING ReferenceString OPTIONAL, - OUT PUNICODE_STRING SymbolicLinkName); - -NTKERNELAPI VOID NTAPI IoRegisterDriverReinitialization( IN PDRIVER_OBJECT DriverObject, IN PDRIVER_REINITIALIZE DriverReinitializationRoutine, IN PVOID Context); - -NTKERNELAPI -NTSTATUS -NTAPI -IoRegisterPlugPlayNotification( - IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, - IN ULONG EventCategoryFlags, - IN PVOID EventCategoryData OPTIONAL, - IN PDRIVER_OBJECT DriverObject, - IN PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, - IN PVOID Context, - OUT PVOID *NotificationEntry); - -NTKERNELAPI -NTSTATUS -NTAPI -IoRegisterShutdownNotification( - IN PDEVICE_OBJECT DeviceObject); - -NTKERNELAPI -VOID -NTAPI -IoReleaseCancelSpinLock( - IN KIRQL Irql); - -NTKERNELAPI -VOID -NTAPI -IoReleaseRemoveLockAndWaitEx( - IN PIO_REMOVE_LOCK RemoveLock, - IN PVOID Tag, - IN ULONG RemlockSize); - -NTKERNELAPI -VOID -NTAPI -IoReleaseRemoveLockEx( - IN PIO_REMOVE_LOCK RemoveLock, - IN PVOID Tag, - IN ULONG RemlockSize); - -/* - * VOID - * IoReleaseRemoveLock( - * IN PIO_REMOVE_LOCK RemoveLock, - * IN PVOID Tag) - */ -#define IoReleaseRemoveLock(_RemoveLock, \ - _Tag) \ - IoReleaseRemoveLockEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK)) - -/* - * VOID - * IoReleaseRemoveLockAndWait( - * IN PIO_REMOVE_LOCK RemoveLock, - * IN PVOID Tag) - */ -#define IoReleaseRemoveLockAndWait(_RemoveLock, \ - _Tag) \ - IoReleaseRemoveLockAndWaitEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK)) - -NTKERNELAPI -VOID -NTAPI -IoRemoveShareAccess( - IN PFILE_OBJECT FileObject, - IN OUT PSHARE_ACCESS ShareAccess); NTKERNELAPI NTSTATUS
14 years, 9 months
1
0
0
0
[akhaldi] 45794: - Move more stuff to wdm.h - Improve more Io* definitions - Fix KeInitializeDpc - IoCreateFile and everywhere related : ExtraCreateParameters -> InternalParameters - IoQueueWorkItem and everywhere related : Routine -> WorkerRoutine and pIoWorkItem -> IoWorkItem
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 19:01:23 2010 New Revision: 45794 URL:
http://svn.reactos.org/svn/reactos?rev=45794&view=rev
Log: - Move more stuff to wdm.h - Improve more Io* definitions - Fix KeInitializeDpc - IoCreateFile and everywhere related : ExtraCreateParameters -> InternalParameters - IoQueueWorkItem and everywhere related : Routine -> WorkerRoutine and pIoWorkItem -> IoWorkItem Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h branches/header-work/ntoskrnl/io/iomgr/file.c Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 19:01:23 2010 @@ -6294,7 +6294,283 @@ IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject); +NTKERNELAPI +NTSTATUS +IoCreateFile( + OUT PHANDLE FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PLARGE_INTEGER AllocationSize OPTIONAL, + IN ULONG FileAttributes, + IN ULONG ShareAccess, + IN ULONG Disposition, + IN ULONG CreateOptions, + IN PVOID EaBuffer OPTIONAL, + IN ULONG EaLength, + IN CREATE_FILE_TYPE CreateFileType, + IN PVOID InternalParameters OPTIONAL, + IN ULONG Options); + +NTKERNELAPI +PKEVENT +IoCreateNotificationEvent( + IN PUNICODE_STRING EventName, + OUT PHANDLE EventHandle); + +NTKERNELAPI +NTSTATUS +IoCreateSymbolicLink( + IN PUNICODE_STRING SymbolicLinkName, + IN PUNICODE_STRING DeviceName); + +NTKERNELAPI +PKEVENT +IoCreateSynchronizationEvent( + IN PUNICODE_STRING EventName, + OUT PHANDLE EventHandle); + +NTKERNELAPI +NTSTATUS +IoCreateUnprotectedSymbolicLink( + IN PUNICODE_STRING SymbolicLinkName, + IN PUNICODE_STRING DeviceName); + +NTKERNELAPI +VOID +IoDeleteDevice( + IN PDEVICE_OBJECT DeviceObject); + +NTKERNELAPI +NTSTATUS +IoDeleteSymbolicLink( + IN PUNICODE_STRING SymbolicLinkName); + +NTKERNELAPI +VOID +IoDetachDevice( + IN OUT PDEVICE_OBJECT TargetDevice); + +NTKERNELAPI +VOID +IoDisconnectInterrupt( + IN PKINTERRUPT InterruptObject); + +NTKERNELAPI +VOID +IoFreeIrp( + IN PIRP Irp); + +NTKERNELAPI +VOID +IoFreeMdl( + IN PMDL Mdl); + +NTKERNELAPI +VOID +IoFreeWorkItem( + IN PIO_WORKITEM IoWorkItem); + +NTKERNELAPI +PDEVICE_OBJECT +NTAPI +IoGetAttachedDevice( + IN PDEVICE_OBJECT DeviceObject); + +NTKERNELAPI +PDEVICE_OBJECT +IoGetAttachedDeviceReference( + IN PDEVICE_OBJECT DeviceObject); + +NTKERNELAPI +NTSTATUS +IoGetBootDiskInformation( + IN OUT PBOOTDISK_INFORMATION BootDiskInformation, + IN ULONG Size); + +NTKERNELAPI +NTSTATUS +NTAPI +IoGetDeviceInterfaceAlias( + IN PUNICODE_STRING SymbolicLinkName, + IN CONST GUID *AliasInterfaceClassGuid, + OUT PUNICODE_STRING AliasSymbolicLinkName); + +NTKERNELAPI +PEPROCESS +IoGetCurrentProcess( + VOID); + +NTKERNELAPI +NTSTATUS +NTAPI +IoGetDeviceInterfaces( + IN CONST GUID *InterfaceClassGuid, + IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, + IN ULONG Flags, + OUT PWSTR *SymbolicLinkList); + +NTKERNELAPI +NTSTATUS +IoGetDeviceObjectPointer( + IN PUNICODE_STRING ObjectName, + IN ACCESS_MASK DesiredAccess, + OUT PFILE_OBJECT *FileObject, + OUT PDEVICE_OBJECT *DeviceObject); + +NTKERNELAPI +NTSTATUS +IoGetDeviceProperty( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_REGISTRY_PROPERTY DeviceProperty, + IN ULONG BufferLength, + OUT PVOID PropertyBuffer, + OUT PULONG ResultLength); + +NTKERNELAPI +PDMA_ADAPTER +IoGetDmaAdapter( + IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, + IN PDEVICE_DESCRIPTION DeviceDescription, + IN OUT PULONG NumberOfMapRegisters); + +NTKERNELAPI +PVOID +IoGetDriverObjectExtension( + IN PDRIVER_OBJECT DriverObject, + IN PVOID ClientIdentificationAddress); + +NTKERNELAPI +PVOID +IoGetInitialStack( + VOID); + +NTKERNELAPI +PDEVICE_OBJECT +IoGetRelatedDeviceObject( + IN PFILE_OBJECT FileObject); + +NTKERNELAPI +VOID +IoQueueWorkItem( + IN PIO_WORKITEM IoWorkItem, + IN PIO_WORKITEM_ROUTINE WorkerRoutine, + IN WORK_QUEUE_TYPE QueueType, + IN PVOID Context OPTIONAL); + +NTKERNELAPI +VOID +KeInitializeDpc( + OUT PRKDPC Dpc, + IN PKDEFERRED_ROUTINE DeferredRoutine, + IN PVOID DeferredContext OPTIONAL); + +NTKERNELAPI +VOID +IoInitializeIrp( + IN OUT PIRP Irp, + IN USHORT PacketSize, + IN CCHAR StackSize); + +NTKERNELAPI +VOID +NTAPI +IoInitializeRemoveLockEx( + IN PIO_REMOVE_LOCK Lock, + IN ULONG AllocateTag, + IN ULONG MaxLockedMinutes, + IN ULONG HighWatermark, + IN ULONG RemlockSize); + +NTKERNELAPI +NTSTATUS +NTAPI +IoInitializeTimer( + IN PDEVICE_OBJECT DeviceObject, + IN PIO_TIMER_ROUTINE TimerRoutine, + IN PVOID Context OPTIONAL); + #endif + +#if (NTDDI_VERSION >= NTDDI_WINXP) + +NTKERNELAPI +NTSTATUS +IoCsqInitialize( + IN PIO_CSQ Csq, + IN PIO_CSQ_INSERT_IRP CsqInsertIrp, + IN PIO_CSQ_REMOVE_IRP CsqRemoveIrp, + IN PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, + IN PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, + IN PIO_CSQ_RELEASE_LOCK CsqReleaseLock, + IN PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); + +NTKERNELAPI +VOID +IoCsqInsertIrp( + IN PIO_CSQ Csq, + IN PIRP Irp, + IN PIO_CSQ_IRP_CONTEXT Context OPTIONAL); + +NTKERNELAPI +PIRP +IoCsqRemoveIrp( + IN PIO_CSQ Csq, + IN PIO_CSQ_IRP_CONTEXT Context); + +NTKERNELAPI +PIRP +IoCsqRemoveNextIrp( + IN PIO_CSQ Csq, + IN PVOID PeekContext); + +NTKERNELAPI +BOOLEAN +IoForwardIrpSynchronously( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); + +#define IoForwardAndCatchIrp IoForwardIrpSynchronously + +NTKERNELAPI +VOID +IoFreeErrorLogEntry( + PVOID ElEntry); + +#endif + +/* VOID + * IoInitializeRemoveLock( + * IN PIO_REMOVE_LOCK Lock, + * IN ULONG AllocateTag, + * IN ULONG MaxLockedMinutes, + * IN ULONG HighWatermark) + */ +#define IoInitializeRemoveLock( \ + Lock, AllocateTag, MaxLockedMinutes, HighWatermark) \ + IoInitializeRemoveLockEx(Lock, AllocateTag, MaxLockedMinutes, \ + HighWatermark, sizeof(IO_REMOVE_LOCK)) + +VOID +FORCEINLINE +IoInitializeDpcRequest( + IN PDEVICE_OBJECT DeviceObject, + IN PIO_DPC_ROUTINE DpcRoutine) +{ + KeInitializeDpc( &DeviceObject->Dpc, + (PKDEFERRED_ROUTINE) DpcRoutine, + DeviceObject ); +} + +#define DEVICE_INTERFACE_INCLUDE_NONACTIVE 0x00000001 + +/* + * ULONG + * IoGetFunctionCodeFromCtlCode( + * IN ULONG ControlCode) + */ +#define IoGetFunctionCodeFromCtlCode(_ControlCode) \ + (((_ControlCode) >> 2) & 0x00000FFF) /* * NTSTATUS @@ -6341,6 +6617,24 @@ nextIrpSp = IoGetNextIrpStackLocation(Irp); RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); nextIrpSp->Control = 0; +} + +NTKERNELAPI +VOID +IoGetStackLimits( + OUT PULONG_PTR LowLimit, + OUT PULONG_PTR HighLimit); + +FORCEINLINE +ULONG_PTR +IoGetRemainingStackSize( + VOID) +{ + ULONG_PTR End, Begin; + ULONG_PTR Result; + + IoGetStackLimits(&Begin, &End); + return ((ULONG_PTR)(&End) - Begin); } /****************************************************************************** Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 19:01:23 2010 @@ -2595,103 +2595,10 @@ IN PCREATE_DISK Disk); NTKERNELAPI -NTSTATUS -NTAPI -IoCreateFile( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER AllocationSize OPTIONAL, - IN ULONG FileAttributes, - IN ULONG ShareAccess, - IN ULONG Disposition, - IN ULONG CreateOptions, - IN PVOID EaBuffer OPTIONAL, - IN ULONG EaLength, - IN CREATE_FILE_TYPE CreateFileType, - IN PVOID ExtraCreateParameters OPTIONAL, - IN ULONG Options); - -NTKERNELAPI -PKEVENT -NTAPI -IoCreateNotificationEvent( - IN PUNICODE_STRING EventName, - OUT PHANDLE EventHandle); - -NTKERNELAPI -NTSTATUS -NTAPI -IoCreateSymbolicLink( - IN PUNICODE_STRING SymbolicLinkName, - IN PUNICODE_STRING DeviceName); - -NTKERNELAPI -PKEVENT -NTAPI -IoCreateSynchronizationEvent( - IN PUNICODE_STRING EventName, - OUT PHANDLE EventHandle); - -NTKERNELAPI -NTSTATUS -NTAPI -IoCreateUnprotectedSymbolicLink( - IN PUNICODE_STRING SymbolicLinkName, - IN PUNICODE_STRING DeviceName); - -NTKERNELAPI -NTSTATUS -NTAPI -IoCsqInitialize( - PIO_CSQ Csq, - IN PIO_CSQ_INSERT_IRP CsqInsertIrp, - IN PIO_CSQ_REMOVE_IRP CsqRemoveIrp, - IN PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, - IN PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, - IN PIO_CSQ_RELEASE_LOCK CsqReleaseLock, - IN PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); - -NTKERNELAPI -VOID -NTAPI -IoCsqInsertIrp( - IN PIO_CSQ Csq, - IN PIRP Irp, - IN PIO_CSQ_IRP_CONTEXT Context); - -NTKERNELAPI -PIRP -NTAPI -IoCsqRemoveIrp( - IN PIO_CSQ Csq, - IN PIO_CSQ_IRP_CONTEXT Context); - -NTKERNELAPI -PIRP -NTAPI -IoCsqRemoveNextIrp( - IN PIO_CSQ Csq, - IN PVOID PeekContext); - -NTKERNELAPI VOID NTAPI IoDeleteController( IN PCONTROLLER_OBJECT ControllerObject); - -NTKERNELAPI -VOID -NTAPI -IoDeleteDevice( - IN PDEVICE_OBJECT DeviceObject); - -NTKERNELAPI -NTSTATUS -NTAPI -IoDeleteSymbolicLink( - IN PUNICODE_STRING SymbolicLinkName); /* * VOID @@ -2703,248 +2610,26 @@ NTKERNELAPI VOID NTAPI -IoDetachDevice( - IN OUT PDEVICE_OBJECT TargetDevice); - -NTKERNELAPI -VOID -NTAPI -IoDisconnectInterrupt( - IN PKINTERRUPT InterruptObject); - -NTKERNELAPI -BOOLEAN -NTAPI -IoForwardIrpSynchronously( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); - -#define IoForwardAndCatchIrp IoForwardIrpSynchronously - -NTKERNELAPI -VOID -NTAPI IoFreeController( IN PCONTROLLER_OBJECT ControllerObject); NTKERNELAPI -VOID -NTAPI -IoFreeErrorLogEntry( - PVOID ElEntry); - -NTKERNELAPI -VOID -NTAPI -IoFreeIrp( - IN PIRP Irp); - -NTKERNELAPI -VOID -NTAPI -IoFreeMdl( - IN PMDL Mdl); - -NTKERNELAPI -VOID -NTAPI -IoFreeWorkItem( - IN PIO_WORKITEM pIOWorkItem); - -NTKERNELAPI -PDEVICE_OBJECT -NTAPI -IoGetAttachedDevice( - IN PDEVICE_OBJECT DeviceObject); - -NTKERNELAPI -PDEVICE_OBJECT -NTAPI -IoGetAttachedDeviceReference( - IN PDEVICE_OBJECT DeviceObject); - -NTKERNELAPI -NTSTATUS -NTAPI -IoGetBootDiskInformation( - IN OUT PBOOTDISK_INFORMATION BootDiskInformation, - IN ULONG Size); - -NTKERNELAPI PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation( VOID); NTKERNELAPI -PEPROCESS -NTAPI -IoGetCurrentProcess( - VOID); - -NTKERNELAPI -NTSTATUS -NTAPI -IoGetDeviceInterfaceAlias( - IN PUNICODE_STRING SymbolicLinkName, - IN CONST GUID *AliasInterfaceClassGuid, - OUT PUNICODE_STRING AliasSymbolicLinkName); - -#define DEVICE_INTERFACE_INCLUDE_NONACTIVE 0x00000001 - -NTKERNELAPI -NTSTATUS -NTAPI -IoGetDeviceInterfaces( - IN CONST GUID *InterfaceClassGuid, - IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, - IN ULONG Flags, - OUT PWSTR *SymbolicLinkList); - -NTKERNELAPI -NTSTATUS -NTAPI -IoGetDeviceObjectPointer( - IN PUNICODE_STRING ObjectName, - IN ACCESS_MASK DesiredAccess, - OUT PFILE_OBJECT *FileObject, - OUT PDEVICE_OBJECT *DeviceObject); - -NTKERNELAPI -NTSTATUS -NTAPI -IoGetDeviceProperty( - IN PDEVICE_OBJECT DeviceObject, - IN DEVICE_REGISTRY_PROPERTY DeviceProperty, - IN ULONG BufferLength, - OUT PVOID PropertyBuffer, - OUT PULONG ResultLength); - -NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetDeviceToVerify( IN PETHREAD Thread); NTKERNELAPI -PDMA_ADAPTER -NTAPI -IoGetDmaAdapter( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PDEVICE_DESCRIPTION DeviceDescription, - IN OUT PULONG NumberOfMapRegisters); - -NTKERNELAPI -PVOID -NTAPI -IoGetDriverObjectExtension( - IN PDRIVER_OBJECT DriverObject, - IN PVOID ClientIdentificationAddress); - -NTKERNELAPI PGENERIC_MAPPING NTAPI IoGetFileObjectGenericMapping( VOID); - -/* - * ULONG - * IoGetFunctionCodeFromCtlCode( - * IN ULONG ControlCode) - */ -#define IoGetFunctionCodeFromCtlCode(_ControlCode) \ - (((_ControlCode) >> 2) & 0x00000FFF) - -NTKERNELAPI -PVOID -NTAPI -IoGetInitialStack( - VOID); - -NTKERNELAPI -PDEVICE_OBJECT -NTAPI -IoGetRelatedDeviceObject( - IN PFILE_OBJECT FileObject); - -NTKERNELAPI -VOID -NTAPI -IoGetStackLimits( - OUT PULONG_PTR LowLimit, - OUT PULONG_PTR HighLimit); - -FORCEINLINE -ULONG_PTR -IoGetRemainingStackSize( - VOID -) -{ - ULONG_PTR End, Begin; - ULONG_PTR Result; - - IoGetStackLimits(&Begin, &End); - Result = (ULONG_PTR)(&End) - Begin; - return Result; -} - -NTKERNELAPI -VOID -NTAPI -KeInitializeDpc( - IN PRKDPC Dpc, - IN PKDEFERRED_ROUTINE DeferredRoutine, - IN PVOID DeferredContext); - -/* - * VOID - * IoInitializeDpcRequest( - * IN PDEVICE_OBJECT DeviceObject, - * IN PIO_DPC_ROUTINE DpcRoutine) - */ -#define IoInitializeDpcRequest(_DeviceObject, \ - _DpcRoutine) \ - KeInitializeDpc(&(_DeviceObject)->Dpc, \ - (PKDEFERRED_ROUTINE) (_DpcRoutine), \ - _DeviceObject) - -NTKERNELAPI -VOID -NTAPI -IoInitializeIrp( - IN OUT PIRP Irp, - IN USHORT PacketSize, - IN CCHAR StackSize); - -NTKERNELAPI -VOID -NTAPI -IoInitializeRemoveLockEx( - IN PIO_REMOVE_LOCK Lock, - IN ULONG AllocateTag, - IN ULONG MaxLockedMinutes, - IN ULONG HighWatermark, - IN ULONG RemlockSize); - -/* VOID - * IoInitializeRemoveLock( - * IN PIO_REMOVE_LOCK Lock, - * IN ULONG AllocateTag, - * IN ULONG MaxLockedMinutes, - * IN ULONG HighWatermark) - */ -#define IoInitializeRemoveLock( \ - Lock, AllocateTag, MaxLockedMinutes, HighWatermark) \ - IoInitializeRemoveLockEx(Lock, AllocateTag, MaxLockedMinutes, \ - HighWatermark, sizeof(IO_REMOVE_LOCK)) - -NTKERNELAPI -NTSTATUS -NTAPI -IoInitializeTimer( - IN PDEVICE_OBJECT DeviceObject, - IN PIO_TIMER_ROUTINE TimerRoutine, - IN PVOID Context); NTKERNELAPI VOID @@ -3033,15 +2718,6 @@ IN PCONFIGURATION_TYPE PeripheralType OPTIONAL, IN PULONG PeripheralNumber OPTIONAL, IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine, - IN PVOID Context); - -NTKERNELAPI -VOID -NTAPI -IoQueueWorkItem( - IN PIO_WORKITEM pIOWorkItem, - IN PIO_WORKITEM_ROUTINE Routine, - IN WORK_QUEUE_TYPE QueueType, IN PVOID Context); NTKERNELAPI Modified: branches/header-work/ntoskrnl/io/iomgr/file.c URL:
http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/io/iomgr/f…
============================================================================== --- branches/header-work/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original) +++ branches/header-work/ntoskrnl/io/iomgr/file.c [iso-8859-1] Wed Mar 3 19:01:23 2010 @@ -1655,7 +1655,7 @@ IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength, IN CREATE_FILE_TYPE CreateFileType, - IN PVOID ExtraCreateParameters OPTIONAL, + IN PVOID InternalParameters OPTIONAL, IN ULONG Options) { KPROCESSOR_MODE AccessMode;
14 years, 9 months
1
0
0
0
[akhaldi] 45793: - Move more stuff to wdm.h - Improve IoAcquireRemoveLock(EX) and several Io* - Convert some macros to inline functions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 17:55:25 2010 New Revision: 45793 URL:
http://svn.reactos.org/svn/reactos?rev=45793&view=rev
Log: - Move more stuff to wdm.h - Improve IoAcquireRemoveLock(EX) and several Io* - Convert some macros to inline functions Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 17:55:25 2010 @@ -5652,6 +5652,697 @@ #endif +/** Io access routines **/ + +#if !defined(_M_AMD64) +NTHALAPI +VOID +NTAPI +READ_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +READ_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +READ_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +NTHALAPI +UCHAR +NTAPI +READ_PORT_UCHAR( + IN PUCHAR Port); + +NTHALAPI +ULONG +NTAPI +READ_PORT_ULONG( + IN PULONG Port); + +NTHALAPI +USHORT +NTAPI +READ_PORT_USHORT( + IN PUSHORT Port); + +NTKERNELAPI +VOID +NTAPI +READ_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +READ_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +READ_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +NTKERNELAPI +UCHAR +NTAPI +READ_REGISTER_UCHAR( + IN PUCHAR Register); + +NTKERNELAPI +ULONG +NTAPI +READ_REGISTER_ULONG( + IN PULONG Register); + +NTKERNELAPI +USHORT +NTAPI +READ_REGISTER_USHORT( + IN PUSHORT Register); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_UCHAR( + IN PUCHAR Port, + IN UCHAR Value); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_ULONG( + IN PULONG Port, + IN ULONG Value); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_USHORT( + IN PUSHORT Port, + IN USHORT Value); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_UCHAR( + IN PUCHAR Register, + IN UCHAR Value); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_ULONG( + IN PULONG Register, + IN ULONG Value); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_USHORT( + IN PUSHORT Register, + IN USHORT Value); + +#else + +FORCEINLINE +VOID +READ_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count) +{ + __inbytestring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +READ_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count) +{ + __indwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +READ_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count) +{ + __inwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +UCHAR +READ_PORT_UCHAR( + IN PUCHAR Port) +{ + return __inbyte((USHORT)(ULONG_PTR)Port); +} + +FORCEINLINE +ULONG +READ_PORT_ULONG( + IN PULONG Port) +{ + return __indword((USHORT)(ULONG_PTR)Port); +} + +FORCEINLINE +USHORT +READ_PORT_USHORT( + IN PUSHORT Port) +{ + return __inword((USHORT)(ULONG_PTR)Port); +} + +FORCEINLINE +VOID +READ_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count) +{ + __movsb(Register, Buffer, Count); +} + +FORCEINLINE +VOID +READ_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count) +{ + __movsd(Register, Buffer, Count); +} + +FORCEINLINE +VOID +READ_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count) +{ + __movsw(Register, Buffer, Count); +} + +FORCEINLINE +UCHAR +READ_REGISTER_UCHAR( + IN PUCHAR Register) +{ + return *Register; +} + +FORCEINLINE +ULONG +READ_REGISTER_ULONG( + IN PULONG Register) +{ + return *Register; +} + +FORCEINLINE +USHORT +READ_REGISTER_USHORT( + IN PUSHORT Register) +{ + return *Register; +} + +FORCEINLINE +VOID +WRITE_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count) +{ + __outbytestring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +WRITE_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count) +{ + __outdwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +WRITE_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count) +{ + __outwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +WRITE_PORT_UCHAR( + IN PUCHAR Port, + IN UCHAR Value) +{ + __outbyte((USHORT)(ULONG_PTR)Port, Value); +} + +FORCEINLINE +VOID +WRITE_PORT_ULONG( + IN PULONG Port, + IN ULONG Value) +{ + __outdword((USHORT)(ULONG_PTR)Port, Value); +} + +FORCEINLINE +VOID +WRITE_PORT_USHORT( + IN PUSHORT Port, + IN USHORT Value) +{ + __outword((USHORT)(ULONG_PTR)Port, Value); +} + +FORCEINLINE +VOID +WRITE_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count) +{ + LONG Synch; + __movsb(Register, Buffer, Count); + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count) +{ + LONG Synch; + __movsd(Register, Buffer, Count); + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count) +{ + LONG Synch; + __movsw(Register, Buffer, Count); + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_UCHAR( + IN PUCHAR Register, + IN UCHAR Value) +{ + LONG Synch; + *Register = Value; + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_ULONG( + IN PULONG Register, + IN ULONG Value) +{ + LONG Synch; + *Register = Value; + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_USHORT( + IN PUSHORT Register, + IN USHORT Value) +{ + LONG Sync; + *Register = Value; + InterlockedOr(&Sync, 1); +} + +#endif + +/** I/O manager routines **/ + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +NTKERNELAPI +VOID +IoAcquireCancelSpinLock( + OUT PKIRQL Irql); + +NTKERNELAPI +NTSTATUS +NTAPI +IoAcquireRemoveLockEx( + IN PIO_REMOVE_LOCK RemoveLock, + IN PVOID Tag OPTIONAL, + IN PCSTR File, + IN ULONG Line, + IN ULONG RemlockSize); + +#endif + +/* + * NTSTATUS + * IoAcquireRemoveLock( + * IN PIO_REMOVE_LOCK RemoveLock, + * IN OPTIONAL PVOID Tag) + */ +#if DBG +#define IoAcquireRemoveLock(RemoveLock, Tag) \ + IoAcquireRemoveLockEx(RemoveLock, Tag, __FILE__, __LINE__, sizeof (IO_REMOVE_LOCK)) +#else +#define IoAcquireRemoveLock(RemoveLock, Tag) \ + IoAcquireRemoveLockEx(RemoveLock, Tag, "", 1, sizeof (IO_REMOVE_LOCK)) +#endif + +/* + * VOID + * IoAdjustPagingPathCount( + * IN PLONG Count, + * IN BOOLEAN Increment) + */ +#define IoAdjustPagingPathCount(_Count, \ + _Increment) \ +{ \ + if (_Increment) \ + { \ + InterlockedIncrement(_Count); \ + } \ + else \ + { \ + InterlockedDecrement(_Count); \ + } \ +} + +#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) +FORCEINLINE +NTSTATUS +IoAllocateAdapterChannel( + IN PDMA_ADAPTER DmaAdapter, + IN PDEVICE_OBJECT DeviceObject, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context) +{ + PALLOCATE_ADAPTER_CHANNEL allocateAdapterChannel; + NTSTATUS status; + + allocateAdapterChannel = *(DmaAdapter)->DmaOperations->AllocateAdapterChannel; + + ASSERT( allocateAdapterChannel != NULL ); + + status = allocateAdapterChannel( DmaAdapter, + DeviceObject, + NumberOfMapRegisters, + ExecutionRoutine, + Context ); + + return status; +} +#endif + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +NTKERNELAPI +NTSTATUS +IoAllocateDriverObjectExtension( + IN PDRIVER_OBJECT DriverObject, + IN PVOID ClientIdentificationAddress, + IN ULONG DriverObjectExtensionSize, + OUT PVOID *DriverObjectExtension); + +NTKERNELAPI +PVOID +IoAllocateErrorLogEntry( + IN PVOID IoObject, + IN UCHAR EntrySize); + +NTKERNELAPI +PIRP +IoAllocateIrp( + IN CCHAR StackSize, + IN BOOLEAN ChargeQuota); + +NTKERNELAPI +PMDL +IoAllocateMdl( + IN PVOID VirtualAddress OPTIONAL, + IN ULONG Length, + IN BOOLEAN SecondaryBuffer, + IN BOOLEAN ChargeQuota, + IN OUT PIRP Irp OPTIONAL); + +NTKERNELAPI +PIO_WORKITEM +IoAllocateWorkItem( + IN PDEVICE_OBJECT DeviceObject); + +NTKERNELAPI +NTSTATUS +IoAttachDevice( + IN PDEVICE_OBJECT SourceDevice, + IN PUNICODE_STRING TargetDevice, + OUT PDEVICE_OBJECT *AttachedDevice); + +NTKERNELAPI +PDEVICE_OBJECT +IoAttachDeviceToDeviceStack( + IN PDEVICE_OBJECT SourceDevice, + IN PDEVICE_OBJECT TargetDevice); + +NTKERNELAPI +PIRP +IoBuildAsynchronousFsdRequest( + IN ULONG MajorFunction, + IN PDEVICE_OBJECT DeviceObject, + IN OUT PVOID Buffer OPTIONAL, + IN ULONG Length OPTIONAL, + IN PLARGE_INTEGER StartingOffset OPTIONAL, + IN PIO_STATUS_BLOCK IoStatusBlock OPTIONAL); + +NTKERNELAPI +PIRP +IoBuildDeviceIoControlRequest( + IN ULONG IoControlCode, + IN PDEVICE_OBJECT DeviceObject, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength, + IN BOOLEAN InternalDeviceIoControl, + IN PKEVENT Event, + OUT PIO_STATUS_BLOCK IoStatusBlock); + +NTKERNELAPI +VOID +IoBuildPartialMdl( + IN PMDL SourceMdl, + IN OUT PMDL TargetMdl, + IN PVOID VirtualAddress, + IN ULONG Length); + +NTKERNELAPI +PIRP +IoBuildSynchronousFsdRequest( + IN ULONG MajorFunction, + IN PDEVICE_OBJECT DeviceObject, + IN OUT PVOID Buffer OPTIONAL, + IN ULONG Length OPTIONAL, + IN PLARGE_INTEGER StartingOffset OPTIONAL, + IN PKEVENT Event, + OUT PIO_STATUS_BLOCK IoStatusBlock); + +NTKERNELAPI +NTSTATUS +FASTCALL +IofCallDriver( + IN PDEVICE_OBJECT DeviceObject, + IN OUT PIRP Irp); + +NTKERNELAPI +BOOLEAN +IoCancelIrp( + IN PIRP Irp); + +NTKERNELAPI +NTSTATUS +IoCheckShareAccess( + IN ACCESS_MASK DesiredAccess, + IN ULONG DesiredShareAccess, + IN OUT PFILE_OBJECT FileObject, + IN OUT PSHARE_ACCESS ShareAccess, + IN BOOLEAN Update); + +NTKERNELAPI +VOID +FASTCALL +IofCompleteRequest( + IN PIRP Irp, + IN CCHAR PriorityBoost); + +NTKERNELAPI +NTSTATUS +NTAPI +IoConnectInterrupt( + OUT PKINTERRUPT *InterruptObject, + IN PKSERVICE_ROUTINE ServiceRoutine, + IN PVOID ServiceContext OPTIONAL, + IN PKSPIN_LOCK SpinLock OPTIONAL, + IN ULONG Vector, + IN KIRQL Irql, + IN KIRQL SynchronizeIrql, + IN KINTERRUPT_MODE InterruptMode, + IN BOOLEAN ShareVector, + IN KAFFINITY ProcessorEnableMask, + IN BOOLEAN FloatingSave); + +NTKERNELAPI +NTSTATUS +IoCreateDevice( + IN PDRIVER_OBJECT DriverObject, + IN ULONG DeviceExtensionSize, + IN PUNICODE_STRING DeviceName OPTIONAL, + IN DEVICE_TYPE DeviceType, + IN ULONG DeviceCharacteristics, + IN BOOLEAN Exclusive, + OUT PDEVICE_OBJECT *DeviceObject); + +#endif + +/* + * NTSTATUS + * IoCallDriver( + * IN PDEVICE_OBJECT DeviceObject, + * IN OUT PIRP Irp) + */ +#define IoCallDriver IofCallDriver + +/* + * VOID + * IoCompleteRequest( + * IN PIRP Irp, + * IN CCHAR PriorityBoost) + */ +#define IoCompleteRequest IofCompleteRequest + +FORCEINLINE +PIO_STACK_LOCATION +IoGetCurrentIrpStackLocation( + IN PIRP Irp) +{ + ASSERT(Irp->CurrentLocation <= Irp->StackCount + 1); + return Irp->Tail.Overlay.CurrentStackLocation; +} + +FORCEINLINE +PIO_STACK_LOCATION +IoGetNextIrpStackLocation( + IN PIRP Irp) +{ + ASSERT(Irp->CurrentLocation > 0); + return ((Irp)->Tail.Overlay.CurrentStackLocation - 1 ); +} + +FORCEINLINE +VOID +IoCopyCurrentIrpStackLocationToNext( + IN PIRP Irp) +{ + PIO_STACK_LOCATION irpSp; + PIO_STACK_LOCATION nextIrpSp; + irpSp = IoGetCurrentIrpStackLocation(Irp); + nextIrpSp = IoGetNextIrpStackLocation(Irp); + RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); + nextIrpSp->Control = 0; +} + /****************************************************************************** * RTL Types * ******************************************************************************/ Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 17:55:25 2010 @@ -2555,479 +2555,7 @@ PADAPTER_OBJECT AdapterObject ); -/** Io access routines **/ - -#if !defined(_M_AMD64) -NTHALAPI -VOID -NTAPI -READ_PORT_BUFFER_UCHAR( - IN PUCHAR Port, - IN PUCHAR Buffer, - IN ULONG Count); - -NTHALAPI -VOID -NTAPI -READ_PORT_BUFFER_ULONG( - IN PULONG Port, - IN PULONG Buffer, - IN ULONG Count); - -NTHALAPI -VOID -NTAPI -READ_PORT_BUFFER_USHORT( - IN PUSHORT Port, - IN PUSHORT Buffer, - IN ULONG Count); - -NTHALAPI -UCHAR -NTAPI -READ_PORT_UCHAR( - IN PUCHAR Port); - -NTHALAPI -ULONG -NTAPI -READ_PORT_ULONG( - IN PULONG Port); - -NTHALAPI -USHORT -NTAPI -READ_PORT_USHORT( - IN PUSHORT Port); - -NTKERNELAPI -VOID -NTAPI -READ_REGISTER_BUFFER_UCHAR( - IN PUCHAR Register, - IN PUCHAR Buffer, - IN ULONG Count); - -NTKERNELAPI -VOID -NTAPI -READ_REGISTER_BUFFER_ULONG( - IN PULONG Register, - IN PULONG Buffer, - IN ULONG Count); - -NTKERNELAPI -VOID -NTAPI -READ_REGISTER_BUFFER_USHORT( - IN PUSHORT Register, - IN PUSHORT Buffer, - IN ULONG Count); - -NTKERNELAPI -UCHAR -NTAPI -READ_REGISTER_UCHAR( - IN PUCHAR Register); - -NTKERNELAPI -ULONG -NTAPI -READ_REGISTER_ULONG( - IN PULONG Register); - -NTKERNELAPI -USHORT -NTAPI -READ_REGISTER_USHORT( - IN PUSHORT Register); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_BUFFER_UCHAR( - IN PUCHAR Port, - IN PUCHAR Buffer, - IN ULONG Count); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_BUFFER_ULONG( - IN PULONG Port, - IN PULONG Buffer, - IN ULONG Count); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_BUFFER_USHORT( - IN PUSHORT Port, - IN PUSHORT Buffer, - IN ULONG Count); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_UCHAR( - IN PUCHAR Port, - IN UCHAR Value); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_ULONG( - IN PULONG Port, - IN ULONG Value); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_USHORT( - IN PUSHORT Port, - IN USHORT Value); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_BUFFER_UCHAR( - IN PUCHAR Register, - IN PUCHAR Buffer, - IN ULONG Count); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_BUFFER_ULONG( - IN PULONG Register, - IN PULONG Buffer, - IN ULONG Count); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_BUFFER_USHORT( - IN PUSHORT Register, - IN PUSHORT Buffer, - IN ULONG Count); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_UCHAR( - IN PUCHAR Register, - IN UCHAR Value); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_ULONG( - IN PULONG Register, - IN ULONG Value); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_USHORT( - IN PUSHORT Register, - IN USHORT Value); - -#else - -FORCEINLINE -VOID -READ_PORT_BUFFER_UCHAR( - IN PUCHAR Port, - IN PUCHAR Buffer, - IN ULONG Count) -{ - __inbytestring((USHORT)(ULONG_PTR)Port, Buffer, Count); -} - -FORCEINLINE -VOID -READ_PORT_BUFFER_ULONG( - IN PULONG Port, - IN PULONG Buffer, - IN ULONG Count) -{ - __indwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); -} - -FORCEINLINE -VOID -READ_PORT_BUFFER_USHORT( - IN PUSHORT Port, - IN PUSHORT Buffer, - IN ULONG Count) -{ - __inwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); -} - -FORCEINLINE -UCHAR -READ_PORT_UCHAR( - IN PUCHAR Port) -{ - return __inbyte((USHORT)(ULONG_PTR)Port); -} - -FORCEINLINE -ULONG -READ_PORT_ULONG( - IN PULONG Port) -{ - return __indword((USHORT)(ULONG_PTR)Port); -} - -FORCEINLINE -USHORT -READ_PORT_USHORT( - IN PUSHORT Port) -{ - return __inword((USHORT)(ULONG_PTR)Port); -} - -FORCEINLINE -VOID -READ_REGISTER_BUFFER_UCHAR( - IN PUCHAR Register, - IN PUCHAR Buffer, - IN ULONG Count) -{ - __movsb(Register, Buffer, Count); -} - -FORCEINLINE -VOID -READ_REGISTER_BUFFER_ULONG( - IN PULONG Register, - IN PULONG Buffer, - IN ULONG Count) -{ - __movsd(Register, Buffer, Count); -} - -FORCEINLINE -VOID -READ_REGISTER_BUFFER_USHORT( - IN PUSHORT Register, - IN PUSHORT Buffer, - IN ULONG Count) -{ - __movsw(Register, Buffer, Count); -} - -FORCEINLINE -UCHAR -READ_REGISTER_UCHAR( - IN PUCHAR Register) -{ - return *Register; -} - -FORCEINLINE -ULONG -READ_REGISTER_ULONG( - IN PULONG Register) -{ - return *Register; -} - -FORCEINLINE -USHORT -READ_REGISTER_USHORT( - IN PUSHORT Register) -{ - return *Register; -} - -FORCEINLINE -VOID -WRITE_PORT_BUFFER_UCHAR( - IN PUCHAR Port, - IN PUCHAR Buffer, - IN ULONG Count) -{ - __outbytestring((USHORT)(ULONG_PTR)Port, Buffer, Count); -} - -FORCEINLINE -VOID -WRITE_PORT_BUFFER_ULONG( - IN PULONG Port, - IN PULONG Buffer, - IN ULONG Count) -{ - __outdwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); -} - -FORCEINLINE -VOID -WRITE_PORT_BUFFER_USHORT( - IN PUSHORT Port, - IN PUSHORT Buffer, - IN ULONG Count) -{ - __outwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); -} - -FORCEINLINE -VOID -WRITE_PORT_UCHAR( - IN PUCHAR Port, - IN UCHAR Value) -{ - __outbyte((USHORT)(ULONG_PTR)Port, Value); -} - -FORCEINLINE -VOID -WRITE_PORT_ULONG( - IN PULONG Port, - IN ULONG Value) -{ - __outdword((USHORT)(ULONG_PTR)Port, Value); -} - -FORCEINLINE -VOID -WRITE_PORT_USHORT( - IN PUSHORT Port, - IN USHORT Value) -{ - __outword((USHORT)(ULONG_PTR)Port, Value); -} - -FORCEINLINE -VOID -WRITE_REGISTER_BUFFER_UCHAR( - IN PUCHAR Register, - IN PUCHAR Buffer, - IN ULONG Count) -{ - LONG Synch; - __movsb(Register, Buffer, Count); - InterlockedOr(&Synch, 1); -} - -FORCEINLINE -VOID -WRITE_REGISTER_BUFFER_ULONG( - IN PULONG Register, - IN PULONG Buffer, - IN ULONG Count) -{ - LONG Synch; - __movsd(Register, Buffer, Count); - InterlockedOr(&Synch, 1); -} - -FORCEINLINE -VOID -WRITE_REGISTER_BUFFER_USHORT( - IN PUSHORT Register, - IN PUSHORT Buffer, - IN ULONG Count) -{ - LONG Synch; - __movsw(Register, Buffer, Count); - InterlockedOr(&Synch, 1); -} - -FORCEINLINE -VOID -WRITE_REGISTER_UCHAR( - IN PUCHAR Register, - IN UCHAR Value) -{ - LONG Synch; - *Register = Value; - InterlockedOr(&Synch, 1); -} - -FORCEINLINE -VOID -WRITE_REGISTER_ULONG( - IN PULONG Register, - IN ULONG Value) -{ - LONG Synch; - *Register = Value; - InterlockedOr(&Synch, 1); -} - -FORCEINLINE -VOID -WRITE_REGISTER_USHORT( - IN PUSHORT Register, - IN USHORT Value) -{ - LONG Sync; - *Register = Value; - InterlockedOr(&Sync, 1); -} - -#endif - /** I/O manager routines **/ - -NTKERNELAPI -VOID -NTAPI -IoAcquireCancelSpinLock( - OUT PKIRQL Irql); - -NTKERNELAPI -NTSTATUS -NTAPI -IoAcquireRemoveLockEx( - IN PIO_REMOVE_LOCK RemoveLock, - IN OPTIONAL PVOID Tag OPTIONAL, - IN PCSTR File, - IN ULONG Line, - IN ULONG RemlockSize); - -/* - * NTSTATUS - * IoAcquireRemoveLock( - * IN PIO_REMOVE_LOCK RemoveLock, - * IN OPTIONAL PVOID Tag) - */ -#define IoAcquireRemoveLock(_RemoveLock, \ - _Tag) \ - IoAcquireRemoveLockEx(_RemoveLock, _Tag, __FILE__, __LINE__, sizeof(IO_REMOVE_LOCK)) - -/* - * VOID - * IoAdjustPagingPathCount( - * IN PLONG Count, - * IN BOOLEAN Increment) - */ -#define IoAdjustPagingPathCount(_Count, \ - _Increment) \ -{ \ - if (_Increment) \ - { \ - InterlockedIncrement(_Count); \ - } \ - else \ - { \ - InterlockedDecrement(_Count); \ - } \ -} - -#ifndef DMA_MACROS_DEFINED -NTKERNELAPI -NTSTATUS -NTAPI -IoAllocateAdapterChannel( - IN PADAPTER_OBJECT AdapterObject, - IN PDEVICE_OBJECT DeviceObject, - IN ULONG NumberOfMapRegisters, - IN PDRIVER_CONTROL ExecutionRoutine, - IN PVOID Context); -#endif NTKERNELAPI VOID @@ -3037,45 +2565,6 @@ IN PDEVICE_OBJECT DeviceObject, IN PDRIVER_CONTROL ExecutionRoutine, IN PVOID Context); - -NTKERNELAPI -NTSTATUS -NTAPI -IoAllocateDriverObjectExtension( - IN PDRIVER_OBJECT DriverObject, - IN PVOID ClientIdentificationAddress, - IN ULONG DriverObjectExtensionSize, - OUT PVOID *DriverObjectExtension); - -NTKERNELAPI -PVOID -NTAPI -IoAllocateErrorLogEntry( - IN PVOID IoObject, - IN UCHAR EntrySize); - -NTKERNELAPI -PIRP -NTAPI -IoAllocateIrp( - IN CCHAR StackSize, - IN BOOLEAN ChargeQuota); - -NTKERNELAPI -PMDL -NTAPI -IoAllocateMdl( - IN PVOID VirtualAddress, - IN ULONG Length, - IN BOOLEAN SecondaryBuffer, - IN BOOLEAN ChargeQuota, - IN OUT PIRP Irp OPTIONAL); - -NTKERNELAPI -PIO_WORKITEM -NTAPI -IoAllocateWorkItem( - IN PDEVICE_OBJECT DeviceObject); /* * VOID IoAssignArcName( @@ -3086,82 +2575,6 @@ IoCreateSymbolicLink((_ArcName), (_DeviceName))) NTKERNELAPI -NTSTATUS -NTAPI -IoAttachDevice( - IN PDEVICE_OBJECT SourceDevice, - IN PUNICODE_STRING TargetDevice, - OUT PDEVICE_OBJECT *AttachedDevice); - -NTKERNELAPI -PDEVICE_OBJECT -NTAPI -IoAttachDeviceToDeviceStack( - IN PDEVICE_OBJECT SourceDevice, - IN PDEVICE_OBJECT TargetDevice); - -NTKERNELAPI -PIRP -NTAPI -IoBuildAsynchronousFsdRequest( - IN ULONG MajorFunction, - IN PDEVICE_OBJECT DeviceObject, - IN OUT PVOID Buffer OPTIONAL, - IN ULONG Length OPTIONAL, - IN PLARGE_INTEGER StartingOffset OPTIONAL, - IN PIO_STATUS_BLOCK IoStatusBlock OPTIONAL); - -NTKERNELAPI -PIRP -NTAPI -IoBuildDeviceIoControlRequest( - IN ULONG IoControlCode, - IN PDEVICE_OBJECT DeviceObject, - IN PVOID InputBuffer OPTIONAL, - IN ULONG InputBufferLength, - OUT PVOID OutputBuffer OPTIONAL, - IN ULONG OutputBufferLength, - IN BOOLEAN InternalDeviceIoControl, - IN PKEVENT Event, - OUT PIO_STATUS_BLOCK IoStatusBlock); - -NTKERNELAPI -VOID -NTAPI -IoBuildPartialMdl( - IN PMDL SourceMdl, - IN OUT PMDL TargetMdl, - IN PVOID VirtualAddress, - IN ULONG Length); - -NTKERNELAPI -PIRP -NTAPI -IoBuildSynchronousFsdRequest( - IN ULONG MajorFunction, - IN PDEVICE_OBJECT DeviceObject, - IN OUT PVOID Buffer OPTIONAL, - IN ULONG Length OPTIONAL, - IN PLARGE_INTEGER StartingOffset OPTIONAL, - IN PKEVENT Event, - OUT PIO_STATUS_BLOCK IoStatusBlock); - -NTKERNELAPI -NTSTATUS -FASTCALL -IofCallDriver( - IN PDEVICE_OBJECT DeviceObject, - IN OUT PIRP Irp); - -/* - * NTSTATUS - * IoCallDriver( - * IN PDEVICE_OBJECT DeviceObject, - * IN OUT PIRP Irp) - */ -#define IoCallDriver IofCallDriver - -NTKERNELAPI VOID NTAPI IoCancelFileOpen( @@ -3169,101 +2582,10 @@ IN PFILE_OBJECT FileObject); NTKERNELAPI -BOOLEAN -NTAPI -IoCancelIrp( - IN PIRP Irp); - -NTKERNELAPI -NTSTATUS -NTAPI -IoCheckShareAccess( - IN ACCESS_MASK DesiredAccess, - IN ULONG DesiredShareAccess, - IN OUT PFILE_OBJECT FileObject, - IN OUT PSHARE_ACCESS ShareAccess, - IN BOOLEAN Update); - -NTKERNELAPI -VOID -FASTCALL -IofCompleteRequest( - IN PIRP Irp, - IN CCHAR PriorityBoost); - -/* - * VOID - * IoCompleteRequest( - * IN PIRP Irp, - * IN CCHAR PriorityBoost) - */ -#define IoCompleteRequest IofCompleteRequest - -NTKERNELAPI -NTSTATUS -NTAPI -IoConnectInterrupt( - OUT PKINTERRUPT *InterruptObject, - IN PKSERVICE_ROUTINE ServiceRoutine, - IN PVOID ServiceContext, - IN PKSPIN_LOCK SpinLock OPTIONAL, - IN ULONG Vector, - IN KIRQL Irql, - IN KIRQL SynchronizeIrql, - IN KINTERRUPT_MODE InterruptMode, - IN BOOLEAN ShareVector, - IN KAFFINITY ProcessorEnableMask, - IN BOOLEAN FloatingSave); - -/* - * PIO_STACK_LOCATION - * IoGetCurrentIrpStackLocation( - * IN PIRP Irp) - */ -#define IoGetCurrentIrpStackLocation(_Irp) \ - ((_Irp)->Tail.Overlay.CurrentStackLocation) - -/* - * PIO_STACK_LOCATION - * IoGetNextIrpStackLocation( - * IN PIRP Irp) - */ -#define IoGetNextIrpStackLocation(_Irp) \ - ((_Irp)->Tail.Overlay.CurrentStackLocation - 1) - -/* - * VOID - * IoCopyCurrentIrpStackLocationToNext( - * IN PIRP Irp) - */ -#define IoCopyCurrentIrpStackLocationToNext(_Irp) \ -{ \ - PIO_STACK_LOCATION _IrpSp; \ - PIO_STACK_LOCATION _NextIrpSp; \ - _IrpSp = IoGetCurrentIrpStackLocation(_Irp); \ - _NextIrpSp = IoGetNextIrpStackLocation(_Irp); \ - RtlCopyMemory(_NextIrpSp, _IrpSp, \ - FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); \ - _NextIrpSp->Control = 0; \ -} - -NTKERNELAPI PCONTROLLER_OBJECT NTAPI IoCreateController( IN ULONG Size); - -NTKERNELAPI -NTSTATUS -NTAPI -IoCreateDevice( - IN PDRIVER_OBJECT DriverObject, - IN ULONG DeviceExtensionSize, - IN PUNICODE_STRING DeviceName OPTIONAL, - IN DEVICE_TYPE DeviceType, - IN ULONG DeviceCharacteristics, - IN BOOLEAN Exclusive, - OUT PDEVICE_OBJECT *DeviceObject); NTKERNELAPI NTSTATUS
14 years, 9 months
1
0
0
0
[tkreuzer] 45792: Revert r45774 until I know why qemu is broken
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Mar 3 17:30:56 2010 New Revision: 45792 URL:
http://svn.reactos.org/svn/reactos?rev=45792&view=rev
Log: Revert r45774 until I know why qemu is broken Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S trunk/reactos/ntoskrnl/include/internal/trap_x.h trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ke/i386/trap.s trunk/reactos/ntoskrnl/ke/i386/traphdlr.c Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] Wed Mar 3 17:30:56 2010 @@ -179,14 +179,6 @@ mov fs, ax endif -#if DBG - /* Keep the frame chain intact */ - mov eax, [esp + KTRAP_FRAME_EIP] - mov [esp + KTRAP_FRAME_DEBUGEIP], eax - mov [esp + KTRAP_FRAME_DEBUGEBP], ebp - mov ebp, esp -#endif - /* Set parameter 1 (ECX) to point to the frame */ mov ecx, esp @@ -195,157 +187,11 @@ ENDM -MACRO(KiCallHandler, Handler) -#if DBG - /* Use a call to get the return address for back traces */ - call Handler -#else - /* Use the faster jmp */ - jmp Handler -#endif - nop -ENDM - MACRO(TRAP_ENTRY, Trap, Flags) EXTERN @&Trap&Handler@4 :PROC PUBLIC _&Trap _&Trap: KiEnterTrap Flags - KiCallHandler @&Trap&Handler@4 + jmp @&Trap&Handler@4 ENDM -#define KI_RESTORE_EAX HEX(001) -#define KI_RESTORE_ECX_EDX HEX(002) -#define KI_RESTORE_FS HEX(004) -#define KI_RESTORE_SEGMENTS HEX(008) -#define KI_RESTORE_EFLAGS HEX(010) -#define KI_EXIT_SYSCALL HEX(020) -#define KI_EXIT_JMP HEX(040) -#define KI_EXIT_RET HEX(080) -#define KI_EXIT_IRET HEX(100) -#define KI_EDITED_FRAME HEX(200) -#define KI_RESTORE_VOLATILES (KI_RESTORE_EAX OR KI_RESTORE_ECX_EDX) - -MACRO(KiTrapExitStub, Name, Flags) - -PUBLIC @&Name&@4 -@&Name&@4: - - if (Flags AND KI_RESTORE_EFLAGS) - - /* We will pop EFlags off the stack */ - OffsetEsp = KTRAP_FRAME_EFLAGS - - elseif (Flags AND KI_EXIT_IRET) - - /* This is the IRET frame */ - OffsetEsp = KTRAP_FRAME_EIP - - else - - OffsetEsp = 0 - - endif - - if (Flags AND KI_EDITED_FRAME) - - /* Load the requested ESP */ - mov esp, [ecx + KTRAP_FRAME_TEMPESP] - - /* Put return address on the new stack */ - push [ecx + KTRAP_FRAME_EIP] - - /* Put EFLAGS on the new stack */ - push [ecx + KTRAP_FRAME_EFLAGS] - - else - - /* Point esp to an appropriate member of the frame */ - lea esp, [ecx + OffsetEsp] - - endif - - /* Restore non volatiles */ - mov ebx, [ecx + KTRAP_FRAME_EBX] - mov esi, [ecx + KTRAP_FRAME_ESI] - mov edi, [ecx + KTRAP_FRAME_EDI] - mov ebp, [ecx + KTRAP_FRAME_EBP] - - if (Flags AND KI_RESTORE_EAX) - - /* Restore eax */ - mov eax, [ecx + KTRAP_FRAME_EAX] - - endif - - if (Flags AND KI_RESTORE_ECX_EDX) - - /* Restore volatiles */ - mov edx, [ecx + KTRAP_FRAME_EDX] - mov ecx, [ecx + KTRAP_FRAME_ECX] - - elseif (Flags AND KI_EXIT_JMP) - - /* Load return address into edx */ - mov edx, [esp - OffsetEsp + KTRAP_FRAME_EIP] - - elseif (Flags AND KI_EXIT_SYSCALL) - - /* Set sysexit parameters */ - mov edx, [esp - OffsetEsp + KTRAP_FRAME_EIP] - mov ecx, [esp - OffsetEsp + KTRAP_FRAME_ESP] - - /* Keep interrupts disabled until the sti / sysexit */ - and byte ptr [esp - OffsetEsp + KTRAP_FRAME_EFLAGS + 1], ~(EFLAGS_INTERRUPT_MASK >> 8) - - endif - - if (Flags AND KI_RESTORE_SEGMENTS) - - /* Restore segments for user mode */ - mov ds, [esp - OffsetEsp + KTRAP_FRAME_DS] - mov es, [esp - OffsetEsp + KTRAP_FRAME_ES] - mov gs, [esp - OffsetEsp + KTRAP_FRAME_GS] - - endif - - if ((Flags AND KI_RESTORE_FS) OR (Flags AND KI_RESTORE_SEGMENTS)) - - /* Restore user mode FS */ - mov fs, [esp - OffsetEsp + KTRAP_FRAME_FS] - - endif - - if (Flags AND KI_RESTORE_EFLAGS) - - /* Restore EFLAGS */ - popf - - endif - - if (Flags AND KI_EXIT_SYSCALL) - - /* Enable interrupts and return to user mode. - Both must follow directly after another to be "atomic". */ - sti - sysexit - - elseif (Flags AND KI_EXIT_IRET) - - /* Return with iret */ - iret - - elseif (Flags AND KI_EXIT_JMP) - - /* Return to kernel mode with a jmp */ - jmp edx - - elseif (Flags AND KI_EXIT_RET) - - /* Return to kernel mode with a ret */ - ret - - endif - -ENDM - Modified: trunk/reactos/ntoskrnl/include/internal/trap_x.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/trap_x.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/trap_x.h [iso-8859-1] Wed Mar 3 17:30:56 2010 @@ -7,8 +7,6 @@ */ #pragma once - -//#define TRAP_DEBUG 1 // // Unreachable code hint for GCC 4.5.x, older GCC versions, and MSVC @@ -24,17 +22,6 @@ #else #define UNREACHABLE #endif - -// -// Helper Code -// -BOOLEAN -FORCEINLINE -KiUserTrap(IN PKTRAP_FRAME TrapFrame) -{ - /* Anything else but Ring 0 is Ring 3 */ - return (TrapFrame->SegCs & MODE_MASK); -} // // Debug Macros @@ -90,20 +77,19 @@ TrapFrame->DbgArgPointer = TrapFrame->Edx; TrapFrame->DbgArgMark = 0xBADB0D00; TrapFrame->DbgEip = TrapFrame->Eip; - TrapFrame->DbgEbp = TrapFrame->Ebp; - TrapFrame->PreviousPreviousMode = -1; + TrapFrame->DbgEbp = TrapFrame->Ebp; } VOID FORCEINLINE KiExitTrapDebugChecks(IN PKTRAP_FRAME TrapFrame, - IN KTRAP_EXIT_SKIP_BITS SkipBits) + IN KTRAP_STATE_BITS SkipBits) { /* Make sure interrupts are disabled */ if (__readeflags() & EFLAGS_INTERRUPT_MASK) { DbgPrint("Exiting with interrupts enabled: %lx\n", __readeflags()); - __debugbreak(); + while (TRUE); } /* Make sure this is a real trap frame */ @@ -111,35 +97,35 @@ { DbgPrint("Exiting with an invalid trap frame? (No MAGIC in trap frame)\n"); KiDumpTrapFrame(TrapFrame); - __debugbreak(); + while (TRUE); } /* Make sure we're not in user-mode or something */ if (Ke386GetFs() != KGDT_R0_PCR) { DbgPrint("Exiting with an invalid FS: %lx\n", Ke386GetFs()); - __debugbreak(); + while (TRUE); } /* Make sure we have a valid SEH chain */ if (KeGetPcr()->Tib.ExceptionList == 0) { DbgPrint("Exiting with NULL exception chain: %p\n", KeGetPcr()->Tib.ExceptionList); - __debugbreak(); + while (TRUE); } /* Make sure we're restoring a valid SEH chain */ if (TrapFrame->ExceptionList == 0) { DbgPrint("Entered a trap with a NULL exception chain: %p\n", TrapFrame->ExceptionList); - __debugbreak(); + while (TRUE); } /* If we're ignoring previous mode, make sure caller doesn't actually want it */ if ((SkipBits.SkipPreviousMode) && (TrapFrame->PreviousPreviousMode != -1)) { - DbgPrint("Exiting a trap witout restoring previous mode, yet previous mode seems valid: %lx\n", TrapFrame->PreviousPreviousMode); - __debugbreak(); + DbgPrint("Exiting a trap witout restoring previous mode, yet previous mode seems valid: %lx", TrapFrame->PreviousPreviousMode); + while (TRUE); } } @@ -151,14 +137,14 @@ KIRQL OldIrql; /* Check if this was a user call */ - if (KiUserTrap(TrapFrame)) + if (KiUserMode(TrapFrame)) { /* Make sure we are not returning with elevated IRQL */ OldIrql = KeGetCurrentIrql(); if (OldIrql != PASSIVE_LEVEL) { /* Forcibly put us in a sane state */ - KeGetPcr()->Irql = PASSIVE_LEVEL; + KeGetPcr()->CurrentIrql = PASSIVE_LEVEL; _disable(); /* Fail */ @@ -168,7 +154,7 @@ 0, 0); } -#if 0 + /* Make sure we're not attached and that APCs are not disabled */ if ((KeGetCurrentThread()->ApcStateIndex != CurrentApcEnvironment) || (KeGetCurrentThread()->CombinedApcDisable != 0)) @@ -180,7 +166,6 @@ KeGetCurrentThread()->CombinedApcDisable, 0); } -#endif } } #else @@ -190,19 +175,333 @@ #endif // +// Helper Code +// +BOOLEAN +FORCEINLINE +KiUserTrap(IN PKTRAP_FRAME TrapFrame) +{ + /* Anything else but Ring 0 is Ring 3 */ + return (TrapFrame->SegCs & MODE_MASK); +} + +// +// "BOP" code used by VDM and V8086 Mode +// +VOID +FORCEINLINE +KiIssueBop(VOID) +{ + /* Invalid instruction that an invalid opcode handler must trap and handle */ + asm volatile(".byte 0xC4\n.byte 0xC4\n"); +} + +VOID +FORCEINLINE +KiUserSystemCall(IN PKTRAP_FRAME TrapFrame) +{ + /* + * Kernel call or user call? + * + * This decision is made in inlined assembly because we need to patch + * the relative offset of the user-mode jump to point to the SYSEXIT + * routine if the CPU supports it. The only way to guarantee that a + * relative jnz/jz instruction is generated is to force it with the + * inline assembler. + */ + asm volatile + ( + "test $1, %0\n" /* MODE_MASK */ + ".globl _KiSystemCallExitBranch\n_KiSystemCallExitBranch:\n" + "jnz _KiSystemCallExit\n" + : + : "r"(TrapFrame->SegCs) + ); +} + +// +// Generates an Exit Epilog Stub for the given name +// +#define KI_FUNCTION_CALL 0x1 +#define KI_EDITED_FRAME 0x2 +#define KI_DIRECT_EXIT 0x4 +#define KI_FAST_SYSTEM_CALL_EXIT 0x8 +#define KI_SYSTEM_CALL_EXIT 0x10 +#define KI_SYSTEM_CALL_JUMP 0x20 +#define KiTrapExitStub(x, y) VOID FORCEINLINE DECLSPEC_NORETURN x(IN PKTRAP_FRAME TrapFrame) { KiTrapExit(TrapFrame, y); UNREACHABLE; } +#define KiTrapExitStub2(x, y) VOID FORCEINLINE x(IN PKTRAP_FRAME TrapFrame) { KiTrapExit(TrapFrame, y); } + +// +// How volatiles will be restored +// +#define KI_EAX_NO_VOLATILES 0x0 +#define KI_EAX_ONLY 0x1 +#define KI_ALL_VOLATILES 0x2 + +// +// Exit mechanism to use +// +#define KI_EXIT_IRET 0x0 +#define KI_EXIT_SYSEXIT 0x1 +#define KI_EXIT_JMP 0x2 +#define KI_EXIT_RET 0x3 + +// +// Master Trap Epilog +// +VOID +FORCEINLINE +KiTrapExit(IN PKTRAP_FRAME TrapFrame, + IN ULONG Flags) +{ + ULONG FrameSize = FIELD_OFFSET(KTRAP_FRAME, Eip); + ULONG ExitMechanism = KI_EXIT_IRET, Volatiles = KI_ALL_VOLATILES, NonVolatiles = TRUE; + ULONG EcxField = FIELD_OFFSET(KTRAP_FRAME, Ecx), EdxField = FIELD_OFFSET(KTRAP_FRAME, Edx); + + /* System call exit needs a special label */ + if (Flags & KI_SYSTEM_CALL_EXIT) __asm__ __volatile__ + ( + ".globl _KiSystemCallExit\n_KiSystemCallExit:\n" + ); + + /* Start by making the trap frame equal to the stack */ + __asm__ __volatile__ + ( + "movl %0, %%esp\n" + : + : "r"(TrapFrame) + : "%esp" + ); + + /* Check what kind of trap frame this trap requires */ + if (Flags & KI_FUNCTION_CALL) + { + /* These calls have an EIP on the stack they need */ + ExitMechanism = KI_EXIT_RET; + Volatiles = FALSE; + } + else if (Flags & KI_EDITED_FRAME) + { + /* Edited frames store a new ESP in the error code field */ + FrameSize = FIELD_OFFSET(KTRAP_FRAME, ErrCode); + } + else if (Flags & KI_DIRECT_EXIT) + { + /* Exits directly without restoring anything, interrupt frame on stack */ + NonVolatiles = Volatiles = FALSE; + } + else if (Flags & KI_FAST_SYSTEM_CALL_EXIT) + { + /* We have a fake interrupt stack with a ring transition */ + FrameSize = FIELD_OFFSET(KTRAP_FRAME, V86Es); + ExitMechanism = KI_EXIT_SYSEXIT; + + /* SYSEXIT wants EIP in EDX and ESP in ECX */ + EcxField = FIELD_OFFSET(KTRAP_FRAME, HardwareEsp); + EdxField = FIELD_OFFSET(KTRAP_FRAME, Eip); + } + else if (Flags & KI_SYSTEM_CALL_EXIT) + { + /* Only restore EAX */ + NonVolatiles = KI_EAX_ONLY; + } + else if (Flags & KI_SYSTEM_CALL_JUMP) + { + /* We have a fake interrupt stack with no ring transition */ + FrameSize = FIELD_OFFSET(KTRAP_FRAME, HardwareEsp); + NonVolatiles = KI_EAX_ONLY; + ExitMechanism = KI_EXIT_JMP; + } + + /* Restore the non volatiles */ + if (NonVolatiles) __asm__ __volatile__ + ( + "movl %c[b](%%esp), %%ebx\n" + "movl %c[s](%%esp), %%esi\n" + "movl %c[i](%%esp), %%edi\n" + "movl %c[p](%%esp), %%ebp\n" + : + : [b] "i"(FIELD_OFFSET(KTRAP_FRAME, Ebx)), + [s] "i"(FIELD_OFFSET(KTRAP_FRAME, Esi)), + [i] "i"(FIELD_OFFSET(KTRAP_FRAME, Edi)), + [p] "i"(FIELD_OFFSET(KTRAP_FRAME, Ebp)) + : "%esp" + ); + + /* Restore EAX if volatiles must be restored */ + if (Volatiles) __asm__ __volatile__ + ( + "movl %c[a](%%esp), %%eax\n":: [a] "i"(FIELD_OFFSET(KTRAP_FRAME, Eax)) : "%esp" + ); + + /* Restore the other volatiles if needed */ + if (Volatiles == KI_ALL_VOLATILES) __asm__ __volatile__ + ( + "movl %c[c](%%esp), %%ecx\n" + "movl %c[d](%%esp), %%edx\n" + : + : [c] "i"(EcxField), + [d] "i"(EdxField) + : "%esp" + ); + + /* Ring 0 system calls jump back to EDX */ + if (Flags & KI_SYSTEM_CALL_JUMP) __asm__ __volatile__ + ( + "movl %c[d](%%esp), %%edx\n":: [d] "i"(FIELD_OFFSET(KTRAP_FRAME, Eip)) : "%esp" + ); + + /* Now destroy the trap frame on the stack */ + __asm__ __volatile__ ("addl $%c[e],%%esp\n":: [e] "i"(FrameSize) : "%esp"); + + /* Edited traps need to change to a new ESP */ + if (Flags & KI_EDITED_FRAME) __asm__ __volatile__ ("movl (%%esp), %%esp\n":::"%esp"); + + /* Check the exit mechanism and apply it */ + if (ExitMechanism == KI_EXIT_RET) __asm__ __volatile__("ret\n"::: "%esp"); + else if (ExitMechanism == KI_EXIT_IRET) __asm__ __volatile__("iret\n"::: "%esp"); + else if (ExitMechanism == KI_EXIT_JMP) __asm__ __volatile__("jmp *%%edx\n.globl _KiSystemCallExit2\n_KiSystemCallExit2:\n"::: "%esp"); + else if (ExitMechanism == KI_EXIT_SYSEXIT) __asm__ __volatile__("sti\nsysexit\n"::: "%esp"); +} + +// +// All the specific trap epilog stubs +// +KiTrapExitStub (KiTrapReturn, 0); +KiTrapExitStub (KiDirectTrapReturn, KI_DIRECT_EXIT); +KiTrapExitStub (KiCallReturn, KI_FUNCTION_CALL); +KiTrapExitStub (KiEditedTrapReturn, KI_EDITED_FRAME); +KiTrapExitStub2(KiSystemCallReturn, KI_SYSTEM_CALL_JUMP); +KiTrapExitStub (KiSystemCallSysExitReturn, KI_FAST_SYSTEM_CALL_EXIT); +KiTrapExitStub (KiSystemCallTrapReturn, KI_SYSTEM_CALL_EXIT); + +// // Generic Exit Routine // -VOID FASTCALL DECLSPEC_NORETURN KiSystemCallReturn(IN PKTRAP_FRAME TrapFrame); -VOID FASTCALL DECLSPEC_NORETURN KiSystemCallSysExitReturn(IN PKTRAP_FRAME TrapFrame); -VOID FASTCALL DECLSPEC_NORETURN KiSystemCallTrapReturn(IN PKTRAP_FRAME TrapFrame); -VOID FASTCALL DECLSPEC_NORETURN KiEditedTrapReturn(IN PKTRAP_FRAME TrapFrame); -VOID FASTCALL DECLSPEC_NORETURN KiTrapReturn(IN PKTRAP_FRAME TrapFrame); -VOID FASTCALL DECLSPEC_NORETURN KiTrapReturnNoSegments(IN PKTRAP_FRAME TrapFrame); - -typedef -VOID -(FASTCALL -*FAST_SYSTEM_CALL_EXIT)(IN PKTRAP_FRAME TrapFrame) DECLSPEC_NORETURN; +VOID +FORCEINLINE +DECLSPEC_NORETURN +KiExitTrap(IN PKTRAP_FRAME TrapFrame, + IN UCHAR Skip) +{ + KTRAP_EXIT_SKIP_BITS SkipBits = { .Bits = Skip }; + PULONG ReturnStack; + + /* Debugging checks */ + KiExitTrapDebugChecks(TrapFrame, SkipBits); + + /* Restore the SEH handler chain */ + KeGetPcr()->Tib.ExceptionList = TrapFrame->ExceptionList; + + /* Check if the previous mode must be restored */ + if (__builtin_expect(!SkipBits.SkipPreviousMode, 0)) /* More INTS than SYSCALLs */ + { + /* Restore it */ + KeGetCurrentThread()->PreviousMode = TrapFrame->PreviousPreviousMode; + } + + /* Check if there are active debug registers */ + if (__builtin_expect(TrapFrame->Dr7 & ~DR7_RESERVED_MASK, 0)) + { + /* Not handled yet */ + DbgPrint("Need Hardware Breakpoint Support!\n"); + DbgBreakPoint(); + while (TRUE); + } + + /* Check if this was a V8086 trap */ + if (__builtin_expect(TrapFrame->EFlags & EFLAGS_V86_MASK, 0)) KiTrapReturn(TrapFrame); + + /* Check if the trap frame was edited */ + if (__builtin_expect(!(TrapFrame->SegCs & FRAME_EDITED), 0)) + { + /* + * An edited trap frame happens when we need to modify CS and/or ESP but + * don't actually have a ring transition. This happens when a kernelmode + * caller wants to perform an NtContinue to another kernel address, such + * as in the case of SEH (basically, a longjmp), or to a user address. + * + * Therefore, the CPU never saved CS/ESP on the stack because we did not + * get a trap frame due to a ring transition (there was no interrupt). + * Even if we didn't want to restore CS to a new value, a problem occurs + * due to the fact a normal RET would not work if we restored ESP since + * RET would then try to read the result off the stack. + * + * The NT kernel solves this by adding 12 bytes of stack to the exiting + * trap frame, in which EFLAGS, CS, and EIP are stored, and then saving + * the ESP that's being requested into the ErrorCode field. It will then + * exit with an IRET. This fixes both issues, because it gives the stack + * some space where to hold the return address and then end up with the + * wanted stack, and it uses IRET which allows a new CS to be inputted. + * + */ + + /* Set CS that is requested */ + TrapFrame->SegCs = TrapFrame->TempSegCs; + + /* First make space on requested stack */ + ReturnStack = (PULONG)(TrapFrame->TempEsp - 12); + TrapFrame->ErrCode = (ULONG_PTR)ReturnStack; + + /* Now copy IRET frame */ + ReturnStack[0] = TrapFrame->Eip; + ReturnStack[1] = TrapFrame->SegCs; + ReturnStack[2] = TrapFrame->EFlags; + + /* Do special edited return */ + KiEditedTrapReturn(TrapFrame); + } + + /* Check if this is a user trap */ + if (__builtin_expect(KiUserTrap(TrapFrame), 1)) /* Ring 3 is where we spend time */ + { + /* Check if segments should be restored */ + if (!SkipBits.SkipSegments) + { + /* Restore segments */ + Ke386SetGs(TrapFrame->SegGs); + Ke386SetEs(TrapFrame->SegEs); + Ke386SetDs(TrapFrame->SegDs); + Ke386SetFs(TrapFrame->SegFs); + } + + /* Always restore FS since it goes from KPCR to TEB */ + Ke386SetFs(TrapFrame->SegFs); + } + + /* Check for system call -- a system call skips volatiles! */ + if (__builtin_expect(SkipBits.SkipVolatiles, 0)) /* More INTs than SYSCALLs */ + { + /* User or kernel call? */ + KiUserSystemCall(TrapFrame); + + /* Restore EFLags */ + __writeeflags(TrapFrame->EFlags); + + /* Call is kernel, so do a jump back since this wasn't a real INT */ + KiSystemCallReturn(TrapFrame); + + /* If we got here, this is SYSEXIT: are we stepping code? */ + if (!(TrapFrame->EFlags & EFLAGS_TF)) + { + /* Restore user FS */ + Ke386SetFs(KGDT_R3_TEB | RPL_MASK); + + /* Remove interrupt flag */ + TrapFrame->EFlags &= ~EFLAGS_INTERRUPT_MASK; + __writeeflags(TrapFrame->EFlags); + + /* Exit through SYSEXIT */ + KiSystemCallSysExitReturn(TrapFrame); + } + + /* Exit through IRETD, either due to debugging or due to lack of SYSEXIT */ + KiSystemCallTrapReturn(TrapFrame); + } + + /* Return from interrupt */ + KiTrapReturn(TrapFrame); +} // // Virtual 8086 Mode Optimized Trap Exit @@ -218,9 +517,6 @@ Thread = KeGetCurrentThread(); while (TRUE) { - /* Return if this isn't V86 mode anymore */ - if (!(TrapFrame->EFlags & EFLAGS_V86_MASK)) KiEoiHelper(TrapFrame);; - /* Turn off the alerted state for kernel mode */ Thread->Alerted[KernelMode] = FALSE; @@ -237,6 +533,9 @@ /* Restore IRQL and disable interrupts once again */ KfLowerIrql(OldIrql); _disable(); + + /* Return if this isn't V86 mode anymore */ + if (__builtin_expect(TrapFrame->EFlags & EFLAGS_V86_MASK, 0)) return; } /* If we got here, we're still in a valid V8086 context, so quit it */ Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] Wed Mar 3 17:30:56 2010 @@ -995,8 +995,55 @@ return 0; } -VOID FASTCALL DECLSPEC_NORETURN KiSystemCallSysExitReturn(IN PKTRAP_FRAME TrapFrame); -extern PVOID KiFastCallExitHandler; +VOID +NTAPI +KiDisableFastSyscallReturn(VOID) +{ + /* Was it applied? */ + if (KiSystemCallExitAdjusted) + { + /* Restore the original value */ + KiSystemCallExitBranch[1] = KiSystemCallExitBranch[1] - KiSystemCallExitAdjusted; + + /* It's not adjusted anymore */ + KiSystemCallExitAdjusted = FALSE; + } +} + +VOID +NTAPI +KiEnableFastSyscallReturn(VOID) +{ + /* Check if the patch has already been done */ + if ((KiSystemCallExitAdjusted == KiSystemCallExitAdjust) && + (KiFastCallCopyDoneOnce)) + { + return; + } + + /* Make sure the offset is within the distance of a Jxx SHORT */ + if ((KiSystemCallExitBranch[1] - KiSystemCallExitAdjust) < 0x80) + { + /* Remove any existing code patch */ + KiDisableFastSyscallReturn(); + + /* We should have a JNZ there */ + ASSERT(KiSystemCallExitBranch[0] == 0x75); + + /* Do the patch */ + KiSystemCallExitAdjusted = KiSystemCallExitAdjust; + KiSystemCallExitBranch[1] -= KiSystemCallExitAdjusted; + + /* Remember that we've done it */ + KiFastCallCopyDoneOnce = TRUE; + } + else + { + /* This shouldn't happen unless we've messed the macros up */ + DPRINT1("Your compiled kernel is broken!\n"); + DbgBreakPoint(); + } +} VOID NTAPI @@ -1008,11 +1055,11 @@ /* Check if it has been disabled */ if (!KiFastSystemCallDisable) { - /* Do an IPI to enable it */ - KeIpiGenericCall(KiLoadFastSyscallMachineSpecificRegisters, 0); - - /* It's enabled, so use the proper exit stub */ - KiFastCallExitHandler = KiSystemCallSysExitReturn; + /* KiSystemCallExit2 should come BEFORE KiSystemCallExit */ + ASSERT(KiSystemCallExit2 < KiSystemCallExit); + + /* It's enabled, so we'll have to do a code patch */ + KiSystemCallExitAdjust = KiSystemCallExit - KiSystemCallExit2; } else { @@ -1020,6 +1067,16 @@ KeFeatureBits &= ~KF_FAST_SYSCALL; } } + + /* Now check if all CPUs support fast system call, and the registry allows it */ + if (KeFeatureBits & KF_FAST_SYSCALL) + { + /* Do an IPI to enable it */ + KeIpiGenericCall(KiLoadFastSyscallMachineSpecificRegisters, 0); + } + + /* Perform the code patch that is required */ + KiEnableFastSyscallReturn(); } ULONG_PTR Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] Wed Mar 3 17:30:56 2010 @@ -120,18 +120,17 @@ PUBLIC _KiInterruptTemplateDispatch _KiInterruptTemplateDispatch: +EXTERN @KiSystemServiceHandler@8:PROC +PUBLIC _KiSystemService +_KiSystemService: + KiEnterTrap (KI_PUSH_FAKE_ERROR_CODE OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS) + jmp @KiSystemServiceHandler@8 + EXTERN @KiFastCallEntryHandler@8:PROC PUBLIC _KiFastCallEntry _KiFastCallEntry: KiEnterTrap (KI_FAST_SYSTEM_CALL OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS) - KiCallHandler @KiFastCallEntryHandler@8 - - -EXTERN @KiSystemServiceHandler@8:PROC -PUBLIC _KiSystemService -_KiSystemService: - KiEnterTrap (KI_PUSH_FAKE_ERROR_CODE OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS) - KiCallHandler @KiSystemServiceHandler@8 + jmp @KiFastCallEntryHandler@8 PUBLIC _KiStartUnexpectedRange@0 _KiStartUnexpectedRange@0: @@ -144,15 +143,4 @@ _KiEndUnexpectedRange@0: jmp _KiUnexpectedInterruptTail - -/* EXIT CODE *****************************************************************/ - -KiTrapExitStub KiSystemCallReturn, (KI_RESTORE_EAX OR KI_RESTORE_EFLAGS OR KI_EXIT_JMP) -KiTrapExitStub KiSystemCallSysExitReturn, (KI_RESTORE_EAX OR KI_RESTORE_FS OR KI_RESTORE_EFLAGS OR KI_EXIT_SYSCALL) -KiTrapExitStub KiSystemCallTrapReturn, (KI_RESTORE_EAX OR KI_RESTORE_FS OR KI_EXIT_IRET) - -KiTrapExitStub KiEditedTrapReturn, (KI_RESTORE_VOLATILES OR KI_RESTORE_EFLAGS OR KI_EDITED_FRAME OR KI_EXIT_RET) -KiTrapExitStub KiTrapReturn, (KI_RESTORE_VOLATILES OR KI_RESTORE_SEGMENTS OR KI_EXIT_IRET) -KiTrapExitStub KiTrapReturnNoSegments, (KI_RESTORE_VOLATILES OR KI_EXIT_IRET) - END Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Wed Mar 3 17:30:56 2010 @@ -45,8 +45,6 @@ 0x6F, /* OUTS */ }; -FAST_SYSTEM_CALL_EXIT KiFastCallExitHandler = KiSystemCallTrapReturn; - BOOLEAN FORCEINLINE KiVdmTrap(IN PKTRAP_FRAME TrapFrame) @@ -64,62 +62,21 @@ return ((TrapFrame->EFlags & EFLAGS_V86_MASK) != 0); } -BOOLEAN -FORCEINLINE -KeIsFrameEdited(IN PKTRAP_FRAME TrapFrame) -{ - /* An edited frame changes esp. It is marked by clearing the bits - defined by FRAME_EDITED in the SegCs field of the trap frame */ - return ((TrapFrame->SegCs & FRAME_EDITED) == 0); -} - /* TRAP EXIT CODE *************************************************************/ VOID -FORCEINLINE -KiCommonExit(IN PKTRAP_FRAME TrapFrame, const ULONG Flags) +FASTCALL +DECLSPEC_NORETURN +KiEoiHelper(IN PKTRAP_FRAME TrapFrame) { /* Disable interrupts until we return */ _disable(); - + /* Check for APC delivery */ KiCheckForApcDelivery(TrapFrame); - - /* Debugging checks */ - KiExitTrapDebugChecks(TrapFrame, Flags); - - /* Restore the SEH handler chain */ - KeGetPcr()->Tib.ExceptionList = TrapFrame->ExceptionList; - - /* Check if there are active debug registers */ - if (__builtin_expect(TrapFrame->Dr7 & ~DR7_RESERVED_MASK, 0)) - { - /* Not handled yet */ - DbgPrint("Need Hardware Breakpoint Support!\n"); - DbgBreakPoint(); - while (TRUE); - } -} - -VOID -FASTCALL -DECLSPEC_NORETURN -KiEoiHelper(IN PKTRAP_FRAME TrapFrame) -{ - /* Common trap exit code */ - KiCommonExit(TrapFrame, 0); - - /* Check if this was a V8086 trap */ - if (TrapFrame->EFlags & EFLAGS_V86_MASK) KiTrapReturnNoSegments(TrapFrame); - - /* Check for user mode exit */ - if (TrapFrame->SegCs & MODE_MASK) KiTrapReturn(TrapFrame); - - /* Check for edited frame */ - if (KeIsFrameEdited(TrapFrame)) KiEditedTrapReturn(TrapFrame); - - /* Exit the trap to kernel mode */ - KiTrapReturnNoSegments(TrapFrame); + + /* Now exit the trap for real */ + KiExitTrap(TrapFrame, KTE_SKIP_PM_BIT); } VOID @@ -128,36 +85,17 @@ KiServiceExit(IN PKTRAP_FRAME TrapFrame, IN NTSTATUS Status) { - ASSERT((TrapFrame->EFlags & EFLAGS_V86_MASK) == 0); - ASSERT(!KeIsFrameEdited(TrapFrame)); - + /* Disable interrupts until we return */ + _disable(); + + /* Check for APC delivery */ + KiCheckForApcDelivery(TrapFrame); + /* Copy the status into EAX */ TrapFrame->Eax = Status; - - /* Common trap exit code */ - KiCommonExit(TrapFrame, 0); - - /* Restore previous mode */ - KeGetCurrentThread()->PreviousMode = TrapFrame->PreviousPreviousMode; - - /* Check for user mode exit */ - if (TrapFrame->SegCs & MODE_MASK) - { - /* Check if we were single stepping */ - if (TrapFrame->EFlags & EFLAGS_TF) - { - /* Must use the IRET handler */ - KiSystemCallTrapReturn(TrapFrame); - } - else - { - /* We can use the sysexit handler */ - KiFastCallExitHandler(TrapFrame); - } - } - - /* Exit to kernel mode */ - KiSystemCallReturn(TrapFrame); + + /* Now exit the trap for real */ + KiExitTrap(TrapFrame, KTE_SKIP_SEG_BIT | KTE_SKIP_VOL_BIT); } VOID @@ -165,23 +103,14 @@ DECLSPEC_NORETURN KiServiceExit2(IN PKTRAP_FRAME TrapFrame) { - /* Common trap exit code */ - KiCommonExit(TrapFrame, 0); - - /* Restore previous mode */ - KeGetCurrentThread()->PreviousMode = TrapFrame->PreviousPreviousMode; - - /* Check if this was a V8086 trap */ - if (TrapFrame->EFlags & EFLAGS_V86_MASK) KiTrapReturnNoSegments(TrapFrame); - - /* Check for user mode exit */ - if (TrapFrame->SegCs & MODE_MASK) KiTrapReturn(TrapFrame); - - /* Check for edited frame */ - if (KeIsFrameEdited(TrapFrame)) KiEditedTrapReturn(TrapFrame); - - /* Exit the trap to kernel mode */ - KiTrapReturnNoSegments(TrapFrame); + /* Disable interrupts until we return */ + _disable(); + + /* Check for APC delivery */ + KiCheckForApcDelivery(TrapFrame); + + /* Now exit the trap for real */ + KiExitTrap(TrapFrame, 0); } /* TRAP HANDLERS **************************************************************/ @@ -653,7 +582,10 @@ _disable(); /* Do a quick V86 exit if possible */ - KiExitV86Trap(TrapFrame); + if (__builtin_expect(TrapFrame->EFlags & EFLAGS_V86_MASK, 1)) KiExitV86Trap(TrapFrame); + + /* Exit trap the slow way */ + KiEoiHelper(TrapFrame); } /* Save trap frame */ @@ -910,7 +842,10 @@ _disable(); /* Do a quick V86 exit if possible */ - KiExitV86Trap(TrapFrame); + if (__builtin_expect(TrapFrame->EFlags & EFLAGS_V86_MASK, 1)) KiExitV86Trap(TrapFrame); + + /* Exit trap the slow way */ + KiEoiHelper(TrapFrame); } /* Save trap frame */ @@ -974,7 +909,7 @@ (((Instructions[i + 2] & 0x38) == 0x10) || // LLDT (Instructions[i + 2] == 0x18))) || // LTR ((Instructions[i + 1] == 0x01) && // LGDT or LIDT or LMSW - (((Instructions[i + 2] & 0x38) == 0x10) || // LGDT + (((Instructions[i + 2] & 0x38) == 0x10) || // LLGT (Instructions[i + 2] == 0x18) || // LIDT (Instructions[i + 2] == 0x30))) || // LMSW (Instructions[i + 1] == 0x08) || // INVD @@ -986,7 +921,6 @@ (Instructions[i + 1] == 0x24) || // MOV YYY, DR (Instructions[i + 1] == 0x30) || // WRMSR (Instructions[i + 1] == 0x33)) // RDPMC - // INVLPG, INVLPGA, SYSRET { /* These are all privileged */ Privileged = TRUE; @@ -1059,7 +993,7 @@ * a POP <SEG>, which could cause an invalid segment if someone had messed * with the segment values. * - * Another case is a bogus SS, which would hit a GPF when doing the iret. + * Another case is a bogus SS, which would hit a GPF when doing the ired. * This could only be done through a buggy or malicious driver, or perhaps * the kernel debugger. * @@ -1133,14 +1067,9 @@ /* Fix it */ TrapFrame->SegEs = (KGDT_R3_DATA | RPL_MASK); } - else - { - /* Whatever it is, we can't handle it */ - KiSystemFatalException(EXCEPTION_GP_FAULT, TrapFrame); - } - - /* Return to where we came from */ - KiTrapReturn(TrapFrame); + + /* Do a direct trap exit: restore volatiles only */ + KiExitTrap(TrapFrame, KTE_SKIP_PM_BIT | KTE_SKIP_SEG_BIT); } VOID @@ -1247,7 +1176,7 @@ Cr2, TrapFrame); } - + /* Only other choice is an in-page error, with 3 parameters */ KiDispatchExceptionFromTrapFrame(STATUS_IN_PAGE_ERROR, TrapFrame->Eip, @@ -1448,36 +1377,118 @@ } VOID -FORCEINLINE -DECLSPEC_NORETURN -KiSystemCall(IN PKTRAP_FRAME TrapFrame, - IN PVOID Arguments) +FASTCALL +DECLSPEC_NORETURN +KiSystemCall(IN ULONG SystemCallNumber, + IN PVOID Arguments) { PKTHREAD Thread; + PKTRAP_FRAME TrapFrame; PKSERVICE_TABLE_DESCRIPTOR DescriptorTable; ULONG Id, Offset, StackBytes, Result; PVOID Handler; - ULONG SystemCallNumber = TrapFrame->Eax; - - /* Get the current thread */ - Thread = KeGetCurrentThread(); - - /* Set debug header */ - KiFillTrapFrameDebug(TrapFrame); - - /* Chain trap frames */ - TrapFrame->Edx = (ULONG_PTR)Thread->TrapFrame; - + + /* Loop because we might need to try this twice in case of a GUI call */ + while (TRUE) + { + /* Decode the system call number */ + Offset = (SystemCallNumber >> SERVICE_TABLE_SHIFT) & SERVICE_TABLE_MASK; + Id = SystemCallNumber & SERVICE_NUMBER_MASK; + + /* Get current thread, trap frame, and descriptor table */ + Thread = KeGetCurrentThread(); + TrapFrame = Thread->TrapFrame; + DescriptorTable = (PVOID)((ULONG_PTR)Thread->ServiceTable + Offset); + + /* Validate the system call number */ + if (__builtin_expect(Id >= DescriptorTable->Limit, 0)) + { + /* Check if this is a GUI call */ + if (__builtin_expect(!(Offset & SERVICE_TABLE_TEST), 0)) + { + /* Fail the call */ + Result = STATUS_INVALID_SYSTEM_SERVICE; + goto ExitCall; + } + + /* Convert us to a GUI thread -- must wrap in ASM to get new EBP */ + Result = KiConvertToGuiThread(); + if (__builtin_expect(!NT_SUCCESS(Result), 0)) + { + /* Figure out how we should fail to the user */ + UNIMPLEMENTED; + while (TRUE); + } + + /* Try the call again */ + continue; + } + + /* If we made it here, the call is good */ + break; + } + + /* Check if this is a GUI call */ + if (__builtin_expect(Offset & SERVICE_TABLE_TEST, 0)) + { + /* Get the batch count and flush if necessary */ + if (NtCurrentTeb()->GdiBatchCount) KeGdiFlushUserBatch(); + } + + /* Increase system call count */ + KeGetCurrentPrcb()->KeSystemCalls++; + + /* FIXME: Increase individual counts on debug systems */ + //KiIncreaseSystemCallCount(DescriptorTable, Id); + + /* Get stack bytes */ + StackBytes = DescriptorTable->Number[Id]; + + /* Probe caller stack */ + if (__builtin_expect((Arguments < (PVOID)MmUserProbeAddress) && !(KiUserTrap(TrapFrame)), 0)) + { + /* Access violation */ + UNIMPLEMENTED; + while (TRUE); + } + + /* Get the handler and make the system call */ + Handler = (PVOID)DescriptorTable->Base[Id]; + Result = KiSystemCallTrampoline(Handler, Arguments, StackBytes); + + /* Make sure we're exiting correctly */ + KiExitSystemCallDebugChecks(Id, TrapFrame); + + /* Restore the old trap frame */ +ExitCall: + Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx; + + /* Exit from system call */ + KiServiceExit(TrapFrame, Result); +} + +VOID +FORCEINLINE +DECLSPEC_NORETURN +KiSystemCallHandler(IN PKTRAP_FRAME TrapFrame, + IN ULONG ServiceNumber, + IN PVOID Arguments, + IN PKTHREAD Thread, + IN KPROCESSOR_MODE PreviousMode, + IN KPROCESSOR_MODE PreviousPreviousMode, + IN USHORT SegFs) +{ /* No error code */ TrapFrame->ErrCode = 0; - - /* Save previous mode */ - TrapFrame->PreviousPreviousMode = Thread->PreviousMode; - + + /* Save previous mode and FS segment */ + TrapFrame->PreviousPreviousMode = PreviousPreviousMode; + TrapFrame->SegFs = SegFs; + /* Save the SEH chain and terminate it for now */ TrapFrame->ExceptionList = KeGetPcr()->Tib.ExceptionList; KeGetPcr()->Tib.ExceptionList = EXCEPTION_CHAIN_END; - + /* Clear DR7 and check for debugging */ TrapFrame->Dr7 = 0; if (__builtin_expect(Thread->DispatcherHeader.DebugActive & 0xFF, 0)) @@ -1488,98 +1499,14 @@ /* Set thread fields */ Thread->TrapFrame = TrapFrame; - Thread->PreviousMode = KiUserTrap(TrapFrame); - - /* Enable interrupts */ + Thread->PreviousMode = PreviousMode; + + /* Set debug header */ + KiFillTrapFrameDebug(TrapFrame); + + /* Enable interrupts and make the call */ _enable(); - - /* Decode the system call number */ - Offset = (SystemCallNumber >> SERVICE_TABLE_SHIFT) & SERVICE_TABLE_MASK; - Id = SystemCallNumber & SERVICE_NUMBER_MASK; - - /* Get descriptor table */ - DescriptorTable = (PVOID)((ULONG_PTR)Thread->ServiceTable + Offset); - - /* Validate the system call number */ - if (__builtin_expect(Id >= DescriptorTable->Limit, 0)) - { - /* Check if this is a GUI call */ - if (!(Offset & SERVICE_TABLE_TEST)) - { - /* Fail the call */ - Result = STATUS_INVALID_SYSTEM_SERVICE; - goto ExitCall; - } - - /* Convert us to a GUI thread -- must wrap in ASM to get new EBP */ - Result = KiConvertToGuiThread(); - if (!NT_SUCCESS(Result)) - { - /* Set the last error and fail */ - //SetLastWin32Error(RtlNtStatusToDosError(Result)); - goto ExitCall; - } - - /* Reload trap frame and descriptor table pointer from new stack */ - TrapFrame = *(volatile PVOID*)&Thread->TrapFrame; - DescriptorTable = (PVOID)(*(volatile ULONG_PTR*)&Thread->ServiceTable + Offset); - - /* Validate the system call number again */ - if (Id >= DescriptorTable->Limit) - { - /* Fail the call */ - Result = STATUS_INVALID_SYSTEM_SERVICE; - goto ExitCall; - } - } - - /* Check if this is a GUI call */ - if (__builtin_expect(Offset & SERVICE_TABLE_TEST, 0)) - { - /* Get the batch count and flush if necessary */ - if (NtCurrentTeb()->GdiBatchCount) KeGdiFlushUserBatch(); - } - - /* Increase system call count */ - KeGetCurrentPrcb()->KeSystemCalls++; - - /* FIXME: Increase individual counts on debug systems */ - //KiIncreaseSystemCallCount(DescriptorTable, Id); - - /* Get stack bytes */ - StackBytes = DescriptorTable->Number[Id]; - - /* Probe caller stack */ - if (__builtin_expect((Arguments < (PVOID)MmUserProbeAddress) && !(KiUserTrap(TrapFrame)), 0)) - { - /* Access violation */ - UNIMPLEMENTED; - while (TRUE); - } - - /* Get the handler and make the system call */ - Handler = (PVOID)DescriptorTable->Base[Id]; - Result = KiSystemCallTrampoline(Handler, Arguments, StackBytes); - - /* Make sure we're exiting correctly */ - KiExitSystemCallDebugChecks(Id, TrapFrame); - - /* Restore the old trap frame */ -ExitCall: - Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx; - - /* Exit from system call */ - KiServiceExit(TrapFrame, Result); -} - -VOID -FASTCALL -DECLSPEC_NORETURN -KiSystemServiceHandler(IN PKTRAP_FRAME TrapFrame, - IN PVOID Arguments) -{ - /* Call the shared handler (inline) */ - KiSystemCall(TrapFrame, Arguments); + KiSystemCall(ServiceNumber, Arguments); } VOID @@ -1588,20 +1515,54 @@ KiFastCallEntryHandler(IN PKTRAP_FRAME TrapFrame, IN PVOID Arguments) { + PKTHREAD Thread; + /* Set up a fake INT Stack and enable interrupts */ TrapFrame->HardwareSegSs = KGDT_R3_DATA | RPL_MASK; TrapFrame->HardwareEsp = (ULONG_PTR)Arguments; TrapFrame->EFlags = __readeflags() | EFLAGS_INTERRUPT_MASK; TrapFrame->SegCs = KGDT_R3_CODE | RPL_MASK; TrapFrame->Eip = SharedUserData->SystemCallReturn; - TrapFrame->SegFs = KGDT_R3_TEB | RPL_MASK; __writeeflags(0x2); - /* Arguments are actually 2 frames down (because of the double indirection) */ + /* Get the current thread */ + Thread = KeGetCurrentThread(); + + /* Arguments are actually 2 frames down (because of the double indirection) */ Arguments = (PVOID)(TrapFrame->HardwareEsp + 8); /* Call the shared handler (inline) */ - KiSystemCall(TrapFrame, Arguments); + KiSystemCallHandler(TrapFrame, + TrapFrame->Eax, + Arguments, + Thread, + UserMode, + Thread->PreviousMode, + KGDT_R3_TEB | RPL_MASK); +} + +VOID +FASTCALL +DECLSPEC_NORETURN +KiSystemServiceHandler(IN PKTRAP_FRAME TrapFrame, + IN PVOID Arguments) +{ + PKTHREAD Thread; + + /* Get the current thread */ + Thread = KeGetCurrentThread(); + + /* Chain trap frames */ + TrapFrame->Edx = (ULONG_PTR)Thread->TrapFrame; + + /* Call the shared handler (inline) */ + KiSystemCallHandler(TrapFrame, + TrapFrame->Eax, + Arguments, + Thread, + KiUserTrap(TrapFrame), + Thread->PreviousMode, + TrapFrame->SegFs); } /*
14 years, 9 months
1
0
0
0
[cwittich] 45791: [SHLWAPI] sync shlwapi to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Mar 3 17:21:34 2010 New Revision: 45791 URL:
http://svn.reactos.org/svn/reactos?rev=45791&view=rev
Log: [SHLWAPI] sync shlwapi to wine 1.1.39 Modified: trunk/reactos/dll/win32/shlwapi/msgbox.c trunk/reactos/dll/win32/shlwapi/ordinal.c trunk/reactos/dll/win32/shlwapi/reg.c trunk/reactos/dll/win32/shlwapi/shlwapi.rc trunk/reactos/dll/win32/shlwapi/shlwapi.spec trunk/reactos/dll/win32/shlwapi/shlwapi_De.rc trunk/reactos/dll/win32/shlwapi/shlwapi_Fr.rc trunk/reactos/dll/win32/shlwapi/shlwapi_Ja.rc trunk/reactos/dll/win32/shlwapi/shlwapi_No.rc trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc trunk/reactos/dll/win32/shlwapi/url.c Modified: trunk/reactos/dll/win32/shlwapi/msgbox.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/msgbox.c…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/msgbox.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/msgbox.c [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -147,10 +147,10 @@ WCHAR szNameBuff[MAX_PATH], szIdBuff[MAX_PATH]; LPCWSTR szName = szNameBuff; - if (HIWORD(lpszName)) + if (IS_INTRESOURCE(lpszName)) + szName = (LPCWSTR)lpszName; /* Resource Id or NULL */ + else MultiByteToWideChar(CP_ACP, 0, lpszName, -1, szNameBuff, MAX_PATH); - else - szName = (LPCWSTR)lpszName; /* Resource Id or NULL */ MultiByteToWideChar(CP_ACP, 0, lpszId, -1, szIdBuff, MAX_PATH); Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -46,6 +46,7 @@ #include "shlwapi.h" #include "shellapi.h" #include "commdlg.h" +#include "mlang.h" #include "mshtmhst.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -450,14 +451,14 @@ * * PARAMS * langbuf [O] Destination for language string - * buflen [I] Length of langbuf + * buflen [I] Length of langbuf in characters * [0] Success: used length of langbuf * * RETURNS * Success: S_OK. langbuf is set to the language string found. * Failure: E_FAIL, If any arguments are invalid, error occurred, or Explorer * does not contain the setting. - * E_INVALIDARG, If the buffer is not big enough + * HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), If the buffer is not big enough */ HRESULT WINAPI GetAcceptLanguagesW( LPWSTR langbuf, LPDWORD buflen) { @@ -468,49 +469,50 @@ 'I','n','t','e','r','n','a','t','i','o','n','a','l',0}; static const WCHAR valueW[] = { 'A','c','c','e','p','t','L','a','n','g','u','a','g','e',0}; - static const WCHAR enusW[] = {'e','n','-','u','s',0}; DWORD mystrlen, mytype; + DWORD len; HKEY mykey; HRESULT retval; LCID mylcid; WCHAR *mystr; + LONG lres; + + TRACE("(%p, %p) *%p: %d\n", langbuf, buflen, buflen, buflen ? *buflen : -1); if(!langbuf || !buflen || !*buflen) return E_FAIL; mystrlen = (*buflen > 20) ? *buflen : 20 ; - mystr = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * mystrlen); + len = mystrlen * sizeof(WCHAR); + mystr = HeapAlloc(GetProcessHeap(), 0, len); + mystr[0] = 0; RegOpenKeyW(HKEY_CURRENT_USER, szkeyW, &mykey); - if(RegQueryValueExW(mykey, valueW, 0, &mytype, (PBYTE)mystr, &mystrlen)) { - /* Did not find value */ - mylcid = GetUserDefaultLCID(); - /* somehow the mylcid translates into "en-us" - * this is similar to "LOCALE_SABBREVLANGNAME" - * which could be gotten via GetLocaleInfo. - * The only problem is LOCALE_SABBREVLANGUAGE" is - * a 3 char string (first 2 are country code and third is - * letter for "sublanguage", which does not come close to - * "en-us" - */ - lstrcpyW(mystr, enusW); - mystrlen = lstrlenW(mystr); - } else { - /* handle returned string */ - FIXME("missing code\n"); - } - memcpy( langbuf, mystr, min(*buflen,strlenW(mystr)+1)*sizeof(WCHAR) ); - - if(*buflen > strlenW(mystr)) { - *buflen = strlenW(mystr); - retval = S_OK; - } else { - *buflen = 0; - retval = E_INVALIDARG; - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } + lres = RegQueryValueExW(mykey, valueW, 0, &mytype, (PBYTE)mystr, &len); RegCloseKey(mykey); + len = lstrlenW(mystr); + + if (!lres && (*buflen > len)) { + lstrcpyW(langbuf, mystr); + *buflen = len; + HeapFree(GetProcessHeap(), 0, mystr); + return S_OK; + } + + /* Did not find a value in the registry or the user buffer is to small */ + mylcid = GetUserDefaultLCID(); + retval = LcidToRfc1766W(mylcid, mystr, mystrlen); + len = lstrlenW(mystr); + + memcpy( langbuf, mystr, min(*buflen, len+1)*sizeof(WCHAR) ); HeapFree(GetProcessHeap(), 0, mystr); - return retval; + + if (*buflen > len) { + *buflen = len; + return S_OK; + } + + *buflen = 0; + return __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); } /************************************************************************* @@ -524,6 +526,8 @@ DWORD buflenW, convlen; HRESULT retval; + TRACE("(%p, %p) *%p: %d\n", langbuf, buflen, buflen, buflen ? *buflen : -1); + if(!langbuf || !buflen || !*buflen) return E_FAIL; buflenW = *buflen; @@ -533,11 +537,20 @@ if (retval == S_OK) { convlen = WideCharToMultiByte(CP_ACP, 0, langbufW, -1, langbuf, *buflen, NULL, NULL); + convlen--; /* do not count the terminating 0 */ } else /* copy partial string anyway */ { convlen = WideCharToMultiByte(CP_ACP, 0, langbufW, *buflen, langbuf, *buflen, NULL, NULL); - if (convlen < *buflen) langbuf[convlen] = 0; + if (convlen < *buflen) + { + langbuf[convlen] = 0; + convlen--; /* do not count the terminating 0 */ + } + else + { + convlen = *buflen; + } } *buflen = buflenW ? convlen : 0; @@ -1128,7 +1141,7 @@ * PARAMS * lpUnkSink [I] Sink for the connection point advise call * riid [I] REFIID of connection point to advise - * bAdviseOnly [I] TRUE = Advise only, FALSE = Unadvise first + * fConnect [I] TRUE = Connection being establisted, FALSE = broken * lpUnknown [I] Object supporting the IConnectionPointContainer interface * lpCookie [O] Pointer to connection point cookie * lppCP [O] Destination for the IConnectionPoint found @@ -1140,7 +1153,7 @@ * E_NOINTERFACE, if lpUnknown isn't an IConnectionPointContainer, * Or an HRESULT error code if any call fails. */ -HRESULT WINAPI ConnectToConnectionPoint(IUnknown* lpUnkSink, REFIID riid, BOOL bAdviseOnly, +HRESULT WINAPI ConnectToConnectionPoint(IUnknown* lpUnkSink, REFIID riid, BOOL fConnect, IUnknown* lpUnknown, LPDWORD lpCookie, IConnectionPoint **lppCP) { @@ -1148,7 +1161,7 @@ IConnectionPointContainer* lpContainer; IConnectionPoint *lpCP; - if(!lpUnknown || (bAdviseOnly && !lpUnkSink)) + if(!lpUnknown || (fConnect && !lpUnkSink)) return E_FAIL; if(lppCP) @@ -1162,9 +1175,10 @@ if (SUCCEEDED(hRet)) { - if(!bAdviseOnly) + if(!fConnect) hRet = IConnectionPoint_Unadvise(lpCP, *lpCookie); - hRet = IConnectionPoint_Advise(lpCP, lpUnkSink, lpCookie); + else + hRet = IConnectionPoint_Advise(lpCP, lpUnkSink, lpCookie); if (FAILED(hRet)) *lpCookie = 0; @@ -2929,20 +2943,27 @@ { IEnumConnections *enumerator; CONNECTDATA rgcd; + static DISPPARAMS empty = {NULL, NULL, 0, 0}; + DISPPARAMS* params = dispParams; HRESULT result = IConnectionPoint_EnumConnections(iCP, &enumerator); if (FAILED(result)) return result; + /* Invoke is never happening with an NULL dispParams */ + if (!params) + params = ∅ + while(IEnumConnections_Next(enumerator, 1, &rgcd, NULL)==S_OK) { IDispatch *dispIface; - if (SUCCEEDED(IUnknown_QueryInterface(rgcd.pUnk, iid, (LPVOID*)&dispIface)) || + if ((iid && SUCCEEDED(IUnknown_QueryInterface(rgcd.pUnk, iid, (LPVOID*)&dispIface))) || SUCCEEDED(IUnknown_QueryInterface(rgcd.pUnk, &IID_IDispatch, (LPVOID*)&dispIface))) { - IDispatch_Invoke(dispIface, dispId, &IID_NULL, 0, DISPATCH_METHOD, dispParams, NULL, NULL, NULL); + IDispatch_Invoke(dispIface, dispId, &IID_NULL, 0, DISPATCH_METHOD, params, NULL, NULL, NULL); IDispatch_Release(dispIface); } + IUnknown_Release(rgcd.pUnk); } IEnumConnections_Release(enumerator); @@ -2965,6 +2986,8 @@ result = IConnectionPoint_GetConnectionInterface(iCP, &iid); if (SUCCEEDED(result)) result = SHLWAPI_InvokeByIID(iCP, &iid, dispId, dispParams); + else + result = SHLWAPI_InvokeByIID(iCP, NULL, dispId, dispParams); return result; } @@ -2988,6 +3011,8 @@ result = IConnectionPoint_GetConnectionInterface(iCP, &iid); if (SUCCEEDED(result)) result = SHLWAPI_InvokeByIID(iCP, &iid, dispId, dispParams); + else + result = SHLWAPI_InvokeByIID(iCP, NULL, dispId, dispParams); return result; } @@ -3901,6 +3926,8 @@ case OS_APPLIANCE: FIXME("(OS_APPLIANCE) What should we return here?\n"); return FALSE; + case 0x25: /*OS_VISTAORGREATER*/ + ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && majorv >= 6) } #undef ISOS_RETURN @@ -4697,3 +4724,78 @@ return 0; } + +/*********************************************************************** + * SHVerbExistsNA [SHLWAPI.196] + * + * + * PARAMS + * + * verb [I] a string, often appears to be an extension. + * + * Other parameters currently unknown. + * + * RETURNS + * unknown + */ +INT WINAPI SHVerbExistsNA(LPSTR verb, PVOID pUnknown, PVOID pUnknown2, DWORD dwUnknown3) +{ + FIXME("(%s, %p, %p, %i) STUB\n",verb, pUnknown, pUnknown2, dwUnknown3); + return 0; +} + +/************************************************************************* + * @ [SHLWAPI.538] + * + * Undocumented: Implementation guessed at via Name and behavior + * + * PARAMS + * lpUnknown [I] Object to get an IServiceProvider interface from + * riid [I] Function requested for QueryService call + * lppOut [O] Destination for the service interface pointer + * + * RETURNS + * Success: S_OK. lppOut contains an object providing the requested service + * Failure: An HRESULT error code + * + * NOTES + * lpUnknown is expected to support the IServiceProvider interface. + */ +HRESULT WINAPI IUnknown_QueryServiceForWebBrowserApp(IUnknown* lpUnknown, + REFGUID riid, LPVOID *lppOut) +{ + FIXME("%p %s %p semi-STUB\n", lpUnknown, debugstr_guid(riid), lppOut); + return IUnknown_QueryService(lpUnknown,&IID_IWebBrowserApp,riid,lppOut); +} + +/************************************************************************** + * SHPropertyBag_ReadLONG (SHLWAPI.496) + * + * This function asks a property bag to read a named property as a LONG. + * + * PARAMS + * ppb: a IPropertyBag interface + * pszPropName: Unicode string that names the property + * pValue: address to receive the property value as a 32-bit signed integer + * + * RETURNS + * 0 for Success + */ +BOOL WINAPI SHPropertyBag_ReadLONG(IPropertyBag *ppb, LPCWSTR pszPropName, LPLONG pValue) +{ + VARIANT var; + HRESULT hr; + TRACE("%p %s %p\n", ppb,debugstr_w(pszPropName),pValue); + if (!pszPropName || !ppb || !pValue) + return E_INVALIDARG; + V_VT(&var) = VT_I4; + hr = IPropertyBag_Read(ppb, pszPropName, &var, NULL); + if (SUCCEEDED(hr)) + { + if (V_VT(&var) == VT_I4) + *pValue = V_I4(&var); + else + hr = DISP_E_BADVARTYPE; + } + return hr; +} Modified: trunk/reactos/dll/win32/shlwapi/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/reg.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -1138,68 +1138,6 @@ } /************************************************************************* - * SHRegGetValueA [SHLWAPI.@] - * - * Get a value from the registry. - * - * PARAMS - * hKey [I] Handle to registry key - * lpszSubKey [I] Name of sub key containing value to get - * lpszValue [I] Name of value to get - * srrf [I] Flags for restricting returned data - * pwType [O] Pointer to the values type - * pvData [O] Pointer to the values data - * pcbData [O] Pointer to the values size - * - * RETURNS - * Success: ERROR_SUCCESS. Output parameters contain the details read. - * Failure: An error code from RegOpenKeyExA() or SHQueryValueExA(). - */ -DWORD WINAPI SHRegGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, DWORD srrfFlags, - LPDWORD pwType, LPVOID pvData, LPDWORD pcbData) -{ - DWORD dwRet = 0; - HKEY hSubKey = 0; - - TRACE("(hkey=%p,%s,%s,%p,%p,%p)\n", hKey, debugstr_a(lpszSubKey), - debugstr_a(lpszValue), pwType, pvData, pcbData); - FIXME("Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08x\n", srrfFlags); - - dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey); - if (! dwRet) - { - /* SHQueryValueEx expands Environment strings */ - dwRet = SHQueryValueExA(hSubKey, lpszValue, 0, pwType, pvData, pcbData); - RegCloseKey(hSubKey); - } - return dwRet; -} - -/************************************************************************* - * SHReg GetRegValueW [SHLWAPI.@] - * - * See SHGetValueA. - */ -DWORD WINAPI SHRegGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD srrfFlags, - LPDWORD pwType, LPVOID pvData, LPDWORD pcbData) -{ - DWORD dwRet = 0; - HKEY hSubKey = 0; - - TRACE("(hkey=%p,%s,%s,0x%08x, %p,%p,%p)\n", hKey, debugstr_w(lpszSubKey), - debugstr_w(lpszValue), srrfFlags,pwType, pvData, pcbData); - FIXME("Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08x\n", srrfFlags); - - dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey); - if (! dwRet) - { - dwRet = SHQueryValueExW(hSubKey, lpszValue, 0, pwType, pvData, pcbData); - RegCloseKey(hSubKey); - } - return dwRet; -} - -/************************************************************************* * SHGetValueW [SHLWAPI.@] * * See SHGetValueA. Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -26,26 +26,29 @@ #include "version.rc" #include "shlwapi_Da.rc" -#include "shlwapi_De.rc" #include "shlwapi_En.rc" #include "shlwapi_Eo.rc" #include "shlwapi_Es.rc" #include "shlwapi_Fi.rc" -#include "shlwapi_Fr.rc" #include "shlwapi_Hu.rc" #include "shlwapi_It.rc" -#include "shlwapi_Ja.rc" #include "shlwapi_Ko.rc" -#include "shlwapi_Lt.rc" #include "shlwapi_Nl.rc" -#include "shlwapi_No.rc" #include "shlwapi_Pl.rc" #include "shlwapi_Pt.rc" -#include "shlwapi_Ro.rc" -#include "shlwapi_Ru.rc" -#include "shlwapi_Si.rc" #include "shlwapi_Sk.rc" #include "shlwapi_Sv.rc" #include "shlwapi_Tr.rc" #include "shlwapi_Uk.rc" #include "shlwapi_Zh.rc" + +/* UTF-8 */ + +#include "shlwapi_De.rc" +#include "shlwapi_Fr.rc" +#include "shlwapi_Ja.rc" +#include "shlwapi_Lt.rc" +#include "shlwapi_No.rc" +#include "shlwapi_Ro.rc" +#include "shlwapi_Ru.rc" +#include "shlwapi_Si.rc" Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.spec [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -193,7 +193,7 @@ 193 stdcall -noname SHGetCurColorRes() 194 stdcall -noname SHWaitForSendMessageThread(ptr long) 195 stdcall -noname SHIsExpandableFolder(ptr ptr) -196 stdcall -noname DnsRecordSetCompare(ptr ptr ptr ptr) dnsapi.DnsRecordSetCompare +196 stdcall -noname SHVerbExistsNA(str ptr ptr long) 197 stdcall -noname SHFillRectClr(long ptr long) 198 stdcall -noname SHSearchMapInt(ptr ptr long long) 199 stdcall -noname IUnknown_Set(ptr ptr) @@ -460,8 +460,8 @@ 460 stdcall -noname SHExpandEnvironmentStringsW(wstr ptr long) kernel32.ExpandEnvironmentStringsW 461 stdcall -noname SHGetAppCompatFlags(long) 462 stdcall -noname UrlFixupW(wstr wstr long) -463 stub -noname SHExpandEnvironmentStringsForUserA -464 stub -noname SHExpandEnvironmentStringsForUserW +463 stdcall -noname SHExpandEnvironmentStringsForUserA(ptr str ptr long) userenv.ExpandEnvironmentStringsForUserA +464 stdcall -noname SHExpandEnvironmentStringsForUserW(ptr wstr ptr long) userenv.ExpandEnvironmentStringsForUserW 465 stub -noname PathUnExpandEnvStringsForUserA 466 stub -noname PathUnExpandEnvStringsForUserW 467 stub -noname SHRunIndirectRegClientCommand @@ -493,7 +493,7 @@ 493 stub -noname SHPropertyBag_ReadType 494 stub -noname SHPropertyBag_ReadStr 495 stub -noname SHPropertyBag_WriteStr -496 stub -noname SHPropertyBag_ReadLONG +496 stdcall -noname SHPropertyBag_ReadLONG(ptr wstr ptr) 497 stub -noname SHPropertyBag_WriteLONG 498 stub -noname SHPropertyBag_ReadBOOLOld 499 stub -noname SHPropertyBag_WriteBOOL @@ -531,7 +531,7 @@ 535 stub -noname SHPropertyBag_Delete 536 stub -noname IUnknown_QueryServicePropertyBag 537 stub -noname SHBoolSystemParametersInfo -538 stub -noname IUnknown_QueryServiceForWebBrowserApp +538 stdcall -noname IUnknown_QueryServiceForWebBrowserApp(ptr ptr ptr) 539 stub -noname IUnknown_ShowBrowserBar 540 stub -noname SHInvokeCommandOnContextMenu 541 stub -noname SHInvokeCommandsOnContextMen @@ -725,8 +725,8 @@ @ stdcall SHRegGetPathW(long wstr wstr ptr long) @ stdcall SHRegGetUSValueA ( str str ptr ptr ptr long ptr long ) @ stdcall SHRegGetUSValueW ( wstr wstr ptr ptr ptr long ptr long ) -@ stdcall SHRegGetValueA ( long str str long ptr ptr ptr ) -@ stdcall SHRegGetValueW ( long wstr wstr long ptr ptr ptr ) +@ stdcall SHRegGetValueA ( long str str long ptr ptr ptr ) advapi32.RegGetValueA +@ stdcall SHRegGetValueW ( long wstr wstr long ptr ptr ptr ) advapi32.RegGetValueW @ stdcall SHRegOpenUSKeyA ( str long long long long ) @ stdcall SHRegOpenUSKeyW ( wstr long long long long ) @ stdcall SHRegQueryInfoUSKeyA ( long ptr ptr ptr ptr long ) Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_De.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_De.rc [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -45,4 +45,3 @@ IDS_TIME_INTERVAL_MINUTES " Min" IDS_TIME_INTERVAL_SECONDS " Sek" } -#pragma code_page(default) Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Fr.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Fr.rc [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -46,4 +46,3 @@ IDS_TIME_INTERVAL_MINUTES " min" IDS_TIME_INTERVAL_SECONDS " sec" } -#pragma code_page(default) Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_Ja.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Ja.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Ja.rc [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -46,4 +46,3 @@ IDS_TIME_INTERVAL_MINUTES " min" IDS_TIME_INTERVAL_SECONDS " sec" } -#pragma code_page(default) Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_No.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_No.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_No.rc [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -43,4 +43,3 @@ IDS_TIME_INTERVAL_MINUTES " min" IDS_TIME_INTERVAL_SECONDS " sec" } -#pragma code_page(default) Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -45,4 +45,3 @@ IDS_TIME_INTERVAL_MINUTES " min" IDS_TIME_INTERVAL_SECONDS " sek" } -#pragma code_page(default) Modified: trunk/reactos/dll/win32/shlwapi/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Wed Mar 3 17:21:34 2010 @@ -33,6 +33,7 @@ #include "winternl.h" #define NO_SHLWAPI_STREAM #include "shlwapi.h" +#include "intshcut.h" #include "wine/debug.h" HMODULE WINAPI MLLoadLibraryW(LPCWSTR,HMODULE,DWORD); @@ -157,8 +158,8 @@ ptr++; if (*ptr != ':' || ptr <= x+1) { - y->pszProtocol = NULL; - return 0x80041001; + y->pszProtocol = NULL; + return URL_E_INVALID_SYNTAX; } y->pszProtocol = x; @@ -191,8 +192,8 @@ ptr++; if (*ptr != ':' || ptr <= x+1) { - y->pszProtocol = NULL; - return 0x80041001; + y->pszProtocol = NULL; + return URL_E_INVALID_SYNTAX; } y->pszProtocol = x; @@ -283,6 +284,7 @@ WCHAR slash = '/'; static const WCHAR wszFile[] = {'f','i','l','e',':'}; + static const WCHAR wszRes[] = {'r','e','s',':'}; static const WCHAR wszLocalhost[] = {'l','o','c','a','l','h','o','s','t'}; TRACE("(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d\n", debugstr_w(pszUrl), pszCanonicalized, @@ -303,6 +305,11 @@ if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszFile) && !memcmp(wszFile, pszUrl, sizeof(wszFile))) slash = '\\'; + + if(nByteLen >= sizeof(wszRes) && !memcmp(wszRes, pszUrl, sizeof(wszRes))) { + dwFlags &= ~URL_FILE_USE_PATHURL; + slash = '\0'; + } /* * state = @@ -368,10 +375,12 @@ wk1 += nWkLen; wk2 += nWkLen; - while(mp < wk2) { - if(*mp == '/' || *mp == '\\') - *mp = slash; - mp++; + if(slash) { + while(mp < wk2) { + if(*mp == '/' || *mp == '\\') + *mp = slash; + mp++; + } } break; case 4: @@ -380,13 +389,20 @@ while(isalnumW(*wk1) || (*wk1 == '-') || (*wk1 == '.') || (*wk1 == ':')) *wk2++ = *wk1++; state = 5; - if (!*wk1) - *wk2++ = slash; + if (!*wk1) { + if(slash) + *wk2++ = slash; + else + *wk2++ = '/'; + } break; case 5: if (*wk1 != '/' && *wk1 != '\\') {state = 3; break;} while(*wk1 == '/' || *wk1 == '\\') { - *wk2++ = slash; + if(slash) + *wk2++ = slash; + else + *wk2++ = *wk1; wk1++; } state = 6; @@ -419,7 +435,10 @@ wk2 += nLen; wk1 += nLen; } - *wk2++ = slash; + if(slash) + *wk2++ = slash; + else + *wk2++ = *wk1; wk1++; if (*wk1 == '.') { @@ -436,7 +455,10 @@ /* case /../ -> need to backup wk2 */ TRACE("found '/../'\n"); *(wk2-1) = '\0'; /* set end of string */ - mp = strrchrW(root, slash); + mp = strrchrW(root, '/'); + mp2 = strrchrW(root, '\\'); + if(mp2 && (!mp || mp2 < mp)) + mp = mp2; if (mp && (mp >= root)) { /* found valid backup point */ wk2 = mp + 1; @@ -1379,8 +1401,7 @@ { INT srcCount = nSrcLen - 1, destCount = nDestLen - 1; - if (IsBadReadPtr(lpSrc, nSrcLen) || - IsBadWritePtr(lpDest, nDestLen)) + if (!lpSrc || !lpDest) return E_INVALIDARG; while (destCount >= 0) @@ -1856,7 +1877,8 @@ (*start == '_') || (*start == '+') || (*start == '-') || - (*start == '.')) { + (*start == '.') || + (*start == ' ')) { start++; (*size)++; } else if (*start == '%') { @@ -1886,7 +1908,8 @@ while (cont) { if (isalnumW(*start) || (*start == '-') || - (*start == '.') ) { + (*start == '.') || + (*start == ' ') ) { start++; (*size)++; } @@ -1915,7 +1938,7 @@ work = URL_ScanID(pl->pScheme, &pl->szScheme, SCHEME); if (!*work || (*work != ':')) goto ErrorExit; work++; - if ((*work != '/') || (*(work+1) != '/')) goto ErrorExit; + if ((*work != '/') || (*(work+1) != '/')) goto SuccessExit; pl->pUserName = work + 2; work = URL_ScanID(pl->pUserName, &pl->szUserName, USERPASS); if (*work == ':' ) { @@ -1956,6 +1979,7 @@ pl->pQuery = strchrW(work, '?'); if (pl->pQuery) pl->szQuery = strlenW(pl->pQuery); } + SuccessExit: TRACE("parse successful: scheme=%p(%d), user=%p(%d), pass=%p(%d), host=%p(%d), port=%p(%d), query=%p(%d)\n", pl->pScheme, pl->szScheme, pl->pUserName, pl->szUserName, @@ -2002,7 +2026,7 @@ len = INTERNET_MAX_URL_LENGTH; ret = UrlGetPartW(in, out, &len, dwPart, dwFlags); - if (ret != S_OK) { + if (FAILED(ret)) { HeapFree(GetProcessHeap(), 0, in); return ret; } @@ -2013,10 +2037,10 @@ HeapFree(GetProcessHeap(), 0, in); return E_POINTER; } - WideCharToMultiByte(0, 0, out, len+1, pszOut, *pcchOut, 0, 0); - *pcchOut = len2; + len2 = WideCharToMultiByte(0, 0, out, len+1, pszOut, *pcchOut, 0, 0); + *pcchOut = len2-1; HeapFree(GetProcessHeap(), 0, in); - return S_OK; + return ret; } /************************************************************************* @@ -2029,11 +2053,17 @@ { WINE_PARSE_URL pl; HRESULT ret; - DWORD size, schsize; + DWORD scheme, size, schsize; LPCWSTR addr, schaddr; TRACE("(%s %p %p(%d) %08x %08x)\n", debugstr_w(pszIn), pszOut, pcchOut, *pcchOut, dwPart, dwFlags); + + addr = strchrW(pszIn, ':'); + if(!addr) + return E_FAIL; + + scheme = get_scheme_code(pszIn, addr-pszIn); ret = URL_ParseUrl(pszIn, &pl); if (ret == S_OK) { @@ -2048,6 +2078,26 @@ break; case URL_PART_HOSTNAME: + switch(scheme) { + case URL_SCHEME_FTP: + case URL_SCHEME_HTTP: + case URL_SCHEME_GOPHER: + case URL_SCHEME_TELNET: + case URL_SCHEME_FILE: + case URL_SCHEME_HTTPS: + break; + default: + return E_FAIL; + } + + if(scheme==URL_SCHEME_FILE && (!pl.szHostName || + (pl.szHostName==1 && *(pl.pHostName+1)==':'))) { + if(pcchOut) + *pszOut = '\0'; + *pcchOut = 0; + return S_FALSE; + } + if (!pl.szHostName) return E_INVALIDARG; addr = pl.pHostName; size = pl.szHostName; @@ -2099,7 +2149,13 @@ *pcchOut = size; } TRACE("len=%d %s\n", *pcchOut, debugstr_w(pszOut)); - } + }else if(dwPart==URL_PART_HOSTNAME && scheme==URL_SCHEME_FILE) { + if(*pcchOut) + *pszOut = '\0'; + *pcchOut = 0; + return S_FALSE; + } + return ret; } @@ -2259,7 +2315,7 @@ */ HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags) { - FIXME("SHAutoComplete stub\n"); + FIXME("stub\n"); return S_FALSE; } @@ -2350,7 +2406,7 @@ dwResLen = strlenW(lpszRes) + 1; if (dwDestLen >= dwResLen + 1) { - lpszDest[szResLen + dwPathLen + dwResLen] = '/'; + lpszDest[szResLen + dwPathLen-1] = '/'; memcpy(lpszDest + szResLen + dwPathLen, lpszRes, dwResLen * sizeof(WCHAR)); hRet = S_OK; } @@ -2386,7 +2442,7 @@ if (!url) return E_FAIL; - srcLen = lstrlenW(url); + srcLen = lstrlenW(url) + 1; /* For now just copy the URL directly */ lstrcpynW(translatedUrl, url, (maxChars < srcLen) ? maxChars : srcLen);
14 years, 9 months
1
0
0
0
[cwittich] 45790: [HLINK] sync hlink to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Mar 3 17:14:25 2010 New Revision: 45790 URL:
http://svn.reactos.org/svn/reactos?rev=45790&view=rev
Log: [HLINK] sync hlink to wine 1.1.39 Modified: trunk/reactos/dll/win32/hlink/browse_ctx.c trunk/reactos/dll/win32/hlink/hlink_main.c trunk/reactos/dll/win32/hlink/link.c Modified: trunk/reactos/dll/win32/hlink/browse_ctx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hlink/browse_ctx…
============================================================================== --- trunk/reactos/dll/win32/hlink/browse_ctx.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hlink/browse_ctx.c [iso-8859-1] Wed Mar 3 17:14:25 2010 @@ -223,8 +223,19 @@ static HRESULT WINAPI IHlinkBC_GetHlink( IHlinkBrowseContext* iface, ULONG uHLID, IHlink** ppihl) { - FIXME("\n"); - return E_NOTIMPL; + HlinkBCImpl *This = (HlinkBCImpl*)iface; + + TRACE("(%p)->(%x %p)\n", This, uHLID, ppihl); + + if(uHLID != HLID_CURRENT) { + FIXME("Only HLID_CURRENT implemented, given: %x\n", uHLID); + return E_NOTIMPL; + } + + *ppihl = This->CurrentPage; + IHlink_AddRef(*ppihl); + + return S_OK; } static HRESULT WINAPI IHlinkBC_SetCurrentHlink( IHlinkBrowseContext* iface, Modified: trunk/reactos/dll/win32/hlink/hlink_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hlink/hlink_main…
============================================================================== --- trunk/reactos/dll/win32/hlink/hlink_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hlink/hlink_main.c [iso-8859-1] Wed Mar 3 17:14:25 2010 @@ -55,7 +55,6 @@ */ HRESULT WINAPI DllCanUnloadNow( void ) { - FIXME("\n"); return S_OK; } @@ -77,14 +76,12 @@ if (FAILED(r)) return r; - if (pwzLocation) - IHlink_SetStringReference(hl, HLINKSETF_LOCATION, NULL, pwzLocation); + IHlink_SetMonikerReference(hl, HLINKSETF_LOCATION | HLINKSETF_TARGET, pimkTrgt, pwzLocation); + if (pwzFriendlyName) IHlink_SetFriendlyName(hl, pwzFriendlyName); if (pihlsite) IHlink_SetHlinkSite(hl, pihlsite, dwSiteData); - if (pimkTrgt) - IHlink_SetMonikerReference(hl, 0, pimkTrgt, pwzLocation); *ppvObj = hl; @@ -111,43 +108,12 @@ if (FAILED(r)) return r; - if (pwzLocation) - IHlink_SetStringReference(hl, HLINKSETF_LOCATION, NULL, pwzLocation); - - if (pwzTarget) - { - IMoniker *pTgtMk = NULL; - IBindCtx *pbc = NULL; - ULONG eaten; - - CreateBindCtx(0, &pbc); - r = MkParseDisplayName(pbc, pwzTarget, &eaten, &pTgtMk); - IBindCtx_Release(pbc); - - if (FAILED(r)) - { - LPCWSTR p = strchrW(pwzTarget, ':'); - if (p && (p - pwzTarget > 1)) - r = CreateURLMoniker(NULL, pwzTarget, &pTgtMk); - else - r = CreateFileMoniker(pwzTarget,&pTgtMk); - } - - if (FAILED(r)) - { - ERR("couldn't create moniker for %s, failed with error 0x%08x\n", - debugstr_w(pwzTarget), r); - return r; - } - - IHlink_SetMonikerReference(hl, 0, pTgtMk, pwzLocation); - IMoniker_Release(pTgtMk); - - IHlink_SetStringReference(hl, HLINKSETF_TARGET, pwzTarget, NULL); - } + IHlink_SetStringReference(hl, HLINKSETF_TARGET | HLINKSETF_LOCATION, + pwzTarget, pwzLocation); if (pwzFriendlyName) IHlink_SetFriendlyName(hl, pwzFriendlyName); + if (pihlsite) IHlink_SetHlinkSite(hl, pihlsite, dwSiteData); @@ -159,7 +125,7 @@ /*********************************************************************** - * HlinkNavigate (HLINK.@) + * HlinkCreateBrowseContext (HLINK.@) */ HRESULT WINAPI HlinkCreateBrowseContext( IUnknown* piunkOuter, REFIID riid, void** ppvObj) { Modified: trunk/reactos/dll/win32/hlink/link.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hlink/link.c?rev…
============================================================================== --- trunk/reactos/dll/win32/hlink/link.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hlink/link.c [iso-8859-1] Wed Mar 3 17:14:25 2010 @@ -51,7 +51,6 @@ LPWSTR FriendlyName; LPWSTR Location; - LPWSTR Target; LPWSTR TargetFrameName; IMoniker *Moniker; IHlinkSite *Site; @@ -155,7 +154,6 @@ TRACE("-- destroying IHlink (%p)\n", This); heap_free(This->FriendlyName); - heap_free(This->Target); heap_free(This->TargetFrameName); heap_free(This->Location); if (This->Moniker) @@ -206,24 +204,33 @@ { HlinkImpl *This = (HlinkImpl*)iface; - FIXME("(%p)->(%i %p %s)\n", This, rfHLSETF, pmkTarget, + TRACE("(%p)->(%i %p %s)\n", This, rfHLSETF, pmkTarget, debugstr_w(pwzLocation)); - if (This->Moniker) - IMoniker_Release(This->Moniker); - - This->Moniker = pmkTarget; - if (This->Moniker) - { - LPOLESTR display_name; - IMoniker_AddRef(This->Moniker); - IMoniker_GetDisplayName(This->Moniker, NULL, NULL, &display_name); - This->absolute = display_name && strchrW(display_name, ':'); - CoTaskMemFree(display_name); - } - - heap_free(This->Location); - This->Location = hlink_strdupW( pwzLocation ); + if(rfHLSETF == 0) + return E_INVALIDARG; + if(!(rfHLSETF & (HLINKSETF_TARGET | HLINKSETF_LOCATION))) + return rfHLSETF; + + if(rfHLSETF & HLINKSETF_TARGET){ + if (This->Moniker) + IMoniker_Release(This->Moniker); + + This->Moniker = pmkTarget; + if (This->Moniker) + { + LPOLESTR display_name; + IMoniker_AddRef(This->Moniker); + IMoniker_GetDisplayName(This->Moniker, NULL, NULL, &display_name); + This->absolute = display_name && strchrW(display_name, ':'); + CoTaskMemFree(display_name); + } + } + + if(rfHLSETF & HLINKSETF_LOCATION){ + heap_free(This->Location); + This->Location = hlink_strdupW( pwzLocation ); + } return S_OK; } @@ -236,11 +243,51 @@ TRACE("(%p)->(%i %s %s)\n", This, grfHLSETF, debugstr_w(pwzTarget), debugstr_w(pwzLocation)); + if(grfHLSETF > (HLINKSETF_TARGET | HLINKSETF_LOCATION) && + grfHLSETF < -(HLINKSETF_TARGET | HLINKSETF_LOCATION)) + return grfHLSETF; + if (grfHLSETF & HLINKSETF_TARGET) { - heap_free(This->Target); - This->Target = hlink_strdupW( pwzTarget ); - } + if (This->Moniker) + { + IMoniker_Release(This->Moniker); + This->Moniker = NULL; + } + if (pwzTarget && *pwzTarget) + { + IMoniker *pMon; + IBindCtx *pbc = NULL; + ULONG eaten; + HRESULT r; + + r = CreateBindCtx(0, &pbc); + if (FAILED(r)) + return E_OUTOFMEMORY; + + r = MkParseDisplayName(pbc, pwzTarget, &eaten, &pMon); + IBindCtx_Release(pbc); + + if (FAILED(r)) + { + LPCWSTR p = strchrW(pwzTarget, ':'); + if (p && (p - pwzTarget > 1)) + r = CreateURLMoniker(NULL, pwzTarget, &pMon); + else + r = CreateFileMoniker(pwzTarget, &pMon); + if (FAILED(r)) + { + ERR("couldn't create moniker for %s, failed with error 0x%08x\n", + debugstr_w(pwzTarget), r); + return r; + } + } + + IHlink_SetMonikerReference(iface, HLINKSETF_TARGET, pMon, NULL); + IMoniker_Release(pMon); + } + } + if (grfHLSETF & HLINKSETF_LOCATION) { heap_free(This->Location); @@ -272,28 +319,36 @@ { HlinkImpl *This = (HlinkImpl*)iface; - FIXME("(%p) -> (%i %p %p)\n", This, dwWhichRef, ppwzTarget, ppwzLocation); + TRACE("(%p) -> (%i %p %p)\n", This, dwWhichRef, ppwzTarget, ppwzLocation); + + /* note: undocumented behavior with dwWhichRef == -1 */ + if(dwWhichRef != -1 && dwWhichRef & ~(HLINKGETREF_DEFAULT | HLINKGETREF_ABSOLUTE | HLINKGETREF_RELATIVE)) + { + if(ppwzTarget) + *ppwzTarget = NULL; + if(ppwzLocation) + *ppwzLocation = NULL; + return E_INVALIDARG; + } + + if(dwWhichRef != HLINKGETREF_DEFAULT) + FIXME("unhandled flags: 0x%x\n", dwWhichRef); if (ppwzTarget) { - *ppwzTarget = hlink_co_strdupW( This->Target ); - - if (!This->Target) + IMoniker* mon; + __GetMoniker(This, &mon); + if (mon) { - IMoniker* mon; - __GetMoniker(This, &mon); - if (mon) - { - IBindCtx *pbc; - - CreateBindCtx( 0, &pbc); - IMoniker_GetDisplayName(mon, pbc, NULL, ppwzTarget); - IBindCtx_Release(pbc); - IMoniker_Release(mon); - } - else - FIXME("Unhandled case, no set Target and no moniker\n"); + IBindCtx *pbc; + + CreateBindCtx( 0, &pbc); + IMoniker_GetDisplayName(mon, pbc, NULL, ppwzTarget); + IBindCtx_Release(pbc); + IMoniker_Release(mon); } + else + *ppwzTarget = NULL; } if (ppwzLocation) *ppwzLocation = hlink_co_strdupW( This->Location );
14 years, 9 months
1
0
0
0
[akhaldi] 45789: - Move ntdef.h from ddk to psdk - Move EVENT_TYPE to ntdef.h - Introduce pragma once to wdm.h - Fix FAST_MUTEX - FastMutex->Gate => FastMutex->Event - Improve KeInitializeEvent - Improve InitializeSListHead
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 17:03:14 2010 New Revision: 45789 URL:
http://svn.reactos.org/svn/reactos?rev=45789&view=rev
Log: - Move ntdef.h from ddk to psdk - Move EVENT_TYPE to ntdef.h - Introduce pragma once to wdm.h - Fix FAST_MUTEX - FastMutex->Gate => FastMutex->Event - Improve KeInitializeEvent - Improve InitializeSListHead Added: branches/header-work/include/psdk/ntdef.h - copied, changed from r45734, branches/header-work/include/ddk/ntdef.h Removed: branches/header-work/include/ddk/ntdef.h Modified: branches/header-work/hal/halppc/generic/fmutex.c branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h branches/header-work/include/psdk/winbase.h branches/header-work/ntoskrnl/include/internal/ex.h branches/header-work/ntoskrnl/ke/eventobj.c branches/header-work/ntoskrnl/ke/wait.c Modified: branches/header-work/hal/halppc/generic/fmutex.c URL:
http://svn.reactos.org/svn/reactos/branches/header-work/hal/halppc/generic/…
============================================================================== --- branches/header-work/hal/halppc/generic/fmutex.c [iso-8859-1] (original) +++ branches/header-work/hal/halppc/generic/fmutex.c [iso-8859-1] Wed Mar 3 17:03:14 2010 @@ -39,7 +39,7 @@ { /* Someone is still holding it, use slow path */ FastMutex->Contention++; - KeWaitForSingleObject(&FastMutex->Gate, + KeWaitForSingleObject(&FastMutex->Event, WrExecutive, KernelMode, FALSE, @@ -65,7 +65,7 @@ if (InterlockedIncrement(&FastMutex->Count) <= 0) { /* Someone was waiting for it, signal the waiter */ - KeSetEventBoostPriority(&FastMutex->Gate, IO_NO_INCREMENT); + KeSetEventBoostPriority(&FastMutex->Event, IO_NO_INCREMENT); } /* Lower IRQL back */ Removed: branches/header-work/include/ddk/ntdef.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntdef.h…
============================================================================== --- branches/header-work/include/ddk/ntdef.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntdef.h (removed) @@ -1,844 +1,0 @@ -#ifndef _NTDEF_H -#define _NTDEF_H - -// -// Dependencies -// -#include <ctype.h> -#include <basetsd.h> -#include <excpt.h> -#include <sdkddkver.h> - -// FIXME: Should we include these here? -#include <stdarg.h> -#include <string.h> - -/* Helper macro to enable gcc's extension. */ -#ifndef __GNU_EXTENSION -#ifdef __GNUC__ -#define __GNU_EXTENSION __extension__ -#else -#define __GNU_EXTENSION -#endif -#endif - -typedef unsigned long POINTER_64; // FIXME! HACK!!! - - - -// -// Pseudo Modifiers for Input Parameters -// -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef OPTIONAL -#define OPTIONAL -#endif - -#ifndef NOTHING -#define NOTHING -#endif - -#ifndef CRITICAL -#define CRITICAL -#endif - -#ifndef FAR -#define FAR -#endif - - -// -// Defines the "size" of an any-size array -// -#ifndef ANYSIZE_ARRAY -#define ANYSIZE_ARRAY 1 -#endif - -// -// Constant modifier -// -#ifndef CONST -#define CONST const -#endif - -// -// TRUE/FALSE -// -#define FALSE 0 -#define TRUE 1 - -// -// NULL/NULL64 -// -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#define NULL64 0 -#else -#define NULL ((void *)0) -#define NULL64 ((void * POINTER_64)0) -#endif -#endif // NULL - - -// -// FIXME -// We should use the -fms-extensions compiler flag for gcc, -// and clean up the mess. -// -#ifndef __ANONYMOUS_DEFINED -#define __ANONYMOUS_DEFINED - -#ifndef NONAMELESSUNION -#ifdef __GNUC__ -#define _ANONYMOUS_UNION __GNU_EXTENSION -#define _ANONYMOUS_STRUCT __GNU_EXTENSION -#elif defined(__WATCOMC__) || defined(_MSC_VER) -#define _ANONYMOUS_UNION -#define _ANONYMOUS_STRUCT -#endif /* __GNUC__/__WATCOMC__ */ -#endif /* NONAMELESSUNION */ - -#ifndef _ANONYMOUS_UNION -#define _ANONYMOUS_UNION -#define _UNION_NAME(x) x -#define DUMMYUNIONNAME u -#define DUMMYUNIONNAME2 u2 -#define DUMMYUNIONNAME3 u3 -#define DUMMYUNIONNAME4 u4 -#define DUMMYUNIONNAME5 u5 -#define DUMMYUNIONNAME6 u6 -#define DUMMYUNIONNAME7 u7 -#define DUMMYUNIONNAME8 u8 -#else -#define _UNION_NAME(x) -#define DUMMYUNIONNAME -#define DUMMYUNIONNAME2 -#define DUMMYUNIONNAME3 -#define DUMMYUNIONNAME4 -#define DUMMYUNIONNAME5 -#define DUMMYUNIONNAME6 -#define DUMMYUNIONNAME7 -#define DUMMYUNIONNAME8 -#endif - -#ifndef _ANONYMOUS_STRUCT -#define _ANONYMOUS_STRUCT -#define _STRUCT_NAME(x) x -#define DUMMYSTRUCTNAME s -#define DUMMYSTRUCTNAME2 s2 -#define DUMMYSTRUCTNAME3 s3 -#define DUMMYSTRUCTNAME4 s4 -#define DUMMYSTRUCTNAME5 s5 -#else -#define _STRUCT_NAME(x) -#define DUMMYSTRUCTNAME -#define DUMMYSTRUCTNAME2 -#define DUMMYSTRUCTNAME3 -#define DUMMYSTRUCTNAME4 -#define DUMMYSTRUCTNAME5 -#endif - -#endif /* __ANONYMOUS_DEFINED */ - -// FIXME -#undef UNALIGNED -#define UNALIGNED -#define RESTRICTED_POINTER - -// -// Returns the base address of a structure from a structure member -// -#ifndef CONTAINING_RECORD -#define CONTAINING_RECORD(address, type, field) \ - ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) -#endif - -// -// Returns the byte offset of the specified structure's member -// -#ifndef __GNUC__ -#define FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field)) -#else -#define FIELD_OFFSET(Type, Field) __builtin_offsetof(Type, Field) -#endif - -// -// Returns the type's alignment -// -#if defined(_MSC_VER) && (_MSC_VER >= 1300) -#define TYPE_ALIGNMENT(t) __alignof(t) -#else -#define TYPE_ALIGNMENT(t) FIELD_OFFSET( struct { char x; t test; }, test ) -#endif - -// -// Calling Conventions -// -#if defined(_M_IX86) -#define FASTCALL __fastcall -#else -#define FASTCALL -#endif - -#define NTAPI __stdcall - -// -// Used by the DDK exclusively , don't put in drivers -// -#define DDKAPI __stdcall // Use NTAPI instead -#define DDKCDECLAPI __cdecl // Just use __cdecl - -// -// Import and Export Specifiers -// - -// Done the same way as in windef.h for now -#define DECLSPEC_IMPORT __declspec(dllimport) -#define DECLSPEC_NORETURN __declspec(noreturn) - - -#ifndef DECLSPEC_ADDRSAFE -#if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) -#define DECLSPEC_ADDRSAFE __declspec(address_safe) -#else -#define DECLSPEC_ADDRSAFE -#endif -#endif - -#if !defined(_NTSYSTEM_) -#define NTSYSAPI DECLSPEC_IMPORT -#define NTSYSCALLAPI DECLSPEC_IMPORT -#else -#define NTSYSAPI -#if defined(_NTDLLBUILD_) -#define NTSYSCALLAPI -#else -#define NTSYSCALLAPI DECLSPEC_ADDRSAFE -#endif -#endif - -// -// Inlines -// -#ifndef FORCEINLINE -#if (_MSC_VER >= 1200) -#define FORCEINLINE __forceinline -#elif (_MSC_VER) -#define FORCEINLINE __inline -#else -#define FORCEINLINE static __inline__ __attribute__((always_inline)) -#endif -#endif - -#ifndef DECLSPEC_NOINLINE -#if (_MSC_VER >= 1300) -#define DECLSPEC_NOINLINE __declspec(noinline) -#elif defined(__GNUC__) -#define DECLSPEC_NOINLINE __attribute__((noinline)) -#else -#define DECLSPEC_NOINLINE -#endif -#endif - -#if !defined(_M_CEE_PURE) -#define NTAPI_INLINE NTAPI -#else -#define NTAPI_INLINE -#endif - -// -// Use to specify structure alignment -// -#ifndef DECLSPEC_ALIGN -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) -#define DECLSPEC_ALIGN(x) __declspec(align(x)) -#elif defined(__GNUC__) -#define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) -#else -#define DECLSPEC_ALIGN(x) -#endif -#endif - - - -// -// Use to silence unused variable warnings when it is intentional -// -#define UNREFERENCED_PARAMETER(P) {(P)=(P);} -#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);} -#define DBG_UNREFERENCED_PARAMETER(P) -#define DBG_UNREFERENCED_LOCAL_VARIABLE(L) - - - -// -// min/max helper macros -// -#ifndef NOMINMAX - -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif - -#endif // NOMINMAX - - - -// -// Tell windef.h that we have defined some basic types -// -#define BASETYPES - -// -// Void Pointers -// -typedef void *PVOID; -//typedef void * POINTER_64 PVOID64; -typedef PVOID PVOID64; // FIXME! - -// -// Handle Type -// -#ifdef STRICT -typedef void *HANDLE; -#define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n -#else -typedef PVOID HANDLE; -#define DECLARE_HANDLE(n) typedef HANDLE n -#endif -typedef HANDLE *PHANDLE; - -// -// Upper-Case Versions of Some Standard C Types -// -#ifndef VOID -#define VOID void -typedef char CHAR; -typedef short SHORT; -typedef long LONG; -#if !defined(MIDL_PASS) -typedef int INT; -#endif -#endif -typedef double DOUBLE; - -// -// Used to store a non-float 8 byte aligned structure -// -typedef struct _QUAD -{ - _ANONYMOUS_UNION union - { - __GNU_EXTENSION __int64 UseThisFieldToCopy; - double DoNotUseThisField; - }; -} QUAD, *PQUAD, UQUAD, *PUQUAD; - - -// -// Unsigned Types -// -typedef unsigned char UCHAR, *PUCHAR; -typedef unsigned short USHORT, *PUSHORT; -typedef unsigned long ULONG, *PULONG; -typedef CONST UCHAR *PCUCHAR; -typedef CONST USHORT *PCUSHORT; -typedef CONST ULONG *PCULONG; - -typedef UCHAR FCHAR; -typedef USHORT FSHORT; -typedef ULONG FLONG; -typedef UCHAR BOOLEAN; -typedef BOOLEAN *PBOOLEAN; - -// -// Signed Types -// -typedef SHORT *PSHORT; -typedef LONG *PLONG; - -typedef LONG NTSTATUS; -typedef NTSTATUS *PNTSTATUS; - -typedef signed char SCHAR; -typedef SCHAR *PSCHAR; - -#ifndef _HRESULT_DEFINED -#define _HRESULT_DEFINED -typedef LONG HRESULT; -#endif - -// -// 64-bit types -// -__GNU_EXTENSION typedef __int64 LONGLONG, *PLONGLONG; -__GNU_EXTENSION typedef unsigned __int64 ULONGLONG, *PULONGLONG; -typedef ULONGLONG DWORDLONG, *PDWORDLONG; - -// -// Update Sequence Number -// -typedef LONGLONG USN; - - -// -// ANSI (Multi-byte Character) types -// -typedef CHAR *PCHAR, *LPCH, *PCH; -typedef CONST CHAR *LPCCH, *PCCH; -typedef CHAR *NPSTR, *LPSTR, *PSTR; -typedef PSTR *PZPSTR; -typedef CONST PSTR *PCZPSTR; -typedef CONST CHAR *LPCSTR, *PCSTR; -typedef PCSTR *PZPCSTR; - -// -// Pointer to an Asciiz string -// -typedef CHAR *PSZ; -typedef CONST char *PCSZ; - -// -// UNICODE (Wide Character) types -// -typedef wchar_t WCHAR; -typedef WCHAR *PWCHAR, *LPWCH, *PWCH; -typedef CONST WCHAR *LPCWCH, *PCWCH; -typedef WCHAR *NWPSTR, *LPWSTR, *PWSTR; -typedef PWSTR *PZPWSTR; -typedef CONST PWSTR *PCZPWSTR; -typedef WCHAR UNALIGNED *LPUWSTR, *PUWSTR; -typedef CONST WCHAR *LPCWSTR, *PCWSTR; -typedef PCWSTR *PZPCWSTR; -typedef CONST WCHAR UNALIGNED *LPCUWSTR, *PCUWSTR; - -// -// Cardinal Data Types -// -typedef char CCHAR, *PCCHAR; -typedef short CSHORT, *PCSHORT; -typedef ULONG CLONG, *PCLONG; - -// -// NLS basics (Locale and Language Ids) -// -typedef ULONG LCID; -typedef PULONG PLCID; -typedef USHORT LANGID; - - - -// -// Large Integer Unions -// -#if defined(MIDL_PASS) -typedef struct _LARGE_INTEGER { -#else -typedef union _LARGE_INTEGER { - _ANONYMOUS_STRUCT struct - { - ULONG LowPart; - LONG HighPart; - } DUMMYSTRUCTNAME; - struct - { - ULONG LowPart; - LONG HighPart; - } u; -#endif //MIDL_PASS - LONGLONG QuadPart; -} LARGE_INTEGER, *PLARGE_INTEGER; - -#if defined(MIDL_PASS) -typedef struct _ULARGE_INTEGER { -#else -typedef union _ULARGE_INTEGER { - _ANONYMOUS_STRUCT struct - { - ULONG LowPart; - ULONG HighPart; - } DUMMYSTRUCTNAME; - struct - { - ULONG LowPart; - ULONG HighPart; - } u; -#endif //MIDL_PASS - ULONGLONG QuadPart; -} ULARGE_INTEGER, *PULARGE_INTEGER; - -// -// Physical Addresses are always treated as 64-bit wide -// -typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS; - - - -// -// Locally Unique Identifier -// -typedef struct _LUID { - ULONG LowPart; - LONG HighPart; -} LUID, *PLUID; - - - -// -// Native API Return Value Macros -// -#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) -#define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1) -#define NT_WARNING(Status) ((((ULONG)(Status)) >> 30) == 2) -#define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3) - - - -// -// String Types -// -typedef struct _UNICODE_STRING { - USHORT Length; - USHORT MaximumLength; - PWSTR Buffer; -} UNICODE_STRING, *PUNICODE_STRING; -typedef const UNICODE_STRING* PCUNICODE_STRING; -#define UNICODE_NULL ((WCHAR)0) - -typedef struct _CSTRING { - USHORT Length; - USHORT MaximumLength; - CONST CHAR *Buffer; -} CSTRING, *PCSTRING; -#define ANSI_NULL ((CHAR)0) - -typedef struct _STRING { - USHORT Length; - USHORT MaximumLength; - PCHAR Buffer; -} STRING, *PSTRING; - -typedef STRING ANSI_STRING; -typedef PSTRING PANSI_STRING; -typedef STRING OEM_STRING; -typedef PSTRING POEM_STRING; -typedef CONST STRING* PCOEM_STRING; -typedef STRING CANSI_STRING; -typedef PSTRING PCANSI_STRING; - -typedef struct _STRING32 { - USHORT Length; - USHORT MaximumLength; - ULONG Buffer; -} STRING32, *PSTRING32, - UNICODE_STRING32, *PUNICODE_STRING32, - ANSI_STRING32, *PANSI_STRING32; - -typedef struct _STRING64 { - USHORT Length; - USHORT MaximumLength; - ULONGLONG Buffer; -} STRING64, *PSTRING64, - UNICODE_STRING64, *PUNICODE_STRING64, - ANSI_STRING64, *PANSI_STRING64; - -// -// LangID and NLS -// -#define MAKELANGID(p, s) ((((USHORT)(s)) << 10) | (USHORT)(p)) -#define PRIMARYLANGID(lgid) ((USHORT)(lgid) & 0x3ff) -#define SUBLANGID(lgid) ((USHORT)(lgid) >> 10) - -#define NLS_VALID_LOCALE_MASK 0x000fffff - -#define MAKELCID(lgid, srtid) ((ULONG)((((ULONG)((USHORT)(srtid))) << 16) | \ - ((ULONG)((USHORT)(lgid))))) -#define MAKESORTLCID(lgid, srtid, ver) \ - ((ULONG)((MAKELCID(lgid, srtid)) | \ - (((ULONG)((USHORT)(ver))) << 20))) -#define LANGIDFROMLCID(lcid) ((USHORT)(lcid)) -#define SORTIDFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 16) & 0xf)) -#define SORTVERSIONFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 20) & 0xf)) - - - -// -// Object Attributes -// -typedef struct _OBJECT_ATTRIBUTES { - ULONG Length; - HANDLE RootDirectory; - PUNICODE_STRING ObjectName; - ULONG Attributes; - PVOID SecurityDescriptor; - PVOID SecurityQualityOfService; -} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; -typedef CONST OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES; - -// -// Values for the Attributes member -// -#define OBJ_INHERIT 0x00000002 -#define OBJ_PERMANENT 0x00000010 -#define OBJ_EXCLUSIVE 0x00000020 -#define OBJ_CASE_INSENSITIVE 0x00000040 -#define OBJ_OPENIF 0x00000080 -#define OBJ_OPENLINK 0x00000100 -#define OBJ_KERNEL_HANDLE 0x00000200 -#define OBJ_FORCE_ACCESS_CHECK 0x00000400 -#define OBJ_VALID_ATTRIBUTES 0x000007F2 - -// -// Helper Macro -// -#define InitializeObjectAttributes(p,n,a,r,s) { \ - (p)->Length = sizeof(OBJECT_ATTRIBUTES); \ - (p)->RootDirectory = (r); \ - (p)->Attributes = (a); \ - (p)->ObjectName = (n); \ - (p)->SecurityDescriptor = (s); \ - (p)->SecurityQualityOfService = NULL; \ -} - - - -// -// Product Types -// -typedef enum _NT_PRODUCT_TYPE { - NtProductWinNt = 1, - NtProductLanManNt, - NtProductServer -} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE; - - - -// -// Doubly Linked Lists -// -typedef struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink; - struct _LIST_ENTRY *Blink; -} LIST_ENTRY, *PLIST_ENTRY, *RESTRICTED_POINTER PRLIST_ENTRY; - -typedef struct LIST_ENTRY32 -{ - ULONG Flink; - ULONG Blink; -} LIST_ENTRY32, *PLIST_ENTRY32; - -typedef struct LIST_ENTRY64 -{ - ULONGLONG Flink; - ULONGLONG Blink; -} LIST_ENTRY64, *PLIST_ENTRY64; - -// -// Singly Linked Lists -// -typedef struct _SINGLE_LIST_ENTRY { - struct _SINGLE_LIST_ENTRY *Next; -} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; - - - -// -// Helper Macros -// -#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s } - -#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) - -#define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0])) -#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A) -#ifdef ENABLE_RTL_NUMBER_OF_V2 -#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A) -#else -#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A) -#endif -#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) - - - -// -// Type Limits -// -#define MINCHAR 0x80 -#define MAXCHAR 0x7f -#define MINSHORT 0x8000 -#define MAXSHORT 0x7fff -#define MINLONG 0x80000000 -#define MAXLONG 0x7fffffff -#define MAXUCHAR 0xff -#define MAXUSHORT 0xffff -#define MAXULONG 0xffffffff -#define MAXLONGLONG (0x7fffffffffffffffLL) - - - -// -// Multiplication and Shift Operations -// -#define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b)) -#define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b)) -#define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b)) -#define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b)) -#define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b)) - - - -// -// C_ASSERT Definition -// -#define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1] - - - -// -// Primary language IDs. -// -#define LANG_NEUTRAL 0x00 -#define LANG_INVARIANT 0x7f - -#define LANG_AFRIKAANS 0x36 -#define LANG_ALBANIAN 0x1c -#define LANG_ALSATIAN 0x84 -#define LANG_AMHARIC 0x5e -#define LANG_ARABIC 0x01 -#define LANG_ARMENIAN 0x2b -#define LANG_ASSAMESE 0x4d -#define LANG_AZERI 0x2c -#define LANG_BASHKIR 0x6d -#define LANG_BASQUE 0x2d -#define LANG_BELARUSIAN 0x23 -#define LANG_BENGALI 0x45 -#define LANG_BRETON 0x7e -#define LANG_BOSNIAN 0x1a -#define LANG_BOSNIAN_NEUTRAL 0x781a -#define LANG_BULGARIAN 0x02 -#define LANG_CATALAN 0x03 -#define LANG_CHINESE 0x04 -#define LANG_CHINESE_SIMPLIFIED 0x04 -#define LANG_CHINESE_TRADITIONAL 0x7c04 -#define LANG_CORSICAN 0x83 -#define LANG_CROATIAN 0x1a -#define LANG_CZECH 0x05 -#define LANG_DANISH 0x06 -#define LANG_DARI 0x8c -#define LANG_DIVEHI 0x65 -#define LANG_DUTCH 0x13 -#define LANG_ENGLISH 0x09 -#define LANG_ESTONIAN 0x25 -#define LANG_FAEROESE 0x38 -#define LANG_FARSI 0x29 -#define LANG_FILIPINO 0x64 -#define LANG_FINNISH 0x0b -#define LANG_FRENCH 0x0c -#define LANG_FRISIAN 0x62 -#define LANG_GALICIAN 0x56 -#define LANG_GEORGIAN 0x37 -#define LANG_GERMAN 0x07 -#define LANG_GREEK 0x08 -#define LANG_GREENLANDIC 0x6f -#define LANG_GUJARATI 0x47 -#define LANG_HAUSA 0x68 -#define LANG_HEBREW 0x0d -#define LANG_HINDI 0x39 -#define LANG_HUNGARIAN 0x0e -#define LANG_ICELANDIC 0x0f -#define LANG_IGBO 0x70 -#define LANG_INDONESIAN 0x21 -#define LANG_INUKTITUT 0x5d -#define LANG_IRISH 0x3c -#define LANG_ITALIAN 0x10 -#define LANG_JAPANESE 0x11 -#define LANG_KANNADA 0x4b -#define LANG_KASHMIRI 0x60 -#define LANG_KAZAK 0x3f -#define LANG_KHMER 0x53 -#define LANG_KICHE 0x86 -#define LANG_KINYARWANDA 0x87 -#define LANG_KONKANI 0x57 -#define LANG_KOREAN 0x12 -#define LANG_KYRGYZ 0x40 -#define LANG_LAO 0x54 -#define LANG_LATVIAN 0x26 -#define LANG_LITHUANIAN 0x27 -#define LANG_LOWER_SORBIAN 0x2e -#define LANG_LUXEMBOURGISH 0x6e -#define LANG_MACEDONIAN 0x2f -#define LANG_MALAY 0x3e -#define LANG_MALAYALAM 0x4c -#define LANG_MALTESE 0x3a -#define LANG_MANIPURI 0x58 -#define LANG_MAORI 0x81 -#define LANG_MAPUDUNGUN 0x7a -#define LANG_MARATHI 0x4e -#define LANG_MOHAWK 0x7c -#define LANG_MONGOLIAN 0x50 -#define LANG_NEPALI 0x61 -#define LANG_NORWEGIAN 0x14 -#define LANG_OCCITAN 0x82 -#define LANG_ORIYA 0x48 -#define LANG_PASHTO 0x63 -#define LANG_PERSIAN 0x29 -#define LANG_POLISH 0x15 -#define LANG_PORTUGUESE 0x16 -#define LANG_PUNJABI 0x46 -#define LANG_QUECHUA 0x6b -#define LANG_ROMANIAN 0x18 -#define LANG_ROMANSH 0x17 -#define LANG_RUSSIAN 0x19 -#define LANG_SAMI 0x3b -#define LANG_SANSKRIT 0x4f -#define LANG_SERBIAN 0x1a -#define LANG_SERBIAN_NEUTRAL 0x7c1a -#define LANG_SINDHI 0x59 -#define LANG_SINHALESE 0x5b -#define LANG_SLOVAK 0x1b -#define LANG_SLOVENIAN 0x24 -#define LANG_SOTHO 0x6c -#define LANG_SPANISH 0x0a -#define LANG_SWAHILI 0x41 -#define LANG_SWEDISH 0x1d -#define LANG_SYRIAC 0x5a -#define LANG_TAJIK 0x28 -#define LANG_TAMAZIGHT 0x5f -#define LANG_TAMIL 0x49 -#define LANG_TATAR 0x44 -#define LANG_TELUGU 0x4a -#define LANG_THAI 0x1e -#define LANG_TIBETAN 0x51 -#define LANG_TIGRIGNA 0x73 -#define LANG_TSWANA 0x32 -#define LANG_TURKISH 0x1f -#define LANG_TURKMEN 0x42 -#define LANG_UIGHUR 0x80 -#define LANG_UKRAINIAN 0x22 -#define LANG_UPPER_SORBIAN 0x2e -#define LANG_URDU 0x20 -#define LANG_UZBEK 0x43 -#define LANG_VIETNAMESE 0x2a -#define LANG_WELSH 0x52 -#define LANG_WOLOF 0x88 -#define LANG_XHOSA 0x34 -#define LANG_YAKUT 0x85 -#define LANG_YI 0x78 -#define LANG_YORUBA 0x6a -#define LANG_ZULU 0x35 - - - -#endif /* _NTDEF_H */ Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 17:03:14 2010 @@ -1,5 +1,4 @@ -#ifndef _WDMDDK_ -#define _WDMDDK_ +#pragma once /* Helper macro to enable gcc's extension. */ #ifndef __GNU_EXTENSION @@ -1476,11 +1475,14 @@ ); #endif -#if (NTDDI_VERSION >= NTDDI_WS03SP1) +/* FIXME : #if (NTDDI_VERSION >= NTDDI_WS03SP1) */ NTKERNELAPI BOOLEAN KeAreAllApcsDisabled( VOID); +/* #endif (NTDDI_VERSION >= NTDDI_WS03SP1) */ + +#if (NTDDI_VERSION >= NTDDI_WS03SP1) /* Guarded Mutex routines */ @@ -1549,18 +1551,6 @@ OUT PRKEVENT Event, IN EVENT_TYPE Type, IN BOOLEAN State); - -FORCEINLINE -VOID -ExInitializeFastMutex( - OUT PFAST_MUTEX FastMutex) -{ - FastMutex->Count = FM_LOCK_BIT; - FastMutex->Owner = NULL; - FastMutex->Contention = 0; - KeInitializeEvent(&FastMutex->Event, SynchronizationEvent, FALSE); - return; -} #if DBG @@ -3853,13 +3843,12 @@ CHAR EaName[1]; } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION; -typedef struct _FAST_MUTEX -{ - LONG Count; - PKTHREAD Owner; - ULONG Contention; - KEVENT Gate; - ULONG OldIrql; +typedef struct _FAST_MUTEX { + volatile LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Event; + ULONG OldIrql; } FAST_MUTEX, *PFAST_MUTEX; typedef ULONG_PTR ERESOURCE_THREAD, *PERESOURCE_THREAD; @@ -7320,6 +7309,18 @@ (Item)->List.Flink = NULL; \ } +FORCEINLINE +VOID +ExInitializeFastMutex( + OUT PFAST_MUTEX FastMutex) +{ + FastMutex->Count = FM_LOCK_BIT; + FastMutex->Owner = NULL; + FastMutex->Contention = 0; + KeInitializeEvent(&FastMutex->Event, SynchronizationEvent, FALSE); + return; +} + #if (NTDDI_VERSION >= NTDDI_WIN2K) NTKERNELAPI @@ -7924,5 +7925,3 @@ #ifdef __cplusplus } #endif - -#endif // _WDMDDK_ Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 17:03:14 2010 @@ -1224,11 +1224,6 @@ struct _RTL_RANGE *Range ); -typedef enum _EVENT_TYPE { - NotificationEvent, - SynchronizationEvent -} EVENT_TYPE; - typedef struct _CONFIGURATION_INFORMATION { ULONG DiskCount; ULONG FloppyCount; Copied: branches/header-work/include/psdk/ntdef.h (from r45734, branches/header-work/include/ddk/ntdef.h) URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/ntdef.…
============================================================================== --- branches/header-work/include/ddk/ntdef.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/ntdef.h [iso-8859-1] Wed Mar 3 17:03:14 2010 @@ -87,6 +87,10 @@ #endif #endif // NULL +typedef enum _EVENT_TYPE { + NotificationEvent, + SynchronizationEvent +} EVENT_TYPE; // // FIXME Modified: branches/header-work/include/psdk/winbase.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/winbas…
============================================================================== --- branches/header-work/include/psdk/winbase.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/winbase.h [iso-8859-1] Wed Mar 3 17:03:14 2010 @@ -1807,9 +1807,7 @@ DWORD WINAPI SetCriticalSectionSpinCount(LPCRITICAL_SECTION,DWORD); BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD); BOOL WINAPI InitializeSid (PSID,PSID_IDENTIFIER_AUTHORITY,BYTE); -#if !defined(__WINDDK_H) && _WIN32_WINNT >= 0x0501 -VOID WINAPI InitializeSListHead(PSLIST_HEADER); -#endif + #if (_WIN32_WINNT >= 0x0600) VOID WINAPI InitializeSRWLock(PSRWLOCK); #endif @@ -1881,7 +1879,15 @@ #endif // !(defined (_M_AMD64) || defined (_M_IA64)) -VOID WINAPI InitializeSListHead(PSLIST_HEADER); +#if defined(_SLIST_HEADER_) && !defined(_NTOSP_) + +WINBASEAPI +VOID +WINAPI +InitializeSListHead ( + IN OUT PSLIST_HEADER ListHead); +#endif + USHORT WINAPI QueryDepthSList(PSLIST_HEADER); #ifdef _MSC_VER Modified: branches/header-work/ntoskrnl/include/internal/ex.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/include/in…
============================================================================== --- branches/header-work/ntoskrnl/include/internal/ex.h [iso-8859-1] (original) +++ branches/header-work/ntoskrnl/include/internal/ex.h [iso-8859-1] Wed Mar 3 17:03:14 2010 @@ -1251,7 +1251,7 @@ if (InterlockedIncrement(&FastMutex->Count) <= 0) { /* Someone was waiting for it, signal the waiter */ - KeSetEventBoostPriority(&FastMutex->Gate, NULL); + KeSetEventBoostPriority(&FastMutex->Event, NULL); } } @@ -1292,7 +1292,7 @@ if (InterlockedIncrement(&FastMutex->Count) <= 0) { /* Someone was waiting for it, signal the waiter */ - KeSetEventBoostPriority(&FastMutex->Gate, NULL); + KeSetEventBoostPriority(&FastMutex->Event, NULL); } /* Lower IRQL back */ Modified: branches/header-work/ntoskrnl/ke/eventobj.c URL:
http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/ke/eventob…
============================================================================== --- branches/header-work/ntoskrnl/ke/eventobj.c [iso-8859-1] (original) +++ branches/header-work/ntoskrnl/ke/eventobj.c [iso-8859-1] Wed Mar 3 17:03:14 2010 @@ -32,7 +32,7 @@ */ VOID NTAPI -KeInitializeEvent(IN PKEVENT Event, +KeInitializeEvent(OUT PKEVENT Event, IN EVENT_TYPE Type, IN BOOLEAN State) { Modified: branches/header-work/ntoskrnl/ke/wait.c URL:
http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/ke/wait.c?…
============================================================================== --- branches/header-work/ntoskrnl/ke/wait.c [iso-8859-1] (original) +++ branches/header-work/ntoskrnl/ke/wait.c [iso-8859-1] Wed Mar 3 17:03:14 2010 @@ -110,7 +110,7 @@ FastMutex->Contention++; /* Wait for the event */ - KeWaitForSingleObject(&FastMutex->Gate, + KeWaitForSingleObject(&FastMutex->Event, WrMutex, KernelMode, FALSE,
14 years, 9 months
1
0
0
0
[tkreuzer] 45788: Fix some pshpack / poppack includes
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Mar 3 14:38:45 2010 New Revision: 45788 URL:
http://svn.reactos.org/svn/reactos?rev=45788&view=rev
Log: Fix some pshpack / poppack includes Modified: branches/header-work/include/ddk/wdm.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 14:38:45 2010 @@ -2069,7 +2069,6 @@ PVOID ProcessAuditId; } SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT; -#include <pshpack4.h> typedef struct _ACCESS_STATE { LUID OperationID; BOOLEAN SecurityEvaluated; @@ -2092,7 +2091,6 @@ UNICODE_STRING ObjectName; UNICODE_STRING ObjectTypeName; } ACCESS_STATE, *PACCESS_STATE; -#include <poppack.h> /****************************************************************************** * Configuration Manager Types * @@ -4952,7 +4950,7 @@ DeviceTextLocationInformation } DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE; -#if !defined(_ALPHA_) +#if !defined(_AMD64_) && !defined(_IA64_) #include <pshpack4.h> #endif typedef struct _IO_STACK_LOCATION { @@ -5138,7 +5136,7 @@ PIO_COMPLETION_ROUTINE CompletionRoutine; PVOID Context; } IO_STACK_LOCATION, *PIO_STACK_LOCATION; -#if !defined(_ALPHA_) +#if !defined(_AMD64_) && !defined(_IA64_) #include <poppack.h> #endif
14 years, 9 months
1
0
0
0
← Newer
1
...
81
82
83
84
85
86
87
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200