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
January 2012
----- 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
559 discussions
Start a n
N
ew thread
[tkreuzer] 54937: [XDK] - Add some missing NTAPI - move some types into appropriate headers - make sure $endif is followed by (...)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Jan 13 17:45:26 2012 New Revision: 54937 URL:
http://svn.reactos.org/svn/reactos?rev=54937&view=rev
Log: [XDK] - Add some missing NTAPI - move some types into appropriate headers - make sure $endif is followed by (...) Modified: trunk/reactos/include/ddk/ntddk.h trunk/reactos/include/ddk/ntifs.h trunk/reactos/include/ddk/wdm.h trunk/reactos/include/xdk/exfuncs.h trunk/reactos/include/xdk/extypes.h trunk/reactos/include/xdk/iofuncs.h trunk/reactos/include/xdk/iotypes.h trunk/reactos/include/xdk/kdfuncs.h trunk/reactos/include/xdk/kdtypes.h trunk/reactos/include/xdk/kefuncs.h trunk/reactos/include/xdk/ketypes.h trunk/reactos/include/xdk/mmfuncs.h trunk/reactos/include/xdk/ntifs.template.h trunk/reactos/include/xdk/nttmapi.h trunk/reactos/include/xdk/obtypes.h trunk/reactos/include/xdk/psfuncs.h trunk/reactos/include/xdk/pstypes.h trunk/reactos/include/xdk/rtltypes.h trunk/reactos/include/xdk/sefuncs.h trunk/reactos/include/xdk/setypes.h trunk/reactos/include/xdk/zwfuncs.h Modified: trunk/reactos/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntddk.h?rev=54…
============================================================================== --- trunk/reactos/include/ddk/ntddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntddk.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -3769,6 +3769,7 @@ #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ + /****************************************************************************** * I/O Manager Functions * ******************************************************************************/ Modified: trunk/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=54…
============================================================================== --- trunk/reactos/include/ddk/ntifs.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntifs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -800,6 +800,26 @@ typedef NTSTATUS (NTAPI *PSE_LOGON_SESSION_TERMINATED_ROUTINE)( IN PLUID LogonId); + +typedef struct _SECURITY_CLIENT_CONTEXT { + SECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_TOKEN ClientToken; + BOOLEAN DirectlyAccessClientToken; + BOOLEAN DirectAccessEffectiveOnly; + BOOLEAN ServerIsRemote; + TOKEN_CONTROL ClientTokenControl; +} SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT; + +/****************************************************************************** + * Object Manager Types * + ******************************************************************************/ + +typedef enum _OBJECT_INFORMATION_CLASS { + ObjectBasicInformation = 0, + ObjectTypeInformation = 2, +} OBJECT_INFORMATION_CLASS; + + /****************************************************************************** * Runtime Library Types * ******************************************************************************/ @@ -1886,16 +1906,6 @@ #define RtlOffsetToPointer(B,O) ((PCHAR)(((PCHAR)(B)) + ((ULONG_PTR)(O)))) #define RtlPointerToOffset(B,P) ((ULONG)(((PCHAR)(P)) - ((PCHAR)(B)))) - -typedef enum _OBJECT_INFORMATION_CLASS { - ObjectBasicInformation = 0, - ObjectNameInformation = 1, /* FIXME, not in WDK */ - ObjectTypeInformation = 2, - ObjectTypesInformation = 3, /* FIXME, not in WDK */ - ObjectHandleFlagInformation = 4, /* FIXME, not in WDK */ - ObjectSessionInformation = 5, /* FIXME, not in WDK */ - MaxObjectInfoClass /* FIXME, not in WDK */ -} OBJECT_INFORMATION_CLASS; NTSYSCALLAPI NTSTATUS @@ -4737,18 +4747,12 @@ ULONG Reserved [22]; } PUBLIC_OBJECT_TYPE_INFORMATION, *PPUBLIC_OBJECT_TYPE_INFORMATION; -typedef struct _SECURITY_CLIENT_CONTEXT { - SECURITY_QUALITY_OF_SERVICE SecurityQos; - PACCESS_TOKEN ClientToken; - BOOLEAN DirectlyAccessClientToken; - BOOLEAN DirectAccessEffectiveOnly; - BOOLEAN ServerIsRemote; - TOKEN_CONTROL ClientTokenControl; -} SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT; - #define SYSTEM_PAGE_PRIORITY_BITS 3 #define SYSTEM_PAGE_PRIORITY_LEVELS (1 << SYSTEM_PAGE_PRIORITY_BITS) +/****************************************************************************** + * Kernel Types * + ******************************************************************************/ typedef struct _KAPC_STATE { LIST_ENTRY ApcListHead[MaximumMode]; PKPROCESS Process; @@ -4769,6 +4773,7 @@ LIST_ENTRY ThreadListHead; } KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE; + /****************************************************************************** * Kernel Functions * ******************************************************************************/ @@ -4944,7 +4949,8 @@ NTKERNELAPI ULONG -KeRemoveQueueEx ( +NTAPI +KeRemoveQueueEx( IN OUT PKQUEUE Queue, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, @@ -10286,6 +10292,9 @@ #include "csq.h" +extern PACL SePublicDefaultDacl; +extern PACL SeSystemDefaultDacl; + #define FS_LFN_APIS 0x00004000 #define FILE_STORAGE_TYPE_SPECIFIED 0x00000041 /* FILE_DIRECTORY_FILE | FILE_NON_DIRECTORY_FILE */ Modified: trunk/reactos/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=5493…
============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -7561,6 +7561,7 @@ extern POBJECT_TYPE NTSYSAPI SeTokenObjectType; extern POBJECT_TYPE NTSYSAPI PsProcessType; + /****************************************************************************** * Process Manager Types * ******************************************************************************/ @@ -7896,6 +7897,7 @@ VOID KeMemoryBarrier(VOID) { + // FIXME: Do we really need lfence after the __faststorefence ? FastFence(); LFENCE_ACQUIRE(); } @@ -10351,12 +10353,14 @@ #if (NTDDI_VERSION >= NTDDI_WS08) PVOID +NTAPI KeRegisterProcessorChangeCallback( IN PPROCESSOR_CALLBACK_FUNCTION CallbackFunction, IN PVOID CallbackContext OPTIONAL, IN ULONG Flags); VOID +NTAPI KeDeregisterProcessorChangeCallback( IN PVOID CallbackHandle); @@ -14757,6 +14761,7 @@ #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ + #ifndef _NTTMAPI_ #define _NTTMAPI_ Modified: trunk/reactos/include/xdk/exfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/exfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/exfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/exfuncs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -815,7 +815,7 @@ $if (_WDMDDK_ || _NTIFS_) #if (NTDDI_VERSION >= NTDDI_WINXP) -$endif +$endif (_WDMDDK_ || _NTIFS_) $if (_WDMDDK_) NTKERNELAPI @@ -872,7 +872,7 @@ $endif (_NTIFS_) $if (_WDMDDK_ || _NTIFS_) #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ -$endif +$endif (_WDMDDK_ || _NTIFS_) $if (_WDMDDK_) #if (NTDDI_VERSION >= NTDDI_WINXPSP2) Modified: trunk/reactos/include/xdk/extypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/extypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/extypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/extypes.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -2,7 +2,7 @@ /****************************************************************************** * Executive Types * ******************************************************************************/ -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) #define EX_RUNDOWN_ACTIVE 0x1 #define EX_RUNDOWN_COUNT_SHIFT 0x1 Modified: trunk/reactos/include/xdk/iofuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/iofuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/iofuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/iofuncs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -2051,7 +2051,7 @@ $endif (_WDMDDK_) $if (_WDMDDK_ || _NTDDK_) #if (NTDDI_VERSION >= NTDDI_WS03) -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_NTDDK_) NTKERNELAPI IO_PAGING_PRIORITY @@ -2084,10 +2084,10 @@ $endif (_WDMDDK_) $if (_WDMDDK_ || _NTDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WS03) */ -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_NTDDK_ || _NTIFS_) #if (NTDDI_VERSION >= NTDDI_WS03SP1) -$endif +$endif (_NTDDK_ || _NTIFS_) $if (_NTDDK_) BOOLEAN @@ -2111,7 +2111,7 @@ $endif (_NTIFS_) $if (_NTDDK_ || _NTIFS_) #endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */ -$endif +$endif (_NTDDK_ || _NTIFS_) #if (NTDDI_VERSION >= NTDDI_VISTA) $if (_WDMDDK_) Modified: trunk/reactos/include/xdk/iotypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/iotypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/iotypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/iotypes.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -2,7 +2,7 @@ /****************************************************************************** * I/O Manager Types * ******************************************************************************/ -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) @@ -214,7 +214,7 @@ #define DO_SYSTEM_CRITICAL_PARTITION 0x00400000 #define DO_DISALLOW_EXECUTE 0x00800000 -$endif +$endif (_NTDDK_) $if (_WDMDDK_) /* DEVICE_OBJECT.Flags */ #define DO_VERIFY_VOLUME 0x00000002 @@ -254,12 +254,12 @@ #define FILE_256_BYTE_ALIGNMENT 0x000000ff #define FILE_512_BYTE_ALIGNMENT 0x000001ff -$endif +$endif (_NTDDK_) $if (_WDMDDK_ || _DEVIOCTL_) /* DEVICE_OBJECT.DeviceType */ #define DEVICE_TYPE ULONG -$endif +$endif (_WDMDDK_ || _DEVIOCTL_) $if (_WDMDDK_) typedef struct _DEVICE_OBJECT { CSHORT Type; Modified: trunk/reactos/include/xdk/kdfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/kdfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/kdfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/kdfuncs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -9,7 +9,7 @@ IN PCCH Prompt, OUT PCH Response, IN ULONG MaximumResponseLength); -$endif +$endif (_NTDDK_) $if (_WDMDDK_) #ifndef _DBGNT_ @@ -189,4 +189,4 @@ OUT PVOID OutBuffer, OUT PULONG OutBufferNeeded OPTIONAL); #endif -$endif +$endif (_WDMDDK_) Modified: trunk/reactos/include/xdk/kdtypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/kdtypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/kdtypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/kdtypes.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -91,4 +91,4 @@ IN PVOID Buffer, IN ULONG Offset, IN ULONG Length); -$endif +$endif (_NTDDK_) Modified: trunk/reactos/include/xdk/kefuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/kefuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/kefuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/kefuncs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -103,7 +103,7 @@ $endif(_NTDDK_) $if (_WDMDDK_ || _NTDDK_) #if defined(SINGLE_GROUP_LEGACY_API) -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) NTKERNELAPI @@ -145,7 +145,7 @@ $endif (_NTDDK_) $if (_WDMDDK_ || _NTDDK_) #endif /* defined(SINGLE_GROUP_LEGACY_API) */ -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) #if !defined(_M_AMD64) @@ -605,7 +605,7 @@ KeAcquireSpinLockRaiseToSynch( IN OUT PKSPIN_LOCK SpinLock); #endif -$endif +$endif (_NTIFS_) #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ @@ -735,7 +735,7 @@ $endif (_WDMDDK_) $if (_WDMDDK_ || _NTDDK_) #if (NTDDI_VERSION >= NTDDI_WS03) -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) NTKERNELAPI @@ -794,10 +794,10 @@ $endif (_NTDDK_) $if (_WDMDDK_ || _NTDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WS03) */ -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_ || _NTDDK_) #if (NTDDI_VERSION >= NTDDI_WS03SP1) -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) NTKERNELAPI @@ -878,7 +878,7 @@ $endif (_NTDDK_) $if (_WDMDDK_ || _NTDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */ -$endif +$endif (_WDMDDK_ || _NTDDK_) #if (NTDDI_VERSION >= NTDDI_VISTA) $if (_WDMDDK_) @@ -903,7 +903,7 @@ $endif (_WDMDDK_) $if (_WDMDDK_ || _NTDDK_) #if defined(SINGLE_GROUP_LEGACY_API) -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) NTKERNELAPI @@ -943,7 +943,7 @@ $endif (_NTDDK_) $if (_WDMDDK_ || _NTDDK_) #endif /* SINGLE_GROUP_LEGACY_API */ -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_NTIFS_) NTKERNELAPI VOID @@ -953,7 +953,8 @@ NTKERNELAPI ULONG -KeRemoveQueueEx ( +NTAPI +KeRemoveQueueEx( IN OUT PKQUEUE Queue, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, @@ -968,12 +969,14 @@ #if (NTDDI_VERSION >= NTDDI_WS08) PVOID +NTAPI KeRegisterProcessorChangeCallback( IN PPROCESSOR_CALLBACK_FUNCTION CallbackFunction, IN PVOID CallbackContext OPTIONAL, IN ULONG Flags); VOID +NTAPI KeDeregisterProcessorChangeCallback( IN PVOID CallbackHandle); @@ -981,7 +984,7 @@ $endif (_WDMDDK_) $if (_WDMDDK_ || _NTDDK_) #if (NTDDI_VERSION >= NTDDI_WIN7) -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) ULONG64 @@ -1207,7 +1210,7 @@ $endif (_NTDDK_) $if (_WDMDDK_ || _NTDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) #if !defined(_IA64_) NTHALAPI Modified: trunk/reactos/include/xdk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ketypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/ketypes.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -999,7 +999,7 @@ extern PCCHAR KeNumberProcessors; #endif -$endif /* _WDMDDK_ */ +$endif (_WDMDDK_) $if (_NTDDK_) #define NX_SUPPORT_POLICY_ALWAYSOFF 0 @@ -1182,5 +1182,27 @@ extern PCCHAR KeNumberProcessors; #endif -$endif /* _NTDDK_ */ - +$endif (_NTDDK_) +$if (_NTIFS_) +typedef struct _KAPC_STATE { + LIST_ENTRY ApcListHead[MaximumMode]; + PKPROCESS Process; + BOOLEAN KernelApcInProgress; + BOOLEAN KernelApcPending; + BOOLEAN UserApcPending; +} KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE; + +#define KAPC_STATE_ACTUAL_LENGTH (FIELD_OFFSET(KAPC_STATE, UserApcPending) + sizeof(BOOLEAN)) + +#define ASSERT_QUEUE(Q) ASSERT(((Q)->Header.Type & KOBJECT_TYPE_MASK) == QueueObject); + +typedef struct _KQUEUE { + DISPATCHER_HEADER Header; + LIST_ENTRY EntryListHead; + volatile ULONG CurrentCount; + ULONG MaximumCount; + LIST_ENTRY ThreadListHead; +} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE; + +$endif (_NTIFS_) + Modified: trunk/reactos/include/xdk/mmfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/mmfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/mmfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/mmfuncs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -591,7 +591,7 @@ $if (_WDMDDK_ || _NTIFS_) #if (NTDDI_VERSION >= NTDDI_WINXP) -$endif +$endif (_WDMDDK_ || _NTIFS_) $if (_WDMDDK_) NTKERNELAPI @@ -664,10 +664,10 @@ $if (_WDMDDK_ || _NTIFS_) #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ -$endif +$endif (_WDMDDK_ || _NTIFS_) $if (_WDMDDK_ || _NTDDK_) #if (NTDDI_VERSION >= NTDDI_WS03) -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) NTKERNELAPI LOGICAL @@ -685,7 +685,7 @@ $endif (_NTDDK_) $if (_WDMDDK_ || _NTDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WS03) */ -$endif +$endif (_WDMDDK_ || _NTDDK_) $if (_WDMDDK_) #if (NTDDI_VERSION >= NTDDI_WS03SP1) NTKERNELAPI @@ -699,7 +699,7 @@ IN MEMORY_CACHING_TYPE CacheType, IN ULONG Flags); #endif -$endif +$endif (_WDMDDK_) #if (NTDDI_VERSION >= NTDDI_VISTA) $if (_WDMDDK_) Modified: trunk/reactos/include/xdk/ntifs.template.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ntifs.template…
============================================================================== --- trunk/reactos/include/xdk/ntifs.template.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/ntifs.template.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -62,18 +62,9 @@ typedef OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES, *PLSA_OBJECT_ATTRIBUTES; $include (setypes.h) +$include (obtypes.h) $include (rtltypes.h) $include (rtlfuncs.h) - -typedef enum _OBJECT_INFORMATION_CLASS { - ObjectBasicInformation = 0, - ObjectNameInformation = 1, /* FIXME, not in WDK */ - ObjectTypeInformation = 2, - ObjectTypesInformation = 3, /* FIXME, not in WDK */ - ObjectHandleFlagInformation = 4, /* FIXME, not in WDK */ - ObjectSessionInformation = 5, /* FIXME, not in WDK */ - MaxObjectInfoClass /* FIXME, not in WDK */ -} OBJECT_INFORMATION_CLASS; NTSYSCALLAPI NTSTATUS @@ -1031,38 +1022,10 @@ ULONG Reserved [22]; } PUBLIC_OBJECT_TYPE_INFORMATION, *PPUBLIC_OBJECT_TYPE_INFORMATION; -typedef struct _SECURITY_CLIENT_CONTEXT { - SECURITY_QUALITY_OF_SERVICE SecurityQos; - PACCESS_TOKEN ClientToken; - BOOLEAN DirectlyAccessClientToken; - BOOLEAN DirectAccessEffectiveOnly; - BOOLEAN ServerIsRemote; - TOKEN_CONTROL ClientTokenControl; -} SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT; - #define SYSTEM_PAGE_PRIORITY_BITS 3 #define SYSTEM_PAGE_PRIORITY_LEVELS (1 << SYSTEM_PAGE_PRIORITY_BITS) -typedef struct _KAPC_STATE { - LIST_ENTRY ApcListHead[MaximumMode]; - PKPROCESS Process; - BOOLEAN KernelApcInProgress; - BOOLEAN KernelApcPending; - BOOLEAN UserApcPending; -} KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE; - -#define KAPC_STATE_ACTUAL_LENGTH (FIELD_OFFSET(KAPC_STATE, UserApcPending) + sizeof(BOOLEAN)) - -#define ASSERT_QUEUE(Q) ASSERT(((Q)->Header.Type & KOBJECT_TYPE_MASK) == QueueObject); - -typedef struct _KQUEUE { - DISPATCHER_HEADER Header; - LIST_ENTRY EntryListHead; - volatile ULONG CurrentCount; - ULONG MaximumCount; - LIST_ENTRY ThreadListHead; -} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE; - +$include (ketypes.h) $include (kefuncs.h) $include (extypes.h) $include (exfuncs.h) @@ -1268,6 +1231,9 @@ #endif #include "csq.h" + +extern PACL SePublicDefaultDacl; +extern PACL SeSystemDefaultDacl; #define FS_LFN_APIS 0x00004000 Modified: trunk/reactos/include/xdk/nttmapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/nttmapi.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/nttmapi.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/nttmapi.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -1,4 +1,3 @@ -$if (_WDMDDK_) #ifndef _NTTMAPI_ #define _NTTMAPI_ @@ -649,4 +648,3 @@ #endif /* NTDDI_VERSION >= NTDDI_VISTA */ #endif /* !_NTTMAPI_ */ -$endif Modified: trunk/reactos/include/xdk/obtypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/obtypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/obtypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/obtypes.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -2,6 +2,7 @@ * Object Manager Types * ******************************************************************************/ +$if (_WDMDDK_) #define MAXIMUM_FILENAME_LENGTH 256 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\') @@ -132,3 +133,22 @@ extern POBJECT_TYPE NTSYSAPI SeTokenObjectType; extern POBJECT_TYPE NTSYSAPI PsProcessType; +$endif (_WDMDDK_) +$if (_NTIFS_) +typedef enum _OBJECT_INFORMATION_CLASS { + ObjectBasicInformation = 0, + ObjectTypeInformation = 2, +$endif (_NTIFS_) +$if (_PRIVATE_) + /* Not for public use */ + ObjectNameInformation = 1, + ObjectTypesInformation = 3, + ObjectHandleFlagInformation = 4, + ObjectSessionInformation = 5, + MaxObjectInfoClass +$endif (_PRIVATE_) +$if (_NTIFS_) +} OBJECT_INFORMATION_CLASS; + +$endif (_NTIFS_) + Modified: trunk/reactos/include/xdk/psfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/psfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/psfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/psfuncs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -211,7 +211,7 @@ #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ $if (_NTDDK_ || _NTIFS_) #if (NTDDI_VERSION >= NTDDI_WINXP) -$endif +$endif (_NTDDK_ || _NTIFS_) $if (_NTDDK_) NTKERNELAPI @@ -274,7 +274,7 @@ $endif (_NTIFS_) $if (_NTDDK_ || _NTIFS_) #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ -$endif +$endif (_NTDDK_ || _NTIFS_) $if (_NTDDK_) #if (NTDDI_VERSION >= NTDDI_WS03) Modified: trunk/reactos/include/xdk/pstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/pstypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/pstypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/pstypes.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -38,7 +38,7 @@ #define HIGH_PRIORITY 31 #define MAXIMUM_PRIORITY 32 -$endif /* _WDMDDK_ */ +$endif (_WDMDDK_) $if (_NTDDK_) #define QUOTA_LIMITS_HARDWS_MIN_ENABLE 0x00000001 @@ -447,5 +447,5 @@ extern NTKERNELAPI PEPROCESS PsInitialSystemProcess; -$endif /* _NTDDK_ */ - +$endif (_NTDDK_) + Modified: trunk/reactos/include/xdk/rtltypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/rtltypes.h?rev…
============================================================================== --- trunk/reactos/include/xdk/rtltypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/rtltypes.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -553,4 +553,4 @@ ULONG CompressedChunkSizes[ANYSIZE_ARRAY]; } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO; #endif -$endif +$endif (_NTIFS_) Modified: trunk/reactos/include/xdk/sefuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/sefuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/sefuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/sefuncs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -378,7 +378,7 @@ $if (_WDMDDK_ || _NTIFS_) #if (NTDDI_VERSION >= NTDDI_VISTA) -$endif +$endif (_WDMDDK_ || _NTIFS_) $if (_WDMDDK_) NTKERNELAPI ULONG @@ -481,7 +481,7 @@ $endif (_NTIFS_) $if (_WDMDDK_ || _NTIFS_) #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ -$endif +$endif (_WDMDDK_ || _NTIFS_) $if (_NTIFS_) #if (NTDDI_VERSION >= NTDDI_VISTA || (NTDDI_VERSION >= NTDDI_WINXPSP2 && NTDDI_VERSION < NTDDI_WS03)) Modified: trunk/reactos/include/xdk/setypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/setypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/setypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/setypes.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -303,7 +303,7 @@ #endif /* !_NTLSA_AUDIT_ */ #endif /* !_NTLSA_IFS_ */ -$endif +$endif (_WDMDDK_) $if (_NTDDK_) #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 @@ -392,7 +392,7 @@ WinConsoleLogonSid = 81, WinThisOrganizationCertificateSid = 82, } WELL_KNOWN_SID_TYPE; -$endif +$endif (_NTDDK_) $if (_NTIFS_) #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED #define SID_IDENTIFIER_AUTHORITY_DEFINED @@ -1131,4 +1131,14 @@ typedef NTSTATUS (NTAPI *PSE_LOGON_SESSION_TERMINATED_ROUTINE)( IN PLUID LogonId); + +typedef struct _SECURITY_CLIENT_CONTEXT { + SECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_TOKEN ClientToken; + BOOLEAN DirectlyAccessClientToken; + BOOLEAN DirectAccessEffectiveOnly; + BOOLEAN ServerIsRemote; + TOKEN_CONTROL ClientTokenControl; +} SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT; + $endif (_NTIFS_) Modified: trunk/reactos/include/xdk/zwfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/zwfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/zwfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/zwfuncs.h [iso-8859-1] Fri Jan 13 17:45:26 2012 @@ -642,7 +642,7 @@ $if (_WDMDDK_ || _NTIFS_) #if (NTDDI_VERSION >= NTDDI_VISTA) -$endif +$endif (_WDMDDK_ || _NTIFS_) $if (_WDMDDK_) NTSYSAPI @@ -1025,7 +1025,7 @@ $endif (_NTIFS_) $if (_WDMDDK_ || _NTIFS_) #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ -$endif +$endif (_WDMDDK_ || _NTIFS_) #if (NTDDI_VERSION >= NTDDI_WIN7) $if (_WDMDDK_)
12 years, 11 months
1
0
0
0
[rharabien] 54936: [SHELL32] - Display free and used space and capacity in bytes and gigabytes for all drives in drive properties dialog - Format date and time in file properties according to syste...
by rharabien@svn.reactos.org
Author: rharabien Date: Fri Jan 13 17:42:27 2012 New Revision: 54936 URL:
http://svn.reactos.org/svn/reactos?rev=54936&view=rev
Log: [SHELL32] - Display free and used space and capacity in bytes and gigabytes for all drives in drive properties dialog - Format date and time in file properties according to system locale - Initialize checkboxes in file properties dialog - Improve polish translation Modified: trunk/reactos/dll/win32/shell32/drvdefext.cpp trunk/reactos/dll/win32/shell32/drvdefext.h trunk/reactos/dll/win32/shell32/filedefext.cpp trunk/reactos/dll/win32/shell32/filedefext.h trunk/reactos/dll/win32/shell32/lang/pl-PL.rc Modified: trunk/reactos/dll/win32/shell32/drvdefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drvdefex…
============================================================================== --- trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] Fri Jan 13 17:42:27 2012 @@ -39,6 +39,7 @@ LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode); +UINT SH_FormatByteSize(LONGLONG cbSize, LPWSTR pwszResult, UINT cchResultMax); static VOID GetDriveNameWithLetter(LPWSTR pwszText, UINT cchTextMax, LPCWSTR pwszDrive) @@ -211,19 +212,15 @@ HPEN hDarkBluePen = CreatePen(PS_SOLID, 1, RGB(0, 0, 128)); HPEN hDarkMagPen = CreatePen(PS_SOLID, 1, RGB(128, 0, 128)); - WCHAR wszBuf[20]; - GetDlgItemTextW(hwndDlg, 14006, wszBuf, _countof(wszBuf)); - UINT cFreeSpace = _wtoi(wszBuf); - INT xCenter = (pDrawItem->rcItem.left + pDrawItem->rcItem.right)/2; INT yCenter = (pDrawItem->rcItem.top + pDrawItem->rcItem.bottom - 10)/2; INT cx = pDrawItem->rcItem.right - pDrawItem->rcItem.left; INT cy = pDrawItem->rcItem.bottom - pDrawItem->rcItem.top - 10; - TRACE("FreeSpace %u a %f cx %d\n", cFreeSpace, M_PI+cFreeSpace/100.0f*M_PI*2.0f, cx); + TRACE("FreeSpace %u a %f cx %d\n", m_FreeSpacePerc, M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f, cx); HBRUSH hbrOld = (HBRUSH)SelectObject(pDrawItem->hDC, hMagBrush); - INT xRadial = xCenter + (INT)(cosf(M_PI+cFreeSpace/100.0f*M_PI*2.0f)*cx/2); - INT yRadial = yCenter - (INT)(sinf(M_PI+cFreeSpace/100.0f*M_PI*2.0f)*cy/2); + INT xRadial = xCenter + (INT)(cosf(M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f)*cx/2); + INT yRadial = yCenter - (INT)(sinf(M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f)*cy/2); Pie(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top, pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10, @@ -241,7 +238,7 @@ HPEN hOldPen = (HPEN)SelectObject(pDrawItem->hDC, hDarkBluePen); for (INT x = pDrawItem->rcItem.left; x < pDrawItem->rcItem.right; ++x) { - if (cFreeSpace < 50 && x == xRadial) + if (m_FreeSpacePerc < 50 && x == xRadial) SelectObject(pDrawItem->hDC, hDarkMagPen); float cos_val = (x - xCenter)*2.0f/cx; @@ -269,61 +266,53 @@ bRet = GetVolumeInformationW(m_wszDrive, wszVolumeName, _countof(wszVolumeName), NULL, NULL, NULL, wszFileSystem, _countof(wszFileSystem)); if (bRet) { - /* set volume label */ + /* Set volume label and filesystem */ SetDlgItemTextW(hwndDlg, 14000, wszVolumeName); - - /* set filesystem type */ SetDlgItemTextW(hwndDlg, 14002, wszFileSystem); } + /* Set drive type and icon */ UINT DriveType = GetDriveTypeW(m_wszDrive); - if (DriveType == DRIVE_FIXED || DriveType == DRIVE_CDROM) - { - ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes; - if(GetDiskFreeSpaceExW(m_wszDrive, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) - { - ULONG SpacePercent; - HANDLE hVolume; - DWORD BytesReturned = 0; - - swprintf(wszBuf, L"\\\\.\\%c:", towupper(m_wszDrive[0])); - hVolume = CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); - if (hVolume != INVALID_HANDLE_VALUE) - { - bRet = DeviceIoControl(hVolume, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (LPVOID)&TotalNumberOfBytes, sizeof(ULARGE_INTEGER), &BytesReturned, NULL); - if (bRet && StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14007, wszBuf); - - CloseHandle(hVolume); - } - - TRACE("wszBuf %s hVolume %p bRet %d LengthInformation %ul BytesReturned %d\n", debugstr_w(wszBuf), hVolume, bRet, TotalNumberOfBytes.QuadPart, BytesReturned); - - if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14003, wszBuf); - - if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14005, wszBuf); - - SpacePercent = (ULONG)(TotalNumberOfFreeBytes.QuadPart*100ull/TotalNumberOfBytes.QuadPart); - /* set free bytes percentage */ - swprintf(wszBuf, L"%u%%", SpacePercent); + UINT IconId, TypeStrId = 0; + switch (DriveType) + { + case DRIVE_CDROM: IconId = IDI_SHELL_CDROM; TypeStrId = IDS_DRIVE_CDROM; break; + case DRIVE_REMOVABLE: IconId = IDI_SHELL_FLOPPY; break; + case DRIVE_RAMDISK: IconId = IDI_SHELL_RAMDISK; break; + default: IconId = IDI_SHELL_DRIVE; TypeStrId = IDS_DRIVE_FIXED; + } + HICON hIcon = (HICON)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IconId), IMAGE_ICON, 32, 32, LR_SHARED); + if (hIcon) + SendDlgItemMessageW(hwndDlg, 14016, STM_SETICON, (WPARAM)hIcon, 0); + if (TypeStrId && LoadStringW(shell32_hInstance, TypeStrId, wszBuf, _countof(wszBuf))) + SetDlgItemTextW(hwndDlg, 14001, wszBuf); + + ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes; + if(GetDiskFreeSpaceExW(m_wszDrive, &FreeBytesAvailable, &TotalNumberOfBytes, NULL)) + { + /* Init free space percentage used for drawing piechart */ + m_FreeSpacePerc = (UINT)(FreeBytesAvailable.QuadPart * 100ull / TotalNumberOfBytes.QuadPart); + + /* Used space */ + if (SH_FormatByteSize(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf))) + SetDlgItemTextW(hwndDlg, 14003, wszBuf); + + if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf))) + SetDlgItemTextW(hwndDlg, 14004, wszBuf); + + /* Free space */ + if (SH_FormatByteSize(FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf))) + SetDlgItemTextW(hwndDlg, 14005, wszBuf); + + if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf))) SetDlgItemTextW(hwndDlg, 14006, wszBuf); - /* store used share amount */ - SpacePercent = 100 - SpacePercent; - swprintf(wszBuf, L"%u%%", SpacePercent); - SetDlgItemTextW(hwndDlg, 14004, wszBuf); - if (DriveType == DRIVE_FIXED) - { - if (LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14001, wszBuf); - } - else /* DriveType == DRIVE_CDROM) */ - { - if (LoadStringW(shell32_hInstance, IDS_DRIVE_CDROM, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14001, wszBuf); - } - } + + /* Total space */ + if (SH_FormatByteSize(FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf))) + SetDlgItemTextW(hwndDlg, 14007, wszBuf); + + if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, _countof(wszBuf))) + SetDlgItemTextW(hwndDlg, 14008, wszBuf); } /* Set drive description */ @@ -331,18 +320,6 @@ GetDlgItemTextW(hwndDlg, 14009, wszFormat, _countof(wszFormat)); swprintf(wszBuf, wszFormat, m_wszDrive[0]); SetDlgItemTextW(hwndDlg, 14009, wszBuf); - - /* Set drive icon */ - UINT IconId; - switch (DriveType) - { - case DRIVE_CDROM: IconId = IDI_SHELL_CDROM; break; - case DRIVE_REMOVABLE: IconId = IDI_SHELL_FLOPPY; break; - case DRIVE_RAMDISK: IconId = IDI_SHELL_RAMDISK; break; - default: IconId = IDI_SHELL_DRIVE; - } - HICON hIcon = (HICON)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IconId), IMAGE_ICON, 32, 32, LR_SHARED); - SendDlgItemMessageW(hwndDlg, 14016, STM_SETICON, (WPARAM)hIcon, 0); } INT_PTR CALLBACK @@ -371,7 +348,8 @@ if (pDrawItem->CtlID >= 14013 && pDrawItem->CtlID <= 14015) { - CDrvDefExt::PaintStaticControls(hwndDlg, pDrawItem); + CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + pDrvDefExt->PaintStaticControls(hwndDlg, pDrawItem); return TRUE; } break; Modified: trunk/reactos/dll/win32/shell32/drvdefext.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drvdefex…
============================================================================== --- trunk/reactos/dll/win32/shell32/drvdefext.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/drvdefext.h [iso-8859-1] Fri Jan 13 17:42:27 2012 @@ -30,13 +30,14 @@ public IObjectWithSite { private: - static VOID PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem); + VOID PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem); VOID InitGeneralPage(HWND hwndDlg); static INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static INT_PTR CALLBACK HardwarePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); WCHAR m_wszDrive[MAX_PATH]; + UINT m_FreeSpacePerc; public: CDrvDefExt(); Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] Fri Jan 13 17:42:27 2012 @@ -122,64 +122,35 @@ return m_wszLang; } -/************************************************************************* - * - * SH_FormatFileSizeWithBytes - * - * Format a size in bytes to string. - * - * lpQwSize = Pointer to 64bit large integer to format - * pszBuf = Buffer to fill with output string - * cchBuf = size of pszBuf in characters - * - */ - -LPWSTR -SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf) -{ +UINT +SH_FormatInteger(LONGLONG Num, LPWSTR pwszResult, UINT cchResultMax) +{ + // Print the number in uniform mode + WCHAR wszNumber[24]; + swprintf(wszNumber, L"%I64u", Num); + + // Get system strings for decimal and thousand separators. + WCHAR wszDecimalSep[8], wszThousandSep[8]; + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, wszDecimalSep, _countof(wszDecimalSep)); + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, wszThousandSep, _countof(wszThousandSep)); + + // Initialize format for printing the number in bytes NUMBERFMTW nf; - WCHAR szNumber[24]; - WCHAR szDecimalSep[8]; - WCHAR szThousandSep[8]; - WCHAR szGrouping[12]; - int Len, cchFormatted, i; - size_t cchRemaining; - LPWSTR Ptr; - - // Try to build first Format byte string - if (StrFormatByteSizeW(lpQwSize->QuadPart, pszBuf, cchBuf) == NULL) - return NULL; - - // If there is less bytes than 1KB, we have nothing to do - if (lpQwSize->QuadPart < 1024) - return pszBuf; - - // Print the number in uniform mode - swprintf(szNumber, L"%I64u", lpQwSize->QuadPart); - - // Get system strings for decimal and thousand separators. - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSep, sizeof(szDecimalSep) / sizeof(*szDecimalSep)); - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, szThousandSep, sizeof(szThousandSep) / sizeof(*szThousandSep)); - - // Initialize format for printing the number in bytes ZeroMemory(&nf, sizeof(nf)); - nf.NumDigits = 0; - nf.LeadingZero = 0; - nf.Grouping = 0; - nf.lpDecimalSep = szDecimalSep; - nf.lpThousandSep = szThousandSep; - nf.NegativeOrder = 0; + nf.lpDecimalSep = wszDecimalSep; + nf.lpThousandSep = wszThousandSep; // Get system string for groups separator - Len = GetLocaleInfoW(LOCALE_USER_DEFAULT, - LOCALE_SGROUPING, - szGrouping, - sizeof(szGrouping) / sizeof(*szGrouping)); + WCHAR wszGrouping[12]; + INT cchGrouping = GetLocaleInfoW(LOCALE_USER_DEFAULT, + LOCALE_SGROUPING, + wszGrouping, + _countof(wszGrouping)); // Convert grouping specs from string to integer - for (i = 0; i < Len; i++) - { - WCHAR wch = szGrouping[i]; + for (INT i = 0; i < cchGrouping; i++) + { + WCHAR wch = wszGrouping[i]; if (wch >= L'0' && wch <= L'9') nf.Grouping = nf.Grouping * 10 + (wch - L'0'); @@ -192,38 +163,77 @@ else nf.Grouping *= 10; - // Concate " (" at the end of buffer - Len = wcslen(pszBuf); - Ptr = pszBuf + Len; - cchRemaining = cchBuf - Len; - StringCchCopyExW(Ptr, cchRemaining, L" (", &Ptr, &cchRemaining, 0); - - // Save formatted number of bytes in buffer - cchFormatted = GetNumberFormatW(LOCALE_USER_DEFAULT, + // Format the number + INT cchResult = GetNumberFormatW(LOCALE_USER_DEFAULT, 0, - szNumber, + wszNumber, &nf, - Ptr, - cchRemaining); - - if (cchFormatted == 0) + pwszResult, + cchResultMax); + + if (!cchResult) + return 0; + + // GetNumberFormatW returns number of characters including UNICODE_NULL + return cchResult - 1; +} + +UINT +SH_FormatByteSize(LONGLONG cbSize, LPWSTR pwszResult, UINT cchResultMax) +{ + /* Write formated bytes count */ + INT cchWritten = SH_FormatInteger(cbSize, pwszResult, cchResultMax); + if (!cchWritten) + return 0; + + /* Copy " bytes" to buffer */ + LPWSTR pwszEnd = pwszResult + cchWritten; + size_t cchRemaining = cchResultMax - cchWritten; + StringCchCopyExW(pwszEnd, cchRemaining, L" ", &pwszEnd, &cchRemaining, NULL); + cchWritten = LoadStringW(shell32_hInstance, IDS_BYTES_FORMAT, pwszEnd, cchRemaining); + cchRemaining -= cchWritten; + + return cchResultMax - cchRemaining; +} + +/************************************************************************* + * + * SH_FormatFileSizeWithBytes + * + * Format a size in bytes to string. + * + * lpQwSize = Pointer to 64bit large integer to format + * pszBuf = Buffer to fill with output string + * cchBuf = size of pszBuf in characters + * + */ + +LPWSTR +SH_FormatFileSizeWithBytes(const PULARGE_INTEGER lpQwSize, LPWSTR pwszResult, UINT cchResultMax) +{ + /* Format bytes in KBs, MBs etc */ + if (StrFormatByteSizeW(lpQwSize->QuadPart, pwszResult, cchResultMax) == NULL) return NULL; - // cchFormatted is number of characters including NULL - make it a real length - --cchFormatted; - - // Copy ' ' to buffer - Ptr += cchFormatted; - cchRemaining -= cchFormatted; - StringCchCopyExW(Ptr, cchRemaining, L" ", &Ptr, &cchRemaining, 0); - - // Copy 'bytes' string and remaining ')' - Len = LoadStringW(shell32_hInstance, IDS_BYTES_FORMAT, Ptr, cchRemaining); - Ptr += Len; - cchRemaining -= Len; - StringCchCopy(Ptr, cchRemaining, L")"); - - return pszBuf; + /* If there is less bytes than 1KB, we have nothing to do */ + if (lpQwSize->QuadPart < 1024) + return pwszResult; + + /* Concate " (" */ + UINT cchWritten = wcslen(pwszResult); + LPWSTR pwszEnd = pwszResult + cchWritten; + size_t cchRemaining = cchResultMax - cchWritten; + StringCchCopyExW(pwszEnd, cchRemaining, L" (", &pwszEnd, &cchRemaining, 0); + + /* Write formated bytes count */ + cchWritten = SH_FormatByteSize(lpQwSize->QuadPart, pwszEnd, cchRemaining); + pwszEnd += cchWritten; + cchRemaining -= cchWritten; + + /* Copy ")" to the buffer */ + StringCchCopyW(pwszEnd, cchRemaining, L")"); + + return pwszResult; } /************************************************************************* @@ -412,23 +422,32 @@ */ BOOL -CFileDefExt::GetFileTimeString(LPFILETIME lpFileTime, WCHAR *lpResult) +CFileDefExt::GetFileTimeString(LPFILETIME lpFileTime, LPWSTR pwszResult, UINT cchResult) { FILETIME ft; SYSTEMTIME st; - if (lpFileTime == NULL || lpResult == NULL) - return FALSE; - - if (!FileTimeToLocalFileTime(lpFileTime, &ft)) - return FALSE; - - FileTimeToSystemTime(&ft, &st); - - /* ddmmyy */ - swprintf(lpResult, L"%02hu/%02hu/%04hu %02hu:%02hu", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute); - - TRACE("result %s\n", debugstr_w(lpResult)); + if (!FileTimeToLocalFileTime(lpFileTime, &ft) || !FileTimeToSystemTime(&ft, &st)) + return FALSE; + + size_t cchRemaining = cchResult; + LPWSTR pwszEnd = pwszResult; + int cchWritten = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, pwszEnd, cchRemaining); + if (cchWritten) + --cchWritten; // GetDateFormatW returns count with terminating zero + else + ERR("GetDateFormatW failed\n"); + cchRemaining -= cchWritten; + pwszEnd += cchWritten; + + StringCchCopyExW(pwszEnd, cchRemaining, L", ", &pwszEnd, &cchRemaining, 0); + + cchWritten = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, pwszEnd, cchRemaining); + if (cchWritten) + --cchWritten; // GetTimeFormatW returns count with terminating zero + else + ERR("GetTimeFormatW failed\n"); + TRACE("result %s\n", debugstr_w(pwszResult)); return TRUE; } @@ -509,13 +528,13 @@ CloseHandle(hFile); - if (GetFileTimeString(&CreateTime, wszBuf)) + if (GetFileTimeString(&CreateTime, wszBuf, _countof(wszBuf))) SetDlgItemTextW(hwndDlg, 14015, wszBuf); - if (GetFileTimeString(&AccessedTime, wszBuf)) + if (GetFileTimeString(&AccessedTime, wszBuf, _countof(wszBuf))) SetDlgItemTextW(hwndDlg, 14019, wszBuf); - if (GetFileTimeString(&WriteTime, wszBuf)) + if (GetFileTimeString(&WriteTime, wszBuf, _countof(wszBuf))) SetDlgItemTextW(hwndDlg, 14017, wszBuf); if (SH_FormatFileSizeWithBytes((PULARGE_INTEGER)&FileSize, @@ -566,6 +585,14 @@ /* Set file created/modfied/accessed time */ InitFileSizeTime(hwndDlg); + + DWORD dwAttr = GetFileAttributesW(m_wszPath); + if (dwAttr & FILE_ATTRIBUTE_READONLY) + SendDlgItemMessage(hwndDlg, 14021, BM_SETCHECK, BST_CHECKED, 0); + if (dwAttr & FILE_ATTRIBUTE_HIDDEN) + SendDlgItemMessage(hwndDlg, 14022, BM_SETCHECK, BST_CHECKED, 0); + if (dwAttr & FILE_ATTRIBUTE_ARCHIVE) + SendDlgItemMessage(hwndDlg, 14023, BM_SETCHECK, BST_CHECKED, 0); return TRUE; } Modified: trunk/reactos/dll/win32/shell32/filedefext.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/filedefext.h [iso-8859-1] Fri Jan 13 17:42:27 2012 @@ -64,7 +64,7 @@ private: VOID InitOpensWithField(HWND hwndDlg); BOOL InitFileType(HWND hwndDlg); - static BOOL GetFileTimeString(LPFILETIME lpFileTime, WCHAR *lpResult); + static BOOL GetFileTimeString(LPFILETIME lpFileTime, LPWSTR pwszResult, UINT cchResult); BOOL InitFilePath(HWND hwndDlg); BOOL InitFileSizeTime(HWND hwndDlg); BOOL InitGeneralPage(HWND hwndDlg); Modified: trunk/reactos/dll/win32/shell32/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pl-PL.rc [iso-8859-1] Fri Jan 13 17:42:27 2012 @@ -312,9 +312,9 @@ CONTROL "", 14015, "Static", SS_OWNERDRAW, 70, 135, 100, 30 LTEXT "NapÄd %c", 14009, 100, 170, 40, 10 - PUSHBUTTON "Czyszczenie dysku", 14010, 180, 175, 50, 15, WS_TABSTOP - CHECKBOX "Kompresja danych na dysku", 14011, 15, 205, 180, 10, WS_DISABLED - CHECKBOX "Zezwól UsÅudze Indeksowania na zaindeksowanie tego dysku (szybkie przeszukiwanie plików)", 14012, 15, 220, 200, 10, WS_DISABLED + PUSHBUTTON "Oczyszczanie dysku", 14010, 170, 175, 60, 15, WS_TABSTOP + CHECKBOX "Kompresuj dysk, aby zaoszczÄdziÄ miejsce na dysku", 14011, 15, 205, 180, 10, WS_DISABLED + CHECKBOX "Zezwalaj na indeksowanie tego dysku, aby przyÅpieszyÄ wyszukiwanie plików", 14012, 15, 220, 200, 10, WS_DISABLED END DRIVE_EXTRA_DLG DIALOGEX 0, 0, 240, 230 @@ -324,13 +324,13 @@ BEGIN GROUPBOX "Sprawdzanie bÅÄdów", -1, 5, 5, 230, 60 LTEXT "Ta opcja sprawdzi wolumin w poszukiwaniu bÅÄdów.", -1, 40, 25, 160, 20 - PUSHBUTTON "Sprawdź", 14000, 130, 45, 90, 15, WS_TABSTOP + PUSHBUTTON "Sprawdź...", 14000, 130, 45, 90, 15, WS_TABSTOP GROUPBOX "Defragmentacja", -1, 5, 65, 230, 60 - LTEXT "Ta opcja zdefragmentuje pliki na woluminie", -1, 40, 85, 160, 20 - PUSHBUTTON "Defragmentuj", 14001, 130, 105, 90, 15, WS_TABSTOP + LTEXT "Ta opcja dokona defragmentacji plików woluminu.", -1, 40, 85, 160, 20 + PUSHBUTTON "Defragmentuj...", 14001, 130, 105, 90, 15, WS_TABSTOP GROUPBOX "Kopia zapasowa", -1, 5, 130, 230, 60 - LTEXT "Ta opcja wykona kopiÄ zapasowÄ plików na woluminie.", -1, 40, 150, 160, 20 - PUSHBUTTON "Stwórz kopiÄ", 14002, 130, 170, 90, 15, WS_TABSTOP + LTEXT "Ta opcja wykona kopiÄ zapasowÄ plików tego woluminu.", -1, 40, 150, 160, 20 + PUSHBUTTON "Wykonaj kopiÄ zapasowÄ ...", 14002, 130, 170, 90, 15, WS_TABSTOP END DRIVE_HARDWARE_DLG DIALOGEX 0, 0, 240, 230
12 years, 11 months
1
0
0
0
[akhaldi] 54935: [USBDRV] * Mark dev_mgr_cancel_irp as NTAPI.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 13 14:34:28 2012 New Revision: 54935 URL:
http://svn.reactos.org/svn/reactos?rev=54935&view=rev
Log: [USBDRV] * Mark dev_mgr_cancel_irp as NTAPI. Modified: trunk/reactos/drivers/usb/nt4compat/usbdrv/devmgr.c trunk/reactos/drivers/usb/nt4compat/usbdrv/devmgr.h Modified: trunk/reactos/drivers/usb/nt4compat/usbdrv/devmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdrv/devmgr.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdrv/devmgr.c [iso-8859-1] Fri Jan 13 14:34:28 2012 @@ -1499,6 +1499,7 @@ } VOID +NTAPI dev_mgr_cancel_irp(PDEVICE_OBJECT dev_obj, PIRP pirp) { PUSB_DEV_MANAGER dev_mgr; Modified: trunk/reactos/drivers/usb/nt4compat/usbdrv/devmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdrv/devmgr.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdrv/devmgr.h [iso-8859-1] Fri Jan 13 14:34:28 2012 @@ -276,6 +276,6 @@ LONG dev_mgr_score_driver_for_dev(PUSB_DEV_MANAGER dev_mgr, PUSB_DRIVER pdriver, PUSB_DEVICE_DESC pdev_desc); NTSTATUS dev_mgr_destroy_usb_config(PUSB_CONFIGURATION pcfg); BOOLEAN dev_mgr_start_select_driver(PUSB_DEV pdev); -VOID dev_mgr_cancel_irp(PDEVICE_OBJECT pdev_obj, PIRP pirp); +VOID NTAPI dev_mgr_cancel_irp(PDEVICE_OBJECT pdev_obj, PIRP pirp); #endif
12 years, 11 months
1
0
0
0
[cgutman] 54934: [TCPIP] - Fix a bug where a static IP configuration was not properly restored after a media state change
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Jan 13 10:47:44 2012 New Revision: 54934 URL:
http://svn.reactos.org/svn/reactos?rev=54934&view=rev
Log: [TCPIP] - Fix a bug where a static IP configuration was not properly restored after a media state change Modified: branches/wlan-bringup/drivers/network/tcpip/tcpip/dispatch.c branches/wlan-bringup/lib/drivers/ip/network/ip.c Modified: branches/wlan-bringup/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Fri Jan 13 10:47:44 2012 @@ -1568,6 +1568,7 @@ TI_DbgPrint(MID_TRACE,("New Netmask : %x\n", IF->Netmask.Address.IPv4Address)); + IF->DhcpEnabled = FALSE; IPAddInterfaceRoute( IF ); IpAddrChange->Address = IF->Index; @@ -1599,6 +1600,8 @@ IF->Broadcast.Type = IP_ADDRESS_V4; IF->Broadcast.Address.IPv4Address = 0; + + IF->DhcpEnabled = TRUE; Status = STATUS_SUCCESS; } } EndFor(IF); Modified: branches/wlan-bringup/lib/drivers/ip/network/ip.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/lib/drivers/ip/net…
============================================================================== --- branches/wlan-bringup/lib/drivers/ip/network/ip.c [iso-8859-1] (original) +++ branches/wlan-bringup/lib/drivers/ip/network/ip.c [iso-8859-1] Fri Jan 13 10:47:44 2012 @@ -214,6 +214,7 @@ IF->PointToPoint.Type = IP_ADDRESS_V4; IF->Netmask.Type = IP_ADDRESS_V4; IF->Broadcast.Type = IP_ADDRESS_V4; + IF->StaticRouter.Type = IP_ADDRESS_V4; TcpipInitializeSpinLock(&IF->Lock);
12 years, 11 months
1
0
0
0
[cgutman] 54933: [DHCPCSVC] - Fix an issue assigning a private address after the IpReleaseAddress API was used prior to IpRenewAddress - Move the IP refresh hack into dhcpcsvc so it now properly re...
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Jan 13 10:03:38 2012 New Revision: 54933 URL:
http://svn.reactos.org/svn/reactos?rev=54933&view=rev
Log: [DHCPCSVC] - Fix an issue assigning a private address after the IpReleaseAddress API was used prior to IpRenewAddress - Move the IP refresh hack into dhcpcsvc so it now properly refresh IP information after an adapter is disconnected and reconnected (wired and wireless) - When a state change occurs (connecting to a different wireless network or unplugging and plugging in the Ethernet cable), TCP/IP will flush routes and the neighbor cache then set the IP address to 0.0.0.0. DHCP will detect that IP address (that part is the hack since we do it via polling instead of events) then send a DHCP discover packet out via the new network connection. No more ipconfig /renew to get a new DHCP lease after network changes. It's all seamless now :D Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dhclient.c Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] Fri Jan 13 10:03:38 2012 @@ -200,6 +200,84 @@ return 0; } +BOOL +IsReconnectHackNeeded(PDHCP_ADAPTER Adapter, const MIB_IFROW* IfEntry) +{ + struct protocol *proto; + PIP_ADAPTER_INFO AdapterInfo, Orig; + DWORD Size, Ret; + char *ZeroAddress = "0.0.0.0"; + + proto = find_protocol_by_adapter(&Adapter->DhclientInfo); + + if (!proto) + return FALSE; + + if (Adapter->DhclientInfo.client->state != S_BOUND) + return FALSE; + + ApiUnlock(); + + Orig = AdapterInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(IP_ADAPTER_INFO)); + Size = sizeof(IP_ADAPTER_INFO); + if (!AdapterInfo) + { + ApiLock(); + return FALSE; + } + + Ret = GetAdaptersInfo(AdapterInfo, &Size); + if (Ret == ERROR_BUFFER_OVERFLOW) + { + HeapFree(GetProcessHeap(), 0, AdapterInfo); + AdapterInfo = HeapAlloc(GetProcessHeap(), 0, Size); + if (!AdapterInfo) + { + ApiLock(); + return FALSE; + } + + if (GetAdaptersInfo(AdapterInfo, &Size) != NO_ERROR) + { + ApiLock(); + return FALSE; + } + + Orig = AdapterInfo; + for (; AdapterInfo != NULL; AdapterInfo = AdapterInfo->Next) + { + if (AdapterInfo->Index == IfEntry->dwIndex) + break; + } + + if (AdapterInfo == NULL) + { + HeapFree(GetProcessHeap(), 0, Orig); + ApiLock(); + return FALSE; + } + } + else if (Ret != NO_ERROR) + { + HeapFree(GetProcessHeap(), 0, Orig); + ApiLock(); + return FALSE; + } + + if (!strcmp(AdapterInfo->IpAddressList.IpAddress.String, ZeroAddress)) + { + HeapFree(GetProcessHeap(), 0, Orig); + ApiLock(); + return TRUE; + } + else + { + HeapFree(GetProcessHeap(), 0, Orig); + ApiLock(); + return FALSE; + } +} + /* * XXX Figure out the way to bind a specific adapter to a socket. */ @@ -241,12 +319,34 @@ if ((Adapter = AdapterFindByHardwareAddress(Table->table[i].bPhysAddr, Table->table[i].dwPhysAddrLen))) { + proto = find_protocol_by_adapter(&Adapter->DhclientInfo); + /* This is an existing adapter */ if (InterfaceConnected(&Table->table[i])) { /* We're still active so we stay in the list */ ifi = &Adapter->DhclientInfo; + + /* This is a hack because IP helper API sucks */ + if (IsReconnectHackNeeded(Adapter, &Table->table[i])) + { + /* This handles a disconnect/reconnect */ + + remove_protocol(proto); + Adapter->DhclientInfo.client->state = S_INIT; + + /* These are already invalid since the media state change */ + Adapter->RouterMib.dwForwardNextHop = 0; + Adapter->NteContext = 0; + + add_protocol(Adapter->DhclientInfo.name, + Adapter->DhclientInfo.rfdesc, + got_one, &Adapter->DhclientInfo); + state_init(&Adapter->DhclientInfo); + + SetEvent(AdapterStateChangedEvent); + } + } else { - proto = find_protocol_by_adapter(&Adapter->DhclientInfo); if (proto) remove_protocol(proto); Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c [iso-8859-1] Fri Jan 13 10:03:38 2012 @@ -101,9 +101,15 @@ if( Adapter ) { if (Adapter->NteContext) + { DeleteIPAddress( Adapter->NteContext ); + Adapter->NteContext = 0; + } if (Adapter->RouterMib.dwForwardNextHop) + { DeleteIpForwardEntry( &Adapter->RouterMib ); + Adapter->RouterMib.dwForwardNextHop = 0; + } proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); if (proto) @@ -171,9 +177,15 @@ if( Adapter ) { if (Adapter->NteContext) + { DeleteIPAddress( Adapter->NteContext ); + Adapter->NteContext = 0; + } if (Adapter->RouterMib.dwForwardNextHop) + { DeleteIpForwardEntry( &Adapter->RouterMib ); + Adapter->RouterMib.dwForwardNextHop = 0; + } Adapter->DhclientState.state = S_STATIC; proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dhclient.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dhclient.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dhclient.c [iso-8859-1] Fri Jan 13 10:03:38 2012 @@ -548,7 +548,10 @@ if( Adapter->NteContext ) + { DeleteIPAddress( Adapter->NteContext ); + Adapter->NteContext = 0; + } /* Set up our default router if we got one from the DHCP server */ if( new_lease->options[DHO_SUBNET_MASK].len ) { @@ -1007,7 +1010,7 @@ we haven't found anything for this interface yet. */ if (interval > ip->client->config->timeout) { state_panic(ip); - return; + ip->client->first_sending = cur_time; } /* If we're selecting media, try the whole list before doing @@ -1100,16 +1103,8 @@ { struct interface_info *ip = ipp; PDHCP_ADAPTER Adapter = AdapterFindInfo(ip); - time_t cur_time; - - time(&cur_time); note("No DHCPOFFERS received."); - - note("No working leases in persistent database - sleeping.\n"); - ip->client->state = S_INIT; - add_timeout(cur_time + ip->client->config->retry_interval, state_init, - ip); if (!Adapter->NteContext) { @@ -1181,7 +1176,10 @@ discover a new address. */ if( Adapter ) + { DeleteIPAddress( Adapter->NteContext ); + Adapter->NteContext = 0; + } ip->client->state = S_INIT; state_init(ip);
12 years, 11 months
1
0
0
0
[cgutman] 54932: [TCPIP] - Missed this file in r54930
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Jan 13 09:45:17 2012 New Revision: 54932 URL:
http://svn.reactos.org/svn/reactos?rev=54932&view=rev
Log: [TCPIP] - Missed this file in r54930 Modified: branches/wlan-bringup/drivers/network/tcpip/include/ip.h Modified: branches/wlan-bringup/drivers/network/tcpip/include/ip.h URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/include/ip.h [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/include/ip.h [iso-8859-1] Fri Jan 13 09:45:17 2012 @@ -156,10 +156,12 @@ UINT MinFrameSize; /* Minimum frame size in bytes */ UINT MTU; /* Maximum transmission unit */ UINT Speed; /* Link speed */ - IP_ADDRESS Unicast; /* Unicast address */ - IP_ADDRESS PointToPoint; /* Point to point address */ - IP_ADDRESS Netmask; /* Netmask */ + IP_ADDRESS Unicast, StaticUnicast;/* Unicast address */ + IP_ADDRESS PointToPoint, StaticPointToPoint;/* Point to point address */ + IP_ADDRESS Netmask, StaticNetmask;/* Netmask */ IP_ADDRESS Broadcast; /* Broadcast */ + IP_ADDRESS StaticRouter; /* Static default route */ + BOOLEAN DhcpEnabled; /* DHCP enabled */ UNICODE_STRING Name; /* Adapter name (GUID) */ UNICODE_STRING Description; /* Adapter description (Human readable) */ PUCHAR Address; /* Pointer to interface address */
12 years, 11 months
1
0
0
0
[cgutman] 54931: [WLANCONF] - Don't manually refresh IP information when connecting to a network
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Jan 13 09:43:16 2012 New Revision: 54931 URL:
http://svn.reactos.org/svn/reactos?rev=54931&view=rev
Log: [WLANCONF] - Don't manually refresh IP information when connecting to a network Modified: branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c Modified: branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/base/applications/…
============================================================================== --- branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c [iso-8859-1] (original) +++ branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c [iso-8859-1] Fri Jan 13 09:43:16 2012 @@ -563,7 +563,7 @@ } BOOL -WlanConnect(HANDLE hAdapter, PIP_ADAPTER_INDEX_MAP IpInfo) +WlanConnect(HANDLE hAdapter) { BOOL bSuccess; DWORD dwBytesReturned, SetOidSize; @@ -725,10 +725,6 @@ if (!bSuccess) return FALSE; - - /* Update our IP address */ - IpReleaseAddress(IpInfo); - IpRenewAddress(IpInfo); _tprintf(_T("The operation completed successfully.\n")); return TRUE; @@ -943,7 +939,7 @@ } else if (bConnect) { - if (!WlanConnect(hAdapter, &IpInfo)) + if (!WlanConnect(hAdapter)) { DoFormatMessage(GetLastError()); CloseHandle(hAdapter);
12 years, 11 months
1
0
0
0
[cgutman] 54930: [TCPIP] - Fix crash during status indication
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Jan 13 09:05:53 2012 New Revision: 54930 URL:
http://svn.reactos.org/svn/reactos?rev=54930&view=rev
Log: [TCPIP] - Fix crash during status indication Modified: branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c branches/wlan-bringup/drivers/network/tcpip/tcpip/dispatch.c Modified: branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Fri Jan 13 09:05:53 2012 @@ -555,12 +555,8 @@ TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); } - -BOOLEAN ReconfigureAdapter(PLAN_ADAPTER Adapter, BOOLEAN FinishedReset) -{ - PIP_INTERFACE Interface = Adapter->Context; - NDIS_STATUS NdisStatus; - IP_ADDRESS DefaultMask, Router; +BOOLEAN ReadIpConfiguration(PIP_INTERFACE Interface) +{ OBJECT_ATTRIBUTES ObjectAttributes; HANDLE ParameterHandle; PKEY_VALUE_PARTIAL_INFORMATION KeyValueInfo; @@ -576,139 +572,152 @@ ULONG Unused; NTSTATUS Status; + TcpipRegistryPath.MaximumLength = sizeof(WCHAR) * 150; + TcpipRegistryPath.Length = 0; + TcpipRegistryPath.Buffer = Buffer; + + /* Build the registry path */ + RtlAppendUnicodeStringToString(&TcpipRegistryPath, &Prefix); + RtlAppendUnicodeStringToString(&TcpipRegistryPath, &Interface->Name); + + InitializeObjectAttributes(&ObjectAttributes, + &TcpipRegistryPath, + OBJ_CASE_INSENSITIVE, + 0, + NULL); + + /* Open a handle to the adapter parameters */ + Status = ZwOpenKey(&ParameterHandle, KEY_READ, &ObjectAttributes); + + if (!NT_SUCCESS(Status)) + { + Interface->DhcpEnabled = TRUE; + return TRUE; + } + else + { + KeyValueInfo = ExAllocatePool(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR)); + if (!KeyValueInfo) + { + ZwClose(ParameterHandle); + return FALSE; + } + + /* Read the EnableDHCP entry */ + Status = ZwQueryValueKey(ParameterHandle, + &EnableDhcp, + KeyValuePartialInformation, + KeyValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG), + &Unused); + if (NT_SUCCESS(Status) && KeyValueInfo->DataLength == sizeof(ULONG) && (*(PULONG)KeyValueInfo->Data) == 0) + { + RegistryDataU.MaximumLength = 16 + sizeof(WCHAR); + RegistryDataU.Buffer = (PWCHAR)KeyValueInfo->Data; + + /* Read the IP address */ + Status = ZwQueryValueKey(ParameterHandle, + &IPAddress, + KeyValuePartialInformation, + KeyValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), + &Unused); + if (NT_SUCCESS(Status)) + { + RegistryDataU.Length = KeyValueInfo->DataLength; + + RtlUnicodeStringToAnsiString(&RegistryDataA, + &RegistryDataU, + TRUE); + + AddrInitIPv4(&Interface->StaticUnicast, inet_addr(RegistryDataA.Buffer)); + + RtlFreeAnsiString(&RegistryDataA); + + } + + Status = ZwQueryValueKey(ParameterHandle, + &Netmask, + KeyValuePartialInformation, + KeyValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), + &Unused); + if (NT_SUCCESS(Status)) + { + RegistryDataU.Length = KeyValueInfo->DataLength; + + RtlUnicodeStringToAnsiString(&RegistryDataA, + &RegistryDataU, + TRUE); + + AddrInitIPv4(&Interface->StaticNetmask, inet_addr(RegistryDataA.Buffer)); + + RtlFreeAnsiString(&RegistryDataA); + } + + /* Read default gateway info */ + Status = ZwQueryValueKey(ParameterHandle, + &Gateway, + KeyValuePartialInformation, + KeyValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), + &Unused); + if (NT_SUCCESS(Status)) + { + RegistryDataU.Length = KeyValueInfo->DataLength; + + RtlUnicodeStringToAnsiString(&RegistryDataA, + &RegistryDataU, + TRUE); + + AddrInitIPv4(&Interface->StaticRouter, inet_addr(RegistryDataA.Buffer)); + + RtlFreeAnsiString(&RegistryDataA); + } + + Interface->DhcpEnabled = FALSE; + } + else + { + Interface->DhcpEnabled = TRUE; + } + + ZwClose(ParameterHandle); + } + + return TRUE; +} + +BOOLEAN ReconfigureAdapter(PLAN_ADAPTER Adapter, BOOLEAN FinishedReset) +{ + PIP_INTERFACE Interface = Adapter->Context; + //NDIS_STATUS NdisStatus; + IP_ADDRESS DefaultMask; + /* Initalize the default unspecified address (0.0.0.0) */ AddrInitIPv4(&DefaultMask, 0); if (Adapter->State == LAN_STATE_STARTED && !FinishedReset) { - TcpipRegistryPath.MaximumLength = sizeof(WCHAR) * 150; - TcpipRegistryPath.Length = 0; - TcpipRegistryPath.Buffer = Buffer; - - /* Build the registry path */ - RtlAppendUnicodeStringToString(&TcpipRegistryPath, &Prefix); - RtlAppendUnicodeStringToString(&TcpipRegistryPath, &Interface->Name); - - InitializeObjectAttributes(&ObjectAttributes, - &TcpipRegistryPath, - OBJ_CASE_INSENSITIVE, - 0, - NULL); - - /* Open a handle to the adapter parameters */ - Status = ZwOpenKey(&ParameterHandle, KEY_READ, &ObjectAttributes); - - if (!NT_SUCCESS(Status)) + /* Set the static IP configuration */ + if (!Interface->DhcpEnabled) { - /* Just use defaults if the open fails for some reason */ - Interface->Unicast = DefaultMask; - Interface->Netmask = DefaultMask; + /* Reset the IP information */ + Interface->Unicast = Interface->StaticUnicast; + Interface->Netmask = Interface->StaticNetmask; + + /* Compute the broadcast address */ + Interface->Broadcast.Type = IP_ADDRESS_V4; + Interface->Broadcast.Address.IPv4Address = Interface->Unicast.Address.IPv4Address | + ~Interface->Netmask.Address.IPv4Address; + + /* Add the default route */ + if (!AddrIsUnspecified(&Interface->StaticRouter)) + RouterCreateRoute(&DefaultMask, &DefaultMask, &Interface->StaticRouter, Interface, 1); + + /* Add the interface route for a static IP */ + if (!AddrIsUnspecified(&Interface->Unicast)) + IPAddInterfaceRoute(Interface); } - else - { - KeyValueInfo = ExAllocatePool(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR)); - if (!KeyValueInfo) - { - ZwClose(ParameterHandle); - return FALSE; - } - - /* Read the EnableDHCP entry */ - Status = ZwQueryValueKey(ParameterHandle, - &EnableDhcp, - KeyValuePartialInformation, - KeyValueInfo, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG), - &Unused); - if (NT_SUCCESS(Status) && KeyValueInfo->DataLength == sizeof(ULONG) && (*(PULONG)KeyValueInfo->Data) == 0) - { - RegistryDataU.MaximumLength = 16 + sizeof(WCHAR); - RegistryDataU.Buffer = (PWCHAR)KeyValueInfo->Data; - - /* Read the IP address */ - Status = ZwQueryValueKey(ParameterHandle, - &IPAddress, - KeyValuePartialInformation, - KeyValueInfo, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), - &Unused); - if (NT_SUCCESS(Status)) - { - RegistryDataU.Length = KeyValueInfo->DataLength; - - RtlUnicodeStringToAnsiString(&RegistryDataA, - &RegistryDataU, - TRUE); - - AddrInitIPv4(&Interface->Unicast, inet_addr(RegistryDataA.Buffer)); - - RtlFreeAnsiString(&RegistryDataA); - - } - else - { - Interface->Unicast = DefaultMask; - } - - Status = ZwQueryValueKey(ParameterHandle, - &Netmask, - KeyValuePartialInformation, - KeyValueInfo, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), - &Unused); - if (NT_SUCCESS(Status)) - { - RegistryDataU.Length = KeyValueInfo->DataLength; - - RtlUnicodeStringToAnsiString(&RegistryDataA, - &RegistryDataU, - TRUE); - - AddrInitIPv4(&Interface->Netmask, inet_addr(RegistryDataA.Buffer)); - - RtlFreeAnsiString(&RegistryDataA); - } - else - { - Interface->Netmask = DefaultMask; - } - - /* Read default gateway info */ - Status = ZwQueryValueKey(ParameterHandle, - &Gateway, - KeyValuePartialInformation, - KeyValueInfo, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), - &Unused); - if (NT_SUCCESS(Status)) - { - RegistryDataU.Length = KeyValueInfo->DataLength; - - RtlUnicodeStringToAnsiString(&RegistryDataA, - &RegistryDataU, - TRUE); - - AddrInitIPv4(&Router, inet_addr(RegistryDataA.Buffer)); - - RtlFreeAnsiString(&RegistryDataA); - - /* Create the default route */ - if (!AddrIsUnspecified(&Router)) RouterCreateRoute(&DefaultMask, &DefaultMask, &Router, Interface, 1); - } - } - else - { - Interface->Unicast = DefaultMask; - Interface->Netmask = DefaultMask; - } - - ZwClose(ParameterHandle); - } - - /* Compute the broadcast address */ - Interface->Broadcast.Type = IP_ADDRESS_V4; - Interface->Broadcast.Address.IPv4Address = - Interface->Unicast.Address.IPv4Address | - ~Interface->Netmask.Address.IPv4Address; } else if (!FinishedReset) { @@ -726,7 +735,9 @@ /* We're done here if the adapter isn't connected */ if (Adapter->State != LAN_STATE_STARTED) return TRUE; - + + /* NDIS Bug! */ +#if 0 /* Get maximum link speed */ NdisStatus = NDISCall(Adapter, NdisRequestQueryInformation, @@ -758,11 +769,8 @@ sizeof(UINT)); if (NdisStatus != NDIS_STATUS_SUCCESS) return FALSE; - - /* Add the interface for a static IP */ - if (!AddrIsUnspecified(&Interface->Unicast)) - IPAddInterfaceRoute(Interface); - +#endif + return TRUE; } @@ -792,19 +800,18 @@ if (Adapter->State == LAN_STATE_STARTED) break; + Adapter->OldState = Adapter->State; Adapter->State = LAN_STATE_STARTED; - ReconfigureAdapter(Adapter, FALSE); - break; case NDIS_STATUS_MEDIA_DISCONNECT: DbgPrint("NDIS_STATUS_MEDIA_DISCONNECT\n"); - + if (Adapter->State == LAN_STATE_STOPPED) break; - + + Adapter->OldState = Adapter->State; Adapter->State = LAN_STATE_STOPPED; - ReconfigureAdapter(Adapter, FALSE); break; case NDIS_STATUS_RESET_START: @@ -815,12 +822,29 @@ case NDIS_STATUS_RESET_END: Adapter->State = Adapter->OldState; - ReconfigureAdapter(Adapter, TRUE); break; default: DbgPrint("Unhandled status: %x", GeneralStatus); break; + } +} + +VOID NTAPI ProtocolStatusComplete(NDIS_HANDLE NdisBindingContext) +/* + * FUNCTION: Called by NDIS when a status-change has occurred + * ARGUMENTS: + * BindingContext = Pointer to a device context (LAN_ADAPTER) + */ +{ + PLAN_ADAPTER Adapter = NdisBindingContext; + + TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); + + if (Adapter->State != LAN_STATE_RESETTING) + { + ReconfigureAdapter(Adapter, + (Adapter->State == Adapter->OldState)); } } @@ -851,17 +875,6 @@ DbgPrint("Unhandled event type: %ld\n", PnPEvent->NetEvent); return NDIS_STATUS_SUCCESS; } -} - -VOID NTAPI ProtocolStatusComplete( - NDIS_HANDLE NdisBindingContext) -/* - * FUNCTION: Called by NDIS when a status-change has occurred - * ARGUMENTS: - * BindingContext = Pointer to a device context (LAN_ADAPTER) - */ -{ - TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); } VOID NTAPI ProtocolBindAdapter( @@ -1312,12 +1325,47 @@ TI_DbgPrint(DEBUG_DATALINK,("Adapter Description: %wZ\n", &IF->Description)); + /* Get maximum link speed */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_LINK_SPEED, + &IF->Speed, + sizeof(UINT)); + + if (!NT_SUCCESS(NdisStatus)) + IF->Speed = IP_DEFAULT_LINK_SPEED; + + Adapter->Speed = IF->Speed * 100L; + + /* Get maximum frame size */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_MAXIMUM_FRAME_SIZE, + &Adapter->MTU, + sizeof(UINT)); + if (NdisStatus != NDIS_STATUS_SUCCESS) + return FALSE; + + IF->MTU = Adapter->MTU; + + /* Get maximum packet size */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_MAXIMUM_TOTAL_SIZE, + &Adapter->MaxPacketSize, + sizeof(UINT)); + if (NdisStatus != NDIS_STATUS_SUCCESS) + return FALSE; + /* Register interface with IP layer */ IPRegisterInterface(IF); /* Set adapter state */ Adapter->State = LAN_STATE_STARTED; Adapter->Context = IF; + + /* Read adapter IP configuration */ + ReadIpConfiguration(IF); /* Configure the adapter */ ReconfigureAdapter(Adapter, FALSE); Modified: branches/wlan-bringup/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Fri Jan 13 09:05:53 2012 @@ -1552,8 +1552,12 @@ IF->Unicast.Type = IP_ADDRESS_V4; IF->Unicast.Address.IPv4Address = IpAddrChange->Address; + IF->StaticUnicast = IF->Unicast; + IF->Netmask.Type = IP_ADDRESS_V4; IF->Netmask.Address.IPv4Address = IpAddrChange->Netmask; + IF->StaticNetmask = IF->Netmask; + IF->Broadcast.Type = IP_ADDRESS_V4; IF->Broadcast.Address.IPv4Address = IF->Unicast.Address.IPv4Address | @@ -1587,8 +1591,12 @@ IPRemoveInterfaceRoute( IF ); IF->Unicast.Type = IP_ADDRESS_V4; IF->Unicast.Address.IPv4Address = 0; + IF->StaticUnicast = IF->Unicast; + IF->Netmask.Type = IP_ADDRESS_V4; IF->Netmask.Address.IPv4Address = 0; + IF->StaticNetmask = IF->StaticNetmask; + IF->Broadcast.Type = IP_ADDRESS_V4; IF->Broadcast.Address.IPv4Address = 0; Status = STATUS_SUCCESS;
12 years, 11 months
1
0
0
0
[cgutman] 54929: [TCPIP] - Support media state changes properly
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Jan 13 07:28:16 2012 New Revision: 54929 URL:
http://svn.reactos.org/svn/reactos?rev=54929&view=rev
Log: [TCPIP] - Support media state changes properly Modified: branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c branches/wlan-bringup/drivers/network/tcpip/include/ip.h branches/wlan-bringup/drivers/network/tcpip/include/lan.h branches/wlan-bringup/drivers/network/tcpip/include/neighbor.h branches/wlan-bringup/drivers/network/tcpip/include/router.h branches/wlan-bringup/lib/drivers/ip/network/ip.c branches/wlan-bringup/lib/drivers/ip/network/loopback.c branches/wlan-bringup/lib/drivers/ip/network/neighbor.c branches/wlan-bringup/lib/drivers/ip/network/router.c Modified: branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -556,6 +556,216 @@ } +BOOLEAN ReconfigureAdapter(PLAN_ADAPTER Adapter, BOOLEAN FinishedReset) +{ + PIP_INTERFACE Interface = Adapter->Context; + NDIS_STATUS NdisStatus; + IP_ADDRESS DefaultMask, Router; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE ParameterHandle; + PKEY_VALUE_PARTIAL_INFORMATION KeyValueInfo; + WCHAR Buffer[150]; + UNICODE_STRING IPAddress = RTL_CONSTANT_STRING(L"IPAddress"); + UNICODE_STRING Netmask = RTL_CONSTANT_STRING(L"SubnetMask"); + UNICODE_STRING Gateway = RTL_CONSTANT_STRING(L"DefaultGateway"); + UNICODE_STRING EnableDhcp = RTL_CONSTANT_STRING(L"EnableDHCP"); + UNICODE_STRING Prefix = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\"); + UNICODE_STRING TcpipRegistryPath; + UNICODE_STRING RegistryDataU; + ANSI_STRING RegistryDataA; + ULONG Unused; + NTSTATUS Status; + + /* Initalize the default unspecified address (0.0.0.0) */ + AddrInitIPv4(&DefaultMask, 0); + if (Adapter->State == LAN_STATE_STARTED && !FinishedReset) + { + TcpipRegistryPath.MaximumLength = sizeof(WCHAR) * 150; + TcpipRegistryPath.Length = 0; + TcpipRegistryPath.Buffer = Buffer; + + /* Build the registry path */ + RtlAppendUnicodeStringToString(&TcpipRegistryPath, &Prefix); + RtlAppendUnicodeStringToString(&TcpipRegistryPath, &Interface->Name); + + InitializeObjectAttributes(&ObjectAttributes, + &TcpipRegistryPath, + OBJ_CASE_INSENSITIVE, + 0, + NULL); + + /* Open a handle to the adapter parameters */ + Status = ZwOpenKey(&ParameterHandle, KEY_READ, &ObjectAttributes); + + if (!NT_SUCCESS(Status)) + { + /* Just use defaults if the open fails for some reason */ + Interface->Unicast = DefaultMask; + Interface->Netmask = DefaultMask; + } + else + { + KeyValueInfo = ExAllocatePool(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR)); + if (!KeyValueInfo) + { + ZwClose(ParameterHandle); + return FALSE; + } + + /* Read the EnableDHCP entry */ + Status = ZwQueryValueKey(ParameterHandle, + &EnableDhcp, + KeyValuePartialInformation, + KeyValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG), + &Unused); + if (NT_SUCCESS(Status) && KeyValueInfo->DataLength == sizeof(ULONG) && (*(PULONG)KeyValueInfo->Data) == 0) + { + RegistryDataU.MaximumLength = 16 + sizeof(WCHAR); + RegistryDataU.Buffer = (PWCHAR)KeyValueInfo->Data; + + /* Read the IP address */ + Status = ZwQueryValueKey(ParameterHandle, + &IPAddress, + KeyValuePartialInformation, + KeyValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), + &Unused); + if (NT_SUCCESS(Status)) + { + RegistryDataU.Length = KeyValueInfo->DataLength; + + RtlUnicodeStringToAnsiString(&RegistryDataA, + &RegistryDataU, + TRUE); + + AddrInitIPv4(&Interface->Unicast, inet_addr(RegistryDataA.Buffer)); + + RtlFreeAnsiString(&RegistryDataA); + + } + else + { + Interface->Unicast = DefaultMask; + } + + Status = ZwQueryValueKey(ParameterHandle, + &Netmask, + KeyValuePartialInformation, + KeyValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), + &Unused); + if (NT_SUCCESS(Status)) + { + RegistryDataU.Length = KeyValueInfo->DataLength; + + RtlUnicodeStringToAnsiString(&RegistryDataA, + &RegistryDataU, + TRUE); + + AddrInitIPv4(&Interface->Netmask, inet_addr(RegistryDataA.Buffer)); + + RtlFreeAnsiString(&RegistryDataA); + } + else + { + Interface->Netmask = DefaultMask; + } + + /* Read default gateway info */ + Status = ZwQueryValueKey(ParameterHandle, + &Gateway, + KeyValuePartialInformation, + KeyValueInfo, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), + &Unused); + if (NT_SUCCESS(Status)) + { + RegistryDataU.Length = KeyValueInfo->DataLength; + + RtlUnicodeStringToAnsiString(&RegistryDataA, + &RegistryDataU, + TRUE); + + AddrInitIPv4(&Router, inet_addr(RegistryDataA.Buffer)); + + RtlFreeAnsiString(&RegistryDataA); + + /* Create the default route */ + if (!AddrIsUnspecified(&Router)) RouterCreateRoute(&DefaultMask, &DefaultMask, &Router, Interface, 1); + } + } + else + { + Interface->Unicast = DefaultMask; + Interface->Netmask = DefaultMask; + } + + ZwClose(ParameterHandle); + } + + /* Compute the broadcast address */ + Interface->Broadcast.Type = IP_ADDRESS_V4; + Interface->Broadcast.Address.IPv4Address = + Interface->Unicast.Address.IPv4Address | + ~Interface->Netmask.Address.IPv4Address; + } + else if (!FinishedReset) + { + /* Clear IP configuration */ + Interface->Unicast = DefaultMask; + Interface->Netmask = DefaultMask; + Interface->Broadcast = DefaultMask; + + /* Remove all interface routes */ + RouterRemoveRoutesForInterface(Interface); + + /* Destroy all cached neighbors */ + NBDestroyNeighborsForInterface(Interface); + } + + /* We're done here if the adapter isn't connected */ + if (Adapter->State != LAN_STATE_STARTED) return TRUE; + + /* Get maximum link speed */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_LINK_SPEED, + &Interface->Speed, + sizeof(UINT)); + + if (!NT_SUCCESS(NdisStatus)) + Interface->Speed = IP_DEFAULT_LINK_SPEED; + + Adapter->Speed = Interface->Speed * 100L; + + /* Get maximum frame size */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_MAXIMUM_FRAME_SIZE, + &Adapter->MTU, + sizeof(UINT)); + if (NdisStatus != NDIS_STATUS_SUCCESS) + return FALSE; + + Interface->MTU = Adapter->MTU; + + /* Get maximum packet size */ + NdisStatus = NDISCall(Adapter, + NdisRequestQueryInformation, + OID_GEN_MAXIMUM_TOTAL_SIZE, + &Adapter->MaxPacketSize, + sizeof(UINT)); + if (NdisStatus != NDIS_STATUS_SUCCESS) + return FALSE; + + /* Add the interface for a static IP */ + if (!AddrIsUnspecified(&Interface->Unicast)) + IPAddInterfaceRoute(Interface); + + return TRUE; +} + VOID NTAPI ProtocolStatus( NDIS_HANDLE BindingContext, NDIS_STATUS GeneralStatus, @@ -576,25 +786,41 @@ switch(GeneralStatus) { - case NDIS_STATUS_MEDIA_CONNECT: - DbgPrint("NDIS_STATUS_MEDIA_CONNECT\n"); - break; - - case NDIS_STATUS_MEDIA_DISCONNECT: - DbgPrint("NDIS_STATUS_MEDIA_DISCONNECT\n"); - break; - - case NDIS_STATUS_RESET_START: - Adapter->State = LAN_STATE_RESETTING; - break; - - case NDIS_STATUS_RESET_END: - Adapter->State = LAN_STATE_STARTED; - break; - - default: - DbgPrint("Unhandled status: %x", GeneralStatus); - break; + case NDIS_STATUS_MEDIA_CONNECT: + DbgPrint("NDIS_STATUS_MEDIA_CONNECT\n"); + + if (Adapter->State == LAN_STATE_STARTED) + break; + + Adapter->State = LAN_STATE_STARTED; + ReconfigureAdapter(Adapter, FALSE); + + break; + + case NDIS_STATUS_MEDIA_DISCONNECT: + DbgPrint("NDIS_STATUS_MEDIA_DISCONNECT\n"); + + if (Adapter->State == LAN_STATE_STOPPED) + break; + + Adapter->State = LAN_STATE_STOPPED; + ReconfigureAdapter(Adapter, FALSE); + break; + + case NDIS_STATUS_RESET_START: + Adapter->OldState = Adapter->State; + Adapter->State = LAN_STATE_RESETTING; + /* Nothing else to do here */ + break; + + case NDIS_STATUS_RESET_END: + Adapter->State = Adapter->OldState; + ReconfigureAdapter(Adapter, TRUE); + break; + + default: + DbgPrint("Unhandled status: %x", GeneralStatus); + break; } } @@ -1033,21 +1259,8 @@ PIP_INTERFACE IF; NDIS_STATUS NdisStatus; LLIP_BIND_INFO BindInfo; - IP_ADDRESS DefaultMask, Router; - ULONG Lookahead = LOOKAHEAD_SIZE, Unused; + ULONG Lookahead = LOOKAHEAD_SIZE; NTSTATUS Status; - OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE ParameterHandle; - PKEY_VALUE_PARTIAL_INFORMATION KeyValueInfo; - WCHAR Buffer[150]; - UNICODE_STRING IPAddress = RTL_CONSTANT_STRING(L"IPAddress"); - UNICODE_STRING Netmask = RTL_CONSTANT_STRING(L"SubnetMask"); - UNICODE_STRING Gateway = RTL_CONSTANT_STRING(L"DefaultGateway"); - UNICODE_STRING EnableDhcp = RTL_CONSTANT_STRING(L"EnableDHCP"); - UNICODE_STRING Prefix = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\"); - UNICODE_STRING TcpipRegistryPath; - UNICODE_STRING RegistryDataU; - ANSI_STRING RegistryDataA; TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); @@ -1067,7 +1280,6 @@ BindInfo.Context = Adapter; BindInfo.HeaderSize = Adapter->HeaderSize; BindInfo.MinFrameSize = Adapter->MinFrameSize; - BindInfo.MTU = Adapter->MTU; BindInfo.Address = (PUCHAR)&Adapter->HWAddress; BindInfo.AddressLength = Adapter->HWAddressLength; BindInfo.Transmit = LANTransmit; @@ -1100,148 +1312,15 @@ TI_DbgPrint(DEBUG_DATALINK,("Adapter Description: %wZ\n", &IF->Description)); - TcpipRegistryPath.MaximumLength = sizeof(WCHAR) * 150; - TcpipRegistryPath.Length = 0; - TcpipRegistryPath.Buffer = Buffer; - - RtlAppendUnicodeStringToString(&TcpipRegistryPath, - &Prefix); - - RtlAppendUnicodeStringToString(&TcpipRegistryPath, - &IF->Name); - - InitializeObjectAttributes(&ObjectAttributes, - &TcpipRegistryPath, - OBJ_CASE_INSENSITIVE, - 0, - NULL); - - AddrInitIPv4(&DefaultMask, 0); - - Status = ZwOpenKey(&ParameterHandle, KEY_READ, &ObjectAttributes); - - if (!NT_SUCCESS(Status)) - { - IF->Unicast = DefaultMask; - IF->Netmask = DefaultMask; - } - else - { - KeyValueInfo = ExAllocatePool(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR)); - if (!KeyValueInfo) - { - ZwClose(ParameterHandle); - IPDestroyInterface(IF); - return FALSE; - } - - Status = ZwQueryValueKey(ParameterHandle, - &EnableDhcp, - KeyValuePartialInformation, - KeyValueInfo, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG), - &Unused); - if (NT_SUCCESS(Status) && KeyValueInfo->DataLength == sizeof(ULONG) && (*(PULONG)KeyValueInfo->Data) == 0) - { - RegistryDataU.MaximumLength = 16 + sizeof(WCHAR); - RegistryDataU.Buffer = (PWCHAR)KeyValueInfo->Data; - - Status = ZwQueryValueKey(ParameterHandle, - &IPAddress, - KeyValuePartialInformation, - KeyValueInfo, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), - &Unused); - if (NT_SUCCESS(Status)) - { - RegistryDataU.Length = KeyValueInfo->DataLength; - - RtlUnicodeStringToAnsiString(&RegistryDataA, - &RegistryDataU, - TRUE); - - AddrInitIPv4(&IF->Unicast, inet_addr(RegistryDataA.Buffer)); - - RtlFreeAnsiString(&RegistryDataA); - - } - else - { - IF->Unicast = DefaultMask; - } - - Status = ZwQueryValueKey(ParameterHandle, - &Netmask, - KeyValuePartialInformation, - KeyValueInfo, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), - &Unused); - if (NT_SUCCESS(Status)) - { - RegistryDataU.Length = KeyValueInfo->DataLength; - - RtlUnicodeStringToAnsiString(&RegistryDataA, - &RegistryDataU, - TRUE); - - AddrInitIPv4(&IF->Netmask, inet_addr(RegistryDataA.Buffer)); - - RtlFreeAnsiString(&RegistryDataA); - } - else - { - IF->Netmask = DefaultMask; - } - - Status = ZwQueryValueKey(ParameterHandle, - &Gateway, - KeyValuePartialInformation, - KeyValueInfo, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 16 * sizeof(WCHAR), - &Unused); - if (NT_SUCCESS(Status)) - { - RegistryDataU.Length = KeyValueInfo->DataLength; - - RtlUnicodeStringToAnsiString(&RegistryDataA, - &RegistryDataU, - TRUE); - - AddrInitIPv4(&Router, inet_addr(RegistryDataA.Buffer)); - - RtlFreeAnsiString(&RegistryDataA); - - if (!AddrIsUnspecified(&Router)) RouterCreateRoute(&DefaultMask, &DefaultMask, &Router, IF, 1); - } - } - else - { - IF->Unicast = DefaultMask; - IF->Netmask = DefaultMask; - } - - ZwClose(ParameterHandle); - } - - IF->Broadcast.Type = IP_ADDRESS_V4; - IF->Broadcast.Address.IPv4Address = - IF->Unicast.Address.IPv4Address | - ~IF->Netmask.Address.IPv4Address; - - TI_DbgPrint(DEBUG_DATALINK,("BCAST(IF) %s\n", A2S(&IF->Broadcast))); - - /* Get maximum link speed */ - NdisStatus = NDISCall(Adapter, - NdisRequestQueryInformation, - OID_GEN_LINK_SPEED, - &IF->Speed, - sizeof(UINT)); - - if( !NT_SUCCESS(NdisStatus) ) - IF->Speed = IP_DEFAULT_LINK_SPEED; - /* Register interface with IP layer */ IPRegisterInterface(IF); + + /* Set adapter state */ + Adapter->State = LAN_STATE_STARTED; + Adapter->Context = IF; + + /* Configure the adapter */ + ReconfigureAdapter(Adapter, FALSE); /* Set packet filter so we can send and receive packets */ NdisStatus = NDISCall(Adapter, @@ -1257,8 +1336,6 @@ return FALSE; } - Adapter->Context = IF; - Adapter->State = LAN_STATE_STARTED; return TRUE; } @@ -1301,7 +1378,6 @@ UINT MediaIndex; NDIS_MEDIUM MediaArray[MAX_MEDIA]; UINT AddressOID; - UINT Speed; TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); @@ -1372,30 +1448,6 @@ return NDIS_STATUS_NOT_SUPPORTED; } - /* Get maximum frame size */ - NdisStatus = NDISCall(IF, - NdisRequestQueryInformation, - OID_GEN_MAXIMUM_FRAME_SIZE, - &IF->MTU, - sizeof(UINT)); - if (NdisStatus != NDIS_STATUS_SUCCESS) { - TI_DbgPrint(DEBUG_DATALINK,("denying adapter %wZ (NDISCall)\n", AdapterName)); - ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); - return NdisStatus; - } - - /* Get maximum packet size */ - NdisStatus = NDISCall(IF, - NdisRequestQueryInformation, - OID_GEN_MAXIMUM_TOTAL_SIZE, - &IF->MaxPacketSize, - sizeof(UINT)); - if (NdisStatus != NDIS_STATUS_SUCCESS) { - TI_DbgPrint(MIN_TRACE, ("Query for maximum packet size failed.\n")); - ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); - return NdisStatus; - } - /* Get maximum number of packets we can pass to NdisSend(Packets) at one time */ NdisStatus = NDISCall(IF, NdisRequestQueryInformation, @@ -1418,21 +1470,6 @@ ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); return NdisStatus; } - - /* Get maximum link speed */ - NdisStatus = NDISCall(IF, - NdisRequestQueryInformation, - OID_GEN_LINK_SPEED, - &Speed, - sizeof(UINT)); - if (NdisStatus != NDIS_STATUS_SUCCESS) { - TI_DbgPrint(MIN_TRACE, ("Query for maximum link speed failed.\n")); - ExFreePoolWithTag(IF, LAN_ADAPTER_TAG); - return NdisStatus; - } - - /* Convert returned link speed to bps (it is in 100bps increments) */ - IF->Speed = Speed * 100L; /* Bind adapter to IP layer */ if( !BindAdapter(IF, RegistryPath) ) { Modified: branches/wlan-bringup/drivers/network/tcpip/include/ip.h URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/include/ip.h [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/include/ip.h [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -127,7 +127,6 @@ PVOID Context; /* Pointer to link layer context information */ UINT HeaderSize; /* Size of link level header */ UINT MinFrameSize; /* Minimum frame size in bytes */ - UINT MTU; /* Maximum transmission unit */ PUCHAR Address; /* Pointer to interface address */ UINT AddressLength; /* Length of address in bytes */ LL_TRANSMIT_ROUTINE Transmit; /* Transmit function for this interface */ Modified: branches/wlan-bringup/drivers/network/tcpip/include/lan.h URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/include/lan.h [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/include/lan.h [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -39,7 +39,7 @@ typedef struct LAN_ADAPTER { LIST_ENTRY ListEntry; /* Entry on list */ KSPIN_LOCK Lock; /* Lock for this structure */ - UCHAR State; /* State of the adapter */ + UCHAR State, OldState; /* State of the adapter */ KEVENT Event; /* Opening event */ PVOID Context; /* Upper layer context information */ NDIS_HANDLE NdisHandle; /* NDIS binding handle */ Modified: branches/wlan-bringup/drivers/network/tcpip/include/neighbor.h URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/include/neighbor.h [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/include/neighbor.h [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -105,4 +105,6 @@ VOID NBResetNeighborTimeout( PIP_ADDRESS Address); +VOID NBDestroyNeighborsForInterface(PIP_INTERFACE Interface); + /* EOF */ Modified: branches/wlan-bringup/drivers/network/tcpip/include/router.h URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
============================================================================== --- branches/wlan-bringup/drivers/network/tcpip/include/router.h [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/tcpip/include/router.h [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -43,6 +43,8 @@ NTSTATUS RouterShutdown( VOID); +VOID RouterRemoveRoutesForInterface(PIP_INTERFACE Interface); + UINT CountFIBs(PIP_INTERFACE IF); UINT CopyFIBs( PIP_INTERFACE IF, PFIB_ENTRY Target ); Modified: branches/wlan-bringup/lib/drivers/ip/network/ip.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/lib/drivers/ip/net…
============================================================================== --- branches/wlan-bringup/lib/drivers/ip/network/ip.c [iso-8859-1] (original) +++ branches/wlan-bringup/lib/drivers/ip/network/ip.c [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -206,7 +206,6 @@ IF->Context = BindInfo->Context; IF->HeaderSize = BindInfo->HeaderSize; IF->MinFrameSize = BindInfo->MinFrameSize; - IF->MTU = BindInfo->MTU; IF->Address = BindInfo->Address; IF->AddressLength = BindInfo->AddressLength; IF->Transmit = BindInfo->Transmit; @@ -314,11 +313,6 @@ IF->Index = ChosenIndex; - if (!AddrIsUnspecified(&IF->Unicast)) - { - IPAddInterfaceRoute(IF); - } - /* Add interface to the global interface list */ TcpipInterlockedInsertTailList(&InterfaceListHead, &IF->ListEntry, Modified: branches/wlan-bringup/lib/drivers/ip/network/loopback.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/lib/drivers/ip/net…
============================================================================== --- branches/wlan-bringup/lib/drivers/ip/network/loopback.c [iso-8859-1] (original) +++ branches/wlan-bringup/lib/drivers/ip/network/loopback.c [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -106,13 +106,14 @@ BindInfo.Context = NULL; BindInfo.HeaderSize = 0; BindInfo.MinFrameSize = 0; - BindInfo.MTU = 16384; BindInfo.Address = NULL; BindInfo.AddressLength = 0; BindInfo.Transmit = LoopTransmit; Loopback = IPCreateInterface(&BindInfo); if (!Loopback) return NDIS_STATUS_RESOURCES; + + Loopback->MTU = 16384; Loopback->Name.Buffer = L"Loopback"; Loopback->Name.MaximumLength = Loopback->Name.Length = @@ -123,6 +124,8 @@ AddrInitIPv4(&Loopback->Broadcast, LOOPBACK_BCASTADDR_IPv4); IPRegisterInterface(Loopback); + + IPAddInterfaceRoute(Loopback); TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); Modified: branches/wlan-bringup/lib/drivers/ip/network/neighbor.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/lib/drivers/ip/net…
============================================================================== --- branches/wlan-bringup/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original) +++ branches/wlan-bringup/lib/drivers/ip/network/neighbor.c [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -221,6 +221,42 @@ ARPTransmit(&NCE->Address, (NCE->State & NUD_INCOMPLETE) ? NULL : NCE->LinkAddress, NCE->Interface); +} + +VOID NBDestroyNeighborsForInterface(PIP_INTERFACE Interface) +{ + KIRQL OldIrql; + PNEIGHBOR_CACHE_ENTRY *PrevNCE; + PNEIGHBOR_CACHE_ENTRY NCE; + ULONG i; + + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + for (i = 0; i <= NB_HASHMASK; i++) + { + TcpipAcquireSpinLockAtDpcLevel(&NeighborCache[i].Lock); + + for (PrevNCE = &NeighborCache[i].Cache; + (NCE = *PrevNCE) != NULL;) + { + if (NCE->Interface == Interface) + { + /* Unlink and destroy the NCE */ + *PrevNCE = NCE->Next; + + NBFlushPacketQueue(NCE, NDIS_STATUS_REQUEST_ABORTED); + ExFreePoolWithTag(NCE, NCE_TAG); + + continue; + } + else + { + PrevNCE = &NCE->Next; + } + } + + TcpipReleaseSpinLockFromDpcLevel(&NeighborCache[i].Lock); + } + KeLowerIrql(OldIrql); } PNEIGHBOR_CACHE_ENTRY NBAddNeighbor( Modified: branches/wlan-bringup/lib/drivers/ip/network/router.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/lib/drivers/ip/net…
============================================================================== --- branches/wlan-bringup/lib/drivers/ip/network/router.c [iso-8859-1] (original) +++ branches/wlan-bringup/lib/drivers/ip/network/router.c [iso-8859-1] Fri Jan 13 07:28:16 2012 @@ -339,6 +339,29 @@ return NCE; } +VOID RouterRemoveRoutesForInterface(PIP_INTERFACE Interface) +{ + KIRQL OldIrql; + PLIST_ENTRY CurrentEntry; + PLIST_ENTRY NextEntry; + PFIB_ENTRY Current; + + TcpipAcquireSpinLock(&FIBLock, &OldIrql); + + CurrentEntry = FIBListHead.Flink; + while (CurrentEntry != &FIBListHead) { + NextEntry = CurrentEntry->Flink; + Current = CONTAINING_RECORD(CurrentEntry, FIB_ENTRY, ListEntry); + + if (Interface == Current->Router->Interface) + DestroyFIBE(Current); + + CurrentEntry = NextEntry; + } + + TcpipReleaseSpinLock(&FIBLock, OldIrql); +} + NTSTATUS RouterRemoveRoute(PIP_ADDRESS Target, PIP_ADDRESS Router) /* * FUNCTION: Removes a route from the Forward Information Base (FIB)
12 years, 11 months
1
0
0
0
[rharabien] 54928: [SHELL32] - Update file icon after rename operation See issue #6815 for more details.
by rharabien@svn.reactos.org
Author: rharabien Date: Thu Jan 12 22:26:50 2012 New Revision: 54928 URL:
http://svn.reactos.org/svn/reactos?rev=54928&view=rev
Log: [SHELL32] - Update file icon after rename operation See issue #6815 for more details. Modified: trunk/reactos/dll/win32/shell32/shlview.cpp Modified: trunk/reactos/dll/win32/shell32/shlview.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] Thu Jan 12 22:26:50 2012 @@ -775,9 +775,10 @@ SendMessageW(hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem); SHFree((LPITEMIDLIST)lvItem.lParam); - lvItem.mask = LVIF_PARAM; + lvItem.mask = LVIF_PARAM|LVIF_IMAGE; lvItem.iItem = nItem; lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidlNew)); /* set the item's data */ + lvItem.iImage = SHMapPIDLToSystemImageListIndex(pSFParent, pidlNew, 0); SendMessageW(hWndList, LVM_SETITEMW, 0, (LPARAM) &lvItem); SendMessageW(hWndList, LVM_UPDATE, nItem, 0); return TRUE; /* FIXME: better handling */ @@ -1783,9 +1784,11 @@ if (SUCCEEDED(hr) && pidl) { - lvItem.mask = LVIF_PARAM; + lvItem.mask = LVIF_PARAM|LVIF_IMAGE; lvItem.lParam = (LPARAM)pidl; + lvItem.iImage = SHMapPIDLToSystemImageListIndex(pSFParent, pidl, 0); SendMessageW(hWndList, LVM_SETITEMW, 0, (LPARAM) &lvItem); + SendMessageW(hWndList, LVM_UPDATE, lpdi->item.iItem, 0); return TRUE; }
12 years, 11 months
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
56
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
Results per page:
10
25
50
100
200