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
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
October 2012
----- 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
14 participants
211 discussions
Start a n
N
ew thread
[ekohl] 57601: [ADVAPI32] - Use LookupAccountNameW to retrieve the account SID when a user tries to log-on to a computer. - Little clean-up of LogonUserW. This is the first step to get rid of hard-...
by ekohl@svn.reactos.org
Author: ekohl Date: Tue Oct 23 21:59:43 2012 New Revision: 57601 URL:
http://svn.reactos.org/svn/reactos?rev=57601&view=rev
Log: [ADVAPI32] - Use LookupAccountNameW to retrieve the account SID when a user tries to log-on to a computer. - Little clean-up of LogonUserW. This is the first step to get rid of hard-coded logon stuff. Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Tue Oct 23 21:59:43 2012 @@ -310,53 +310,72 @@ GetUserSid(LPCWSTR UserName, PSID *Sid) { - PSID AccountDomainSid = NULL; - ULONG ulUserRid; - DWORD dwLength; - HKEY hNamesKey = NULL; - BOOL bResult = TRUE; - - if (!GetAccountDomainSid(&AccountDomainSid)) - { - return FALSE; - } - - /* Open the Users\Names key */ - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"SAM\\SAM\\Domains\\Account\\Users\\Names", - 0, - KEY_READ, - &hNamesKey)) - { - ERR("Failed to open Users\\Names key! (Error %lu)\n", GetLastError()); - bResult = FALSE; + PSID SidBuffer = NULL; + PWSTR DomainBuffer = NULL; + DWORD cbSidSize = 0; + DWORD cchDomSize = 0; + SID_NAME_USE Use; + BOOL res = TRUE; + + *Sid = NULL; + + LookupAccountNameW(NULL, + UserName, + NULL, + &cbSidSize, + NULL, + &cchDomSize, + &Use); + + if (cbSidSize == 0 || cchDomSize == 0) + return FALSE; + + SidBuffer = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + cbSidSize); + if (SidBuffer == NULL) + return FALSE; + + DomainBuffer = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + cchDomSize * sizeof(WCHAR)); + if (DomainBuffer == NULL) + { + res = FALSE; goto done; } - /* Read the user RID */ - dwLength = sizeof(ULONG); - if (RegQueryValueExW(hNamesKey, - UserName, - NULL, - NULL, - (LPBYTE)&ulUserRid, - &dwLength)) - { - ERR("Failed to read the SID! (Error %ld)\n", GetLastError()); - bResult = FALSE; + if (!LookupAccountNameW(NULL, + UserName, + SidBuffer, + &cbSidSize, + DomainBuffer, + &cchDomSize, + &Use)) + { + res = FALSE; goto done; } - *Sid = AppendRidToSid(AccountDomainSid, ulUserRid); + if (Use != SidTypeUser) + { + res = FALSE; + goto done; + } + + *Sid = SidBuffer; done: - if (hNamesKey != NULL) - RegCloseKey(hNamesKey); - - if (AccountDomainSid != NULL) - RtlFreeHeap(RtlGetProcessHeap(), 0, AccountDomainSid); - - return bResult; + if (DomainBuffer != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, DomainBuffer); + + if (res == FALSE) + { + if (SidBuffer != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, SidBuffer); + } + + return res; } @@ -593,8 +612,8 @@ TOKEN_USER TokenUser; TOKEN_OWNER TokenOwner; TOKEN_PRIMARY_GROUP TokenPrimaryGroup; - PTOKEN_GROUPS TokenGroups; - PTOKEN_PRIVILEGES TokenPrivileges; + PTOKEN_GROUPS TokenGroups = NULL; + PTOKEN_PRIVILEGES TokenPrivileges = NULL; TOKEN_DEFAULT_DACL TokenDefaultDacl; LARGE_INTEGER ExpirationTime; LUID AuthenticationId; @@ -603,10 +622,10 @@ PSID PrimaryGroupSid = NULL; PSID OwnerSid = NULL; PSID LocalSystemSid; - PACL Dacl; - NTSTATUS Status; + PACL Dacl = NULL; SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY}; unsigned i; + NTSTATUS Status = STATUS_SUCCESS; Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE); Qos.ImpersonationLevel = SecurityAnonymous; @@ -641,11 +660,10 @@ /* Allocate and initialize token groups */ TokenGroups = AllocateGroupSids(&PrimaryGroupSid, &OwnerSid); - if (NULL == TokenGroups) - { - RtlFreeSid(UserSid); - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; + if (TokenGroups == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; } /* Allocate and initialize token privileges */ @@ -653,12 +671,10 @@ sizeof(TOKEN_PRIVILEGES) + sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0]) * sizeof(LUID_AND_ATTRIBUTES)); - if (NULL == TokenPrivileges) - { - FreeGroupSids(TokenGroups); - RtlFreeSid(UserSid); - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; + if (TokenPrivileges == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; } TokenPrivileges->PrivilegeCount = 0; @@ -683,21 +699,13 @@ Dacl = RtlAllocateHeap(GetProcessHeap(), 0, 1024); if (Dacl == NULL) { - FreeGroupSids(TokenGroups); - RtlFreeSid(UserSid); - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; } Status = RtlCreateAcl(Dacl, 1024, ACL_REVISION); if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(GetProcessHeap(), 0, Dacl); - FreeGroupSids(TokenGroups); - RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); - RtlFreeSid(UserSid); - return FALSE; - } + goto done; RtlAddAccessAllowedAce(Dacl, ACL_REVISION, @@ -754,10 +762,18 @@ &TokenDefaultDacl, &TokenSource); - RtlFreeHeap(GetProcessHeap(), 0, Dacl); - FreeGroupSids(TokenGroups); - RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); - RtlFreeSid(UserSid); +done: + if (Dacl != NULL) + RtlFreeHeap(GetProcessHeap(), 0, Dacl); + + if (TokenGroups != NULL) + FreeGroupSids(TokenGroups); + + if (TokenPrivileges != NULL) + RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); + + if (UserSid != NULL) + RtlFreeHeap(GetProcessHeap(), 0, UserSid); return NT_SUCCESS(Status); }
12 years
1
0
0
0
[hbelusca] 57600: Synchronize with trunk's revision r57599.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Oct 23 19:54:03 2012 New Revision: 57600 URL:
http://svn.reactos.org/svn/reactos?rev=57600&view=rev
Log: Synchronize with trunk's revision r57599. Added: branches/ros-csrss/dll/win32/lsasrv/lookup.c - copied unchanged from r57599, trunk/reactos/dll/win32/lsasrv/lookup.c Removed: branches/ros-csrss/dll/win32/lsasrv/sids.c Modified: branches/ros-csrss/ (props changed) branches/ros-csrss/boot/bootdata/hivesys_amd64.inf branches/ros-csrss/boot/bootdata/hivesys_arm.inf branches/ros-csrss/boot/bootdata/hivesys_i386.inf branches/ros-csrss/dll/win32/lsasrv/CMakeLists.txt branches/ros-csrss/dll/win32/lsasrv/lsasrv.h branches/ros-csrss/dll/win32/samlib/samlib.c branches/ros-csrss/dll/win32/samlib/samlib.spec branches/ros-csrss/dll/win32/shell32/iconcache.cpp branches/ros-csrss/drivers/hid/hidparse/ (props changed) branches/ros-csrss/drivers/hid/hidparse/hidparse.c branches/ros-csrss/drivers/hid/mouhid/mouhid.c branches/ros-csrss/drivers/hid/mouhid/mouhid.h branches/ros-csrss/drivers/usb/usbd/usbd.c branches/ros-csrss/drivers/usb/usbhub/ (props changed) branches/ros-csrss/drivers/usb/usbhub/fdo.c branches/ros-csrss/drivers/usb/usbhub/pdo.c branches/ros-csrss/drivers/usb/usbhub/usbhub.h branches/ros-csrss/drivers/usb/usbstor/fdo.c branches/ros-csrss/drivers/usb/usbstor/pdo.c branches/ros-csrss/drivers/usb/usbstor/usbstor.h branches/ros-csrss/include/ddk/ntsam.h branches/ros-csrss/include/reactos/idl/sam.idl branches/ros-csrss/include/reactos/wine/unicode.h branches/ros-csrss/lib/drivers/hidparser/api.c branches/ros-csrss/lib/drivers/hidparser/hidparser.c branches/ros-csrss/lib/drivers/hidparser/hidparser.h branches/ros-csrss/lib/drivers/hidparser/parser.h branches/ros-csrss/ntoskrnl/include/internal/po.h branches/ros-csrss/ntoskrnl/io/iomgr/device.c branches/ros-csrss/ntoskrnl/po/povolume.c branches/ros-csrss/tools/widl/header.c branches/ros-csrss/win32ss/gdi/eng/engbrush.c branches/ros-csrss/win32ss/gdi/eng/xlateobj.c branches/ros-csrss/win32ss/gdi/ntgdi/bitblt.c branches/ros-csrss/win32ss/gdi/ntgdi/brush.h branches/ros-csrss/win32ss/gdi/ntgdi/dclife.c branches/ros-csrss/win32ss/gdi/ntgdi/dcobjs.c branches/ros-csrss/win32ss/user/ntuser/cursoricon.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/ros-csrss/boot/bootdata/hivesys_amd64.inf URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/boot/bootdata/hivesys…
Modified: branches/ros-csrss/boot/bootdata/hivesys_arm.inf URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/boot/bootdata/hivesys…
Modified: branches/ros-csrss/boot/bootdata/hivesys_i386.inf URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/boot/bootdata/hivesys…
Modified: branches/ros-csrss/dll/win32/lsasrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/lsasrv/CMak…
Modified: branches/ros-csrss/dll/win32/lsasrv/lsasrv.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/lsasrv/lsas…
Removed: branches/ros-csrss/dll/win32/lsasrv/sids.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/lsasrv/sids…
Modified: branches/ros-csrss/dll/win32/samlib/samlib.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/samlib/saml…
Modified: branches/ros-csrss/dll/win32/samlib/samlib.spec URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/samlib/saml…
Modified: branches/ros-csrss/dll/win32/shell32/iconcache.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/shell32/ico…
Modified: branches/ros-csrss/drivers/hid/hidparse/hidparse.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/hid/hidparse/…
Modified: branches/ros-csrss/drivers/hid/mouhid/mouhid.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/hid/mouhid/mo…
Modified: branches/ros-csrss/drivers/hid/mouhid/mouhid.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/hid/mouhid/mo…
Modified: branches/ros-csrss/drivers/usb/usbd/usbd.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbd/usbd…
Modified: branches/ros-csrss/drivers/usb/usbhub/fdo.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbhub/fd…
Modified: branches/ros-csrss/drivers/usb/usbhub/pdo.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbhub/pd…
Modified: branches/ros-csrss/drivers/usb/usbhub/usbhub.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbhub/us…
Modified: branches/ros-csrss/drivers/usb/usbstor/fdo.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbstor/f…
Modified: branches/ros-csrss/drivers/usb/usbstor/pdo.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbstor/p…
Modified: branches/ros-csrss/drivers/usb/usbstor/usbstor.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/drivers/usb/usbstor/u…
Modified: branches/ros-csrss/include/ddk/ntsam.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/ddk/ntsam.h?r…
Modified: branches/ros-csrss/include/reactos/idl/sam.idl URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/idl/s…
Modified: branches/ros-csrss/include/reactos/wine/unicode.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/wine/…
Modified: branches/ros-csrss/lib/drivers/hidparser/api.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/lib/drivers/hidparser…
Modified: branches/ros-csrss/lib/drivers/hidparser/hidparser.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/lib/drivers/hidparser…
Modified: branches/ros-csrss/lib/drivers/hidparser/hidparser.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/lib/drivers/hidparser…
Modified: branches/ros-csrss/lib/drivers/hidparser/parser.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/lib/drivers/hidparser…
Modified: branches/ros-csrss/ntoskrnl/include/internal/po.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/ntoskrnl/include/inte…
Modified: branches/ros-csrss/ntoskrnl/io/iomgr/device.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/ntoskrnl/io/iomgr/dev…
Modified: branches/ros-csrss/ntoskrnl/po/povolume.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/ntoskrnl/po/povolume.…
Modified: branches/ros-csrss/tools/widl/header.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/tools/widl/header.c?r…
Modified: branches/ros-csrss/win32ss/gdi/eng/engbrush.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/gdi/eng/engbr…
Modified: branches/ros-csrss/win32ss/gdi/eng/xlateobj.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/gdi/eng/xlate…
Modified: branches/ros-csrss/win32ss/gdi/ntgdi/bitblt.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/gdi/ntgdi/bit…
Modified: branches/ros-csrss/win32ss/gdi/ntgdi/brush.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/gdi/ntgdi/bru…
Modified: branches/ros-csrss/win32ss/gdi/ntgdi/dclife.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/gdi/ntgdi/dcl…
Modified: branches/ros-csrss/win32ss/gdi/ntgdi/dcobjs.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/gdi/ntgdi/dco…
Modified: branches/ros-csrss/win32ss/user/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/c…
12 years
1
0
0
0
[janderwald] 57599: [NTOSKRNL] - Unregister dope (device object power extension) from volume list when device object is deleted - Core-6691 #resolve
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Oct 23 05:42:17 2012 New Revision: 57599 URL:
http://svn.reactos.org/svn/reactos?rev=57599&view=rev
Log: [NTOSKRNL] - Unregister dope (device object power extension) from volume list when device object is deleted - Core-6691 #resolve Modified: trunk/reactos/ntoskrnl/include/internal/po.h trunk/reactos/ntoskrnl/io/iomgr/device.c trunk/reactos/ntoskrnl/po/povolume.c Modified: trunk/reactos/ntoskrnl/include/internal/po.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/po.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/po.h [iso-8859-1] Tue Oct 23 05:42:17 2012 @@ -285,6 +285,11 @@ IN PDEVICE_OBJECT DeviceObject ); +VOID +NTAPI +PoRemoveVolumeDevice( + IN PDEVICE_OBJECT DeviceObject); + // // Power State routines // Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] Tue Oct 23 05:42:17 2012 @@ -1035,6 +1035,9 @@ /* Set the pending delete flag */ IoGetDevObjExtension(DeviceObject)->ExtensionFlags |= DOE_DELETE_PENDING; + /* Unlink with the power manager */ + if (DeviceObject->Vpb) PoRemoveVolumeDevice(DeviceObject); + /* Check if the device object can be unloaded */ if (!DeviceObject->ReferenceCount) IopUnloadDevice(DeviceObject); } Modified: trunk/reactos/ntoskrnl/po/povolume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/povolume.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/po/povolume.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/po/povolume.c [iso-8859-1] Tue Oct 23 05:42:17 2012 @@ -97,7 +97,52 @@ KeReleaseGuardedMutex(&PopVolumeLock); } } - + +VOID +NTAPI +PoRemoveVolumeDevice(IN PDEVICE_OBJECT DeviceObject) +{ + PDEVICE_OBJECT_POWER_EXTENSION Dope; + PEXTENDED_DEVOBJ_EXTENSION DeviceExtension; + KIRQL OldIrql; + PAGED_CODE(); + + /* If the device already has the dope, return it */ + DeviceExtension = IoGetDevObjExtension(DeviceObject); + if (!DeviceExtension->Dope) + { + /* no dope */ + return; + } + + /* Make sure we can flush safely */ + KeAcquireGuardedMutex(&PopVolumeLock); + + /* Get dope from device */ + Dope = (PDEVICE_OBJECT_POWER_EXTENSION)DeviceExtension->Dope; + + if (Dope->Volume.Flink) + { + /* Remove from volume from list */ + RemoveEntryList(&Dope->Volume); + } + + /* Allow flushes to go through */ + KeReleaseGuardedMutex(&PopVolumeLock); + + /* Now remove dope from device object */ + KeAcquireSpinLock(&PopDopeGlobalLock, &OldIrql); + + /* remove from dev obj */ + DeviceExtension->Dope = NULL; + + /* Release lock */ + KeReleaseSpinLock(&PopDopeGlobalLock, OldIrql); + + /* Free dope */ + ExFreePoolWithTag(Dope, 'Dope'); +} + VOID NTAPI PopFlushVolumeWorker(IN PVOID Context)
12 years
1
0
0
0
[janderwald] 57598: [USBD] - Don't assert on invalid usb descriptor - Core-6574
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Oct 23 04:54:37 2012 New Revision: 57598 URL:
http://svn.reactos.org/svn/reactos?rev=57598&view=rev
Log: [USBD] - Don't assert on invalid usb descriptor - Core-6574 Modified: trunk/reactos/drivers/usb/usbd/usbd.c Modified: trunk/reactos/drivers/usb/usbd/usbd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbd/usbd.c?re…
============================================================================== --- trunk/reactos/drivers/usb/usbd/usbd.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbd/usbd.c [iso-8859-1] Tue Oct 23 04:54:37 2012 @@ -474,8 +474,11 @@ return CommonDescriptor; } - /* sanity check */ - ASSERT(CommonDescriptor->bLength); + if (CommonDescriptor->bLength == 0) + { + /* invalid usb descriptor */ + return NULL; + } /* move to next descriptor */ CommonDescriptor = (PUSB_COMMON_DESCRIPTOR)((ULONG_PTR)CommonDescriptor + CommonDescriptor->bLength);
12 years
1
0
0
0
[hbelusca] 57597: [CONSRV/WIN32CSR] - Move all the console subsystem from win32csr to a new server dll called consrv.dll (instead of putting it directly to winsrv.dll). It's because I want to rewor...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Oct 22 23:55:51 2012 New Revision: 57597 URL:
http://svn.reactos.org/svn/reactos?rev=57597&view=rev
Log: [CONSRV/WIN32CSR] - Move all the console subsystem from win32csr to a new server dll called consrv.dll (instead of putting it directly to winsrv.dll). It's because I want to rework on this later on. Many things must be done in order to achieve the moving (renaming functions, etc...). Tables & symbol names come from
http://j00ru.vexillium.org/csrss_list/api_list.html
as usual, but here I took the Win 2k3 ones and I added few Win 7 functions which already existed in our codebase. The other table names are guessed based on what originally existed in csrsrv and so on. Many stubs are also missing. Cultural remark: consrv.dll originally existed in Beta releases of Windows NT 3.1 (e.g. the October 1991 one), but was soon merged with winsrv.dll and thus, in subsequent versions of Windows, the console subsystem is also found in winsrv.dll. See
http://www.logotypes.se/NT310CSRSS.txt
and
http://j00ru.vexillium.org/?p=349#comment-1883
. One has to wait until Windows 7 to see it moving again to conhost.exe. [CSRSRV] - Add an explanation comment on what the ValidTable member in the CSR_SERVER_DLL structure is for. Added: branches/ros-csrss/win32ss/user/consrv/ (with props) branches/ros-csrss/win32ss/user/consrv/CMakeLists.txt (with props) branches/ros-csrss/win32ss/user/consrv/alias.c - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/alias.c branches/ros-csrss/win32ss/user/consrv/coninput.c (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/coninput.c branches/ros-csrss/win32ss/user/consrv/conio.h (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/conio.h branches/ros-csrss/win32ss/user/consrv/conoutput.c (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/conoutput.c branches/ros-csrss/win32ss/user/consrv/console.c (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/console.c branches/ros-csrss/win32ss/user/consrv/consrv.h (with props) branches/ros-csrss/win32ss/user/consrv/consrv.rc (with props) branches/ros-csrss/win32ss/user/consrv/consrv.spec (with props) branches/ros-csrss/win32ss/user/consrv/guiconsole.c (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/guiconsole.c branches/ros-csrss/win32ss/user/consrv/guiconsole.h (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/guiconsole.h branches/ros-csrss/win32ss/user/consrv/handle.c (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/handle.c branches/ros-csrss/win32ss/user/consrv/init.c (with props) branches/ros-csrss/win32ss/user/consrv/lang/ - copied from r57593, branches/ros-csrss/win32ss/user/win32csr/lang/ branches/ros-csrss/win32ss/user/consrv/lineinput.c - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/lineinput.c branches/ros-csrss/win32ss/user/consrv/res/ - copied from r57593, branches/ros-csrss/win32ss/user/win32csr/res/ branches/ros-csrss/win32ss/user/consrv/rsrc.rc (with props) branches/ros-csrss/win32ss/user/consrv/server.c (with props) branches/ros-csrss/win32ss/user/consrv/tuiconsole.c (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/tuiconsole.c branches/ros-csrss/win32ss/user/consrv/tuiconsole.h (contents, props changed) - copied, changed from r57593, branches/ros-csrss/win32ss/user/win32csr/tuiconsole.h Removed: branches/ros-csrss/win32ss/user/win32csr/alias.c branches/ros-csrss/win32ss/user/win32csr/coninput.c branches/ros-csrss/win32ss/user/win32csr/conio.h branches/ros-csrss/win32ss/user/win32csr/conoutput.c branches/ros-csrss/win32ss/user/win32csr/console.c branches/ros-csrss/win32ss/user/win32csr/guiconsole.c branches/ros-csrss/win32ss/user/win32csr/guiconsole.h branches/ros-csrss/win32ss/user/win32csr/handle.c branches/ros-csrss/win32ss/user/win32csr/lineinput.c branches/ros-csrss/win32ss/user/win32csr/res/ branches/ros-csrss/win32ss/user/win32csr/tuiconsole.c branches/ros-csrss/win32ss/user/win32csr/tuiconsole.h Modified: branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h branches/ros-csrss/include/reactos/subsys/win/conmsg.h branches/ros-csrss/win32ss/user/consrv/lang/bg-BG.rc branches/ros-csrss/win32ss/user/consrv/lang/cs-CZ.rc branches/ros-csrss/win32ss/user/consrv/lang/de-DE.rc branches/ros-csrss/win32ss/user/consrv/lang/el-GR.rc branches/ros-csrss/win32ss/user/consrv/lang/en-US.rc branches/ros-csrss/win32ss/user/consrv/lang/es-ES.rc branches/ros-csrss/win32ss/user/consrv/lang/fr-FR.rc branches/ros-csrss/win32ss/user/consrv/lang/id-ID.rc branches/ros-csrss/win32ss/user/consrv/lang/it-IT.rc branches/ros-csrss/win32ss/user/consrv/lang/ja-JP.rc branches/ros-csrss/win32ss/user/consrv/lang/no-NO.rc branches/ros-csrss/win32ss/user/consrv/lang/pl-PL.rc branches/ros-csrss/win32ss/user/consrv/lang/pt-BR.rc branches/ros-csrss/win32ss/user/consrv/lang/ro-RO.rc branches/ros-csrss/win32ss/user/consrv/lang/ru-RU.rc branches/ros-csrss/win32ss/user/consrv/lang/sk-SK.rc branches/ros-csrss/win32ss/user/consrv/lang/sv-SE.rc branches/ros-csrss/win32ss/user/consrv/lang/tr-TR.rc branches/ros-csrss/win32ss/user/consrv/lang/uk-UA.rc branches/ros-csrss/win32ss/user/consrv/lang/zh-CN.rc branches/ros-csrss/win32ss/user/consrv/lang/zh-TW.rc branches/ros-csrss/win32ss/user/win32csr/CMakeLists.txt branches/ros-csrss/win32ss/user/win32csr/desktopbg.c (contents, props changed) branches/ros-csrss/win32ss/user/win32csr/desktopbg.h (contents, props changed) branches/ros-csrss/win32ss/user/win32csr/dllmain.c (contents, props changed) branches/ros-csrss/win32ss/user/win32csr/exitros.c (contents, props changed) branches/ros-csrss/win32ss/user/win32csr/resource.h (contents, props changed) branches/ros-csrss/win32ss/user/win32csr/w32csr.h branches/ros-csrss/win32ss/user/win32csr/win32csr.h (contents, props changed) branches/ros-csrss/win32ss/user/win32csr/win32csr.rc (props changed) [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
Modified: branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
Modified: branches/ros-csrss/include/reactos/subsys/win/conmsg.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
Added: branches/ros-csrss/win32ss/user/consrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/C…
Copied: branches/ros-csrss/win32ss/user/consrv/alias.c (from r57593, branches/ros-csrss/win32ss/user/win32csr/alias.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/a…
Copied: branches/ros-csrss/win32ss/user/consrv/coninput.c (from r57593, branches/ros-csrss/win32ss/user/win32csr/coninput.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
Copied: branches/ros-csrss/win32ss/user/consrv/conio.h (from r57593, branches/ros-csrss/win32ss/user/win32csr/conio.h) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
Copied: branches/ros-csrss/win32ss/user/consrv/conoutput.c (from r57593, branches/ros-csrss/win32ss/user/win32csr/conoutput.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
Copied: branches/ros-csrss/win32ss/user/consrv/console.c (from r57593, branches/ros-csrss/win32ss/user/win32csr/console.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
Added: branches/ros-csrss/win32ss/user/consrv/consrv.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
Added: branches/ros-csrss/win32ss/user/consrv/consrv.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
Added: branches/ros-csrss/win32ss/user/consrv/consrv.spec URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
Copied: branches/ros-csrss/win32ss/user/consrv/guiconsole.c (from r57593, branches/ros-csrss/win32ss/user/win32csr/guiconsole.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
Copied: branches/ros-csrss/win32ss/user/consrv/guiconsole.h (from r57593, branches/ros-csrss/win32ss/user/win32csr/guiconsole.h) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
Copied: branches/ros-csrss/win32ss/user/consrv/handle.c (from r57593, branches/ros-csrss/win32ss/user/win32csr/handle.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/h…
Added: branches/ros-csrss/win32ss/user/consrv/init.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/i…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Modified: branches/ros-csrss/win32ss/user/consrv/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Copied: branches/ros-csrss/win32ss/user/consrv/lineinput.c (from r57593, branches/ros-csrss/win32ss/user/win32csr/lineinput.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
Added: branches/ros-csrss/win32ss/user/consrv/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/r…
Added: branches/ros-csrss/win32ss/user/consrv/server.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/s…
Copied: branches/ros-csrss/win32ss/user/consrv/tuiconsole.c (from r57593, branches/ros-csrss/win32ss/user/win32csr/tuiconsole.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/t…
Copied: branches/ros-csrss/win32ss/user/consrv/tuiconsole.h (from r57593, branches/ros-csrss/win32ss/user/win32csr/tuiconsole.h) URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/t…
Modified: branches/ros-csrss/win32ss/user/win32csr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/alias.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/coninput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/conio.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/console.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Modified: branches/ros-csrss/win32ss/user/win32csr/desktopbg.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Modified: branches/ros-csrss/win32ss/user/win32csr/desktopbg.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Modified: branches/ros-csrss/win32ss/user/win32csr/dllmain.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Modified: branches/ros-csrss/win32ss/user/win32csr/exitros.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/guiconsole.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/guiconsole.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/handle.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/lineinput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Modified: branches/ros-csrss/win32ss/user/win32csr/resource.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/tuiconsole.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Removed: branches/ros-csrss/win32ss/user/win32csr/tuiconsole.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Modified: branches/ros-csrss/win32ss/user/win32csr/w32csr.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
Modified: branches/ros-csrss/win32ss/user/win32csr/win32csr.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/win32csr…
12 years
1
0
0
0
[hbelusca] 57596: [BASESRV] - Remove an unneeded cmake comment. [CSRSRV] - Compile the resource file.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Oct 22 23:37:07 2012 New Revision: 57596 URL:
http://svn.reactos.org/svn/reactos?rev=57596&view=rev
Log: [BASESRV] - Remove an unneeded cmake comment. [CSRSRV] - Compile the resource file. Modified: branches/ros-csrss/subsystems/win/basesrv/CMakeLists.txt branches/ros-csrss/subsystems/win32/csrsrv/CMakeLists.txt Modified: branches/ros-csrss/subsystems/win/basesrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win/basesr…
============================================================================== --- branches/ros-csrss/subsystems/win/basesrv/CMakeLists.txt [iso-8859-1] (original) +++ branches/ros-csrss/subsystems/win/basesrv/CMakeLists.txt [iso-8859-1] Mon Oct 22 23:37:07 2012 @@ -17,7 +17,5 @@ add_importlibs(basesrv ntdll csrsrv) -#add_pch(basesrv w32csr.h) - add_dependencies(basesrv bugcodes) add_cd_file(TARGET basesrv DESTINATION reactos/system32 FOR all) Modified: branches/ros-csrss/subsystems/win32/csrsrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
============================================================================== --- branches/ros-csrss/subsystems/win32/csrsrv/CMakeLists.txt [iso-8859-1] (original) +++ branches/ros-csrss/subsystems/win32/csrsrv/CMakeLists.txt [iso-8859-1] Mon Oct 22 23:37:07 2012 @@ -13,6 +13,7 @@ thredsup.c user.c wait.c + csrsrv.rc ${CMAKE_CURRENT_BINARY_DIR}/csrsrv.def) add_library(csrsrv SHARED ${SOURCE})
12 years
1
0
0
0
[janderwald] 57595: [HIDPARSE][HIDPARSER] - Implement HidP_GetUsageValue - Add hack to HidParser_GetScaledUsageValueWithReport [MOUHID] - Add partial support for absolute pointing devices - Tested ...
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 22 21:18:30 2012 New Revision: 57595 URL:
http://svn.reactos.org/svn/reactos?rev=57595&view=rev
Log: [HIDPARSE][HIDPARSER] - Implement HidP_GetUsageValue - Add hack to HidParser_GetScaledUsageValueWithReport [MOUHID] - Add partial support for absolute pointing devices - Tested in VBOX 4.1.22 with absolute pointing devices - Needs more work in win32k - Core 6553 Modified: trunk/reactos/drivers/hid/hidparse/hidparse.c trunk/reactos/drivers/hid/mouhid/mouhid.c trunk/reactos/drivers/hid/mouhid/mouhid.h trunk/reactos/lib/drivers/hidparser/api.c trunk/reactos/lib/drivers/hidparser/hidparser.c trunk/reactos/lib/drivers/hidparser/hidparser.h trunk/reactos/lib/drivers/hidparser/parser.h Modified: trunk/reactos/drivers/hid/hidparse/hidparse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidparse/hidpa…
============================================================================== --- trunk/reactos/drivers/hid/hidparse/hidparse.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/hidparse/hidparse.c [iso-8859-1] Mon Oct 22 21:18:30 2012 @@ -309,6 +309,38 @@ HIDAPI NTSTATUS NTAPI +HidP_GetUsageValue( + IN HIDP_REPORT_TYPE ReportType, + IN USAGE UsagePage, + IN USHORT LinkCollection, + IN USAGE Usage, + OUT PULONG UsageValue, + IN PHIDP_PREPARSED_DATA PreparsedData, + IN PCHAR Report, + IN ULONG ReportLength) +{ + HID_PARSER Parser; + + // + // sanity check + // + ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType == HidP_Feature); + + // + // init parser + // + HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); + + // + // get scaled usage value + // + return HidParser_GetUsageValue(&Parser, PreparsedData, ReportType, UsagePage, LinkCollection, Usage, UsageValue, Report, ReportLength); +} + + +HIDAPI +NTSTATUS +NTAPI HidP_TranslateUsageAndPagesToI8042ScanCodes( IN PUSAGE_AND_PAGE ChangedUsageList, IN ULONG UsageListLength, @@ -405,24 +437,6 @@ return STATUS_NOT_IMPLEMENTED; } -HIDAPI -NTSTATUS -NTAPI -HidP_GetUsageValue( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - OUT PULONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - NTSTATUS NTAPI HidP_SysPowerEvent ( Modified: trunk/reactos/drivers/hid/mouhid/mouhid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/mouhid/mouhid.…
============================================================================== --- trunk/reactos/drivers/hid/mouhid/mouhid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/mouhid/mouhid.c [iso-8859-1] Mon Oct 22 21:18:30 2012 @@ -37,6 +37,7 @@ OUT PLONG LastY) { NTSTATUS Status; + ULONG ValueX, ValueY; /* init result */ *LastX = 0; @@ -44,16 +45,49 @@ /* get scaled usage value x */ Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, (PLONG)LastX, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); - /* FIXME handle error */ - ASSERT(Status == HIDP_STATUS_SUCCESS); + if (Status != HIDP_STATUS_SUCCESS) + { + /* FIXME: handle more errors */ + if (Status == HIDP_STATUS_BAD_LOG_PHY_VALUES) + { + /* FIXME: assume it operates in absolute mode */ + DeviceExtension->MouseAbsolute = TRUE; + + /* get unscaled value */ + Status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, (PULONG)&ValueX, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + + /* FIXME handle error */ + ASSERT(Status == HIDP_STATUS_SUCCESS); + + /* absolute pointing devices values need be in range 0 - 0xffff */ + ASSERT(DeviceExtension->ValueCapsX.LogicalMax > 0); + + *LastX = (ValueX * 0xFFFF) / DeviceExtension->ValueCapsX.LogicalMax; + } + } /* get scaled usage value y */ Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, (PLONG)LastY, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); - /* FIXME handle error */ - ASSERT(Status == HIDP_STATUS_SUCCESS); - -} - + if (Status != HIDP_STATUS_SUCCESS) + { + // FIXME: handle more errors + if (Status == HIDP_STATUS_BAD_LOG_PHY_VALUES) + { + // assume it operates in absolute mode + DeviceExtension->MouseAbsolute = TRUE; + + // get unscaled value + Status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, (PULONG)&ValueY, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + + /* FIXME handle error */ + ASSERT(Status == HIDP_STATUS_SUCCESS); + + /* absolute pointing devices values need be in range 0 - 0xffff */ + ASSERT(DeviceExtension->ValueCapsY.LogicalMax); + *LastY = (ValueY * 0xFFFF) / DeviceExtension->ValueCapsY.LogicalMax; + } + } +} VOID MouHid_GetButtonFlags( @@ -132,6 +166,12 @@ TempList = DeviceExtension->CurrentUsageList; DeviceExtension->CurrentUsageList = DeviceExtension->PreviousUsageList; DeviceExtension->PreviousUsageList = TempList; + + if (DeviceExtension->MouseAbsolute) + { + // mouse operates absolute + *ButtonFlags |= MOUSE_MOVE_ABSOLUTE; + } } VOID @@ -195,11 +235,11 @@ return STATUS_MORE_PROCESSING_REQUIRED; } + /* get mouse change */ + MouHid_GetButtonMove(DeviceExtension, &LastX, &LastY); + /* get mouse change flags */ MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags); - - /* get mouse change */ - MouHid_GetButtonMove(DeviceExtension, &LastX, &LastY); /* init input data */ RtlZeroMemory(&MouseInputData, sizeof(MOUSE_INPUT_DATA)); @@ -227,6 +267,12 @@ } } + DPRINT("[MOUHID] ReportData %02x %02x %02x %02x %02x %02x %02x\n", + DeviceExtension->Report[0] & 0xFF, + DeviceExtension->Report[1] & 0xFF, DeviceExtension->Report[2] & 0xFF, + DeviceExtension->Report[3] & 0xFF, DeviceExtension->Report[4] & 0xFF, + DeviceExtension->Report[5] & 0xFF, DeviceExtension->Report[6] & 0xFF); + DPRINT("[MOUHID] LastX %ld LastY %ld Flags %x ButtonData %x\n", MouseInputData.LastX, MouseInputData.LastY, MouseInputData.ButtonFlags, MouseInputData.ButtonData); /* dispatch mouse action */ @@ -700,10 +746,10 @@ DeviceExtension->PreparsedData = PreparsedData; ValueCapsLength = 1; - HidP_GetSpecificValueCaps(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, &ValueCaps, &ValueCapsLength, PreparsedData); + HidP_GetSpecificValueCaps(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, &DeviceExtension->ValueCapsX, &ValueCapsLength, PreparsedData); ValueCapsLength = 1; - HidP_GetSpecificValueCaps(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, &ValueCaps, &ValueCapsLength, PreparsedData); + HidP_GetSpecificValueCaps(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, &DeviceExtension->ValueCapsY, &ValueCapsLength, PreparsedData); /* now check for wheel mouse support */ ValueCapsLength = 1; Modified: trunk/reactos/drivers/hid/mouhid/mouhid.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/mouhid/mouhid.…
============================================================================== --- trunk/reactos/drivers/hid/mouhid/mouhid.h [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/mouhid/mouhid.h [iso-8859-1] Mon Oct 22 21:18:30 2012 @@ -109,6 +109,22 @@ // UCHAR StopReadReport; + // + // mouse absolute + // + UCHAR MouseAbsolute; + + // + // value caps x + // + HIDP_VALUE_CAPS ValueCapsX; + + // + // value caps y button + // + HIDP_VALUE_CAPS ValueCapsY; + + }MOUHID_DEVICE_EXTENSION, *PMOUHID_DEVICE_EXTENSION; #define WHEEL_DELTA 120 Modified: trunk/reactos/lib/drivers/hidparser/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/api.…
============================================================================== --- trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] Mon Oct 22 21:18:30 2012 @@ -563,6 +563,103 @@ } +HIDPARSER_STATUS +HidParser_GetUsageValueWithReport( + IN PHID_PARSER Parser, + IN PVOID CollectionContext, + IN UCHAR ReportType, + IN USAGE UsagePage, + IN USAGE Usage, + OUT PULONG UsageValue, + IN PCHAR ReportDescriptor, + IN ULONG ReportDescriptorLength) +{ + ULONG Index; + PHID_REPORT Report; + USHORT CurrentUsagePage; + PHID_REPORT_ITEM ReportItem; + ULONG Data; + + // + // get report + // + Report = HidParser_GetReportInCollection(CollectionContext, ReportType); + if (!Report) + { + // + // no such report + // + return HIDPARSER_STATUS_REPORT_NOT_FOUND; + } + + if (Report->ReportSize / 8 != (ReportDescriptorLength - 1)) + { + // + // invalid report descriptor length + // + return HIDPARSER_STATUS_INVALID_REPORT_LENGTH; + } + + for(Index = 0; Index < Report->ItemCount; Index++) + { + // + // get report item + // + ReportItem = &Report->Items[Index]; + + // + // check usage page + // + CurrentUsagePage = (ReportItem->UsageMinimum >> 16); + + // + // does usage page match + // + if (UsagePage != CurrentUsagePage) + continue; + + // + // does the usage match + // + if (Usage != (ReportItem->UsageMinimum & 0xFFFF)) + continue; + + // + // check if the specified usage is activated + // + ASSERT(ReportItem->ByteOffset < ReportDescriptorLength); + + // + // one extra shift for skipping the prepended report id + // + Data = 0; + Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset +1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1))); + //Data = ReportDescriptor[ReportItem->ByteOffset + 1]; + + // + // shift data + // + Data >>= ReportItem->Shift; + + // + // clear unwanted bits + // + Data &= ReportItem->Mask; + + // + // store result + // + *UsageValue = Data; + return HIDPARSER_STATUS_SUCCESS; + } + + // + // usage not found + // + return HIDPARSER_STATUS_USAGE_NOT_FOUND; +} + + HIDPARSER_STATUS HidParser_GetScaledUsageValueWithReport( @@ -652,10 +749,17 @@ // // logical boundaries are signed values // + + // FIXME: scale with physical min/max if ((Data & ~(ReportItem->Mask >> 1)) != 0) { Data |= ~ReportItem->Mask; } + } + else + { + // HACK: logical boundaries are absolute values + return HIDPARSER_STATUS_BAD_LOG_PHY_VALUES; } // Modified: trunk/reactos/lib/drivers/hidparser/hidparser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/hidp…
============================================================================== --- trunk/reactos/lib/drivers/hidparser/hidparser.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/hidparser/hidparser.c [iso-8859-1] Mon Oct 22 21:18:30 2012 @@ -34,6 +34,8 @@ return HIDP_STATUS_I8042_TRANS_UNKNOWN; case HIDPARSER_STATUS_COLLECTION_NOT_FOUND: return HIDP_STATUS_NOT_IMPLEMENTED; //FIXME + case HIDPARSER_STATUS_BAD_LOG_PHY_VALUES: + return HIDP_STATUS_BAD_LOG_PHY_VALUES; } DPRINT1("TranslateHidParserStatus Status %ld not implemented\n", Status); return HIDP_STATUS_NOT_IMPLEMENTED; @@ -952,9 +954,54 @@ IN PCHAR Report, IN ULONG ReportLength) { - UNIMPLEMENTED - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; + HIDPARSER_STATUS ParserStatus; + + // + // FIXME: implement searching in specific collection + // + ASSERT(LinkCollection == HIDP_LINK_COLLECTION_UNSPECIFIED); + + if (ReportType == HidP_Input) + { + // + // input report + // + ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, UsageValue, Report, ReportLength); + } + else if (ReportType == HidP_Output) + { + // + // input report + // + ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, UsageValue, Report, ReportLength); + } + else if (ReportType == HidP_Feature) + { + // + // input report + // + ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, UsageValue, Report, ReportLength); + } + else + { + // + // invalid report type + // + return HIDP_STATUS_INVALID_REPORT_TYPE; + } + + if (ParserStatus == HIDPARSER_STATUS_SUCCESS) + { + // + // success + // + return HIDP_STATUS_SUCCESS; + } + + // + // translate error + // + return TranslateHidParserStatus(ParserStatus); } NTSTATUS Modified: trunk/reactos/lib/drivers/hidparser/hidparser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/hidp…
============================================================================== --- trunk/reactos/lib/drivers/hidparser/hidparser.h [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/hidparser/hidparser.h [iso-8859-1] Mon Oct 22 21:18:30 2012 @@ -48,7 +48,8 @@ HIDPARSER_STATUS_INVALID_REPORT_TYPE = -6, HIDPARSER_STATUS_BUFFER_TOO_SMALL = -7, HIDPARSER_STATUS_USAGE_NOT_FOUND = -8, - HIDPARSER_STATUS_I8042_TRANS_UNKNOWN = -9 + HIDPARSER_STATUS_I8042_TRANS_UNKNOWN = -9, + HIDPARSER_STATUS_BAD_LOG_PHY_VALUES = -10 }HIDPARSER_STATUS_CODES; typedef struct @@ -200,6 +201,7 @@ OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, IN OUT PULONG LinkCollectionNodesLength); + HIDAPI NTSTATUS NTAPI Modified: trunk/reactos/lib/drivers/hidparser/parser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/pars…
============================================================================== --- trunk/reactos/lib/drivers/hidparser/parser.h [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/hidparser/parser.h [iso-8859-1] Mon Oct 22 21:18:30 2012 @@ -327,6 +327,17 @@ IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength); +HIDPARSER_STATUS +HidParser_GetUsageValueWithReport( + IN PHID_PARSER Parser, + IN PVOID CollectionContext, + IN UCHAR ReportType, + IN USAGE UsagePage, + IN USAGE Usage, + OUT PULONG UsageValue, + IN PCHAR ReportDescriptor, + IN ULONG ReportDescriptorLength); + /* parser.c */ HIDPARSER_STATUS
12 years
1
0
0
0
[ekohl] 57594: [SAMLIB] Implement SamRemoveMemberFromAlias, SamRemoveMemberFromForeignDomain, SamRemoveMemberFromGroup and SamRemoveMultipleMembersFromAlias.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Oct 22 20:43:04 2012 New Revision: 57594 URL:
http://svn.reactos.org/svn/reactos?rev=57594&view=rev
Log: [SAMLIB] Implement SamRemoveMemberFromAlias, SamRemoveMemberFromForeignDomain, SamRemoveMemberFromGroup and SamRemoveMultipleMembersFromAlias. Modified: trunk/reactos/dll/win32/samlib/samlib.c trunk/reactos/dll/win32/samlib/samlib.spec trunk/reactos/include/ddk/ntsam.h Modified: trunk/reactos/dll/win32/samlib/samlib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/samlib.c?…
============================================================================== --- trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] Mon Oct 22 20:43:04 2012 @@ -171,7 +171,7 @@ return STATUS_INVALID_PARAMETER_2; Buffer.Count = MemberCount; - Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds; + Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds; RpcTryExcept { @@ -1332,6 +1332,114 @@ NTSTATUS NTAPI +SamRemoveMemberFromAlias(IN SAM_HANDLE AliasHandle, + IN PSID MemberId) +{ + NTSTATUS Status; + + TRACE("SamRemoveMemberFromAlias(%p %ul)\n", + AliasHandle, MemberId); + + RpcTryExcept + { + Status = SamrRemoveMemberFromAlias((SAMPR_HANDLE)AliasHandle, + MemberId); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return Status; +} + + +NTSTATUS +NTAPI +SamRemoveMemberFromForeignDomain(IN SAM_HANDLE DomainHandle, + IN PSID MemberId) +{ + NTSTATUS Status; + + TRACE("SamRemoveMemberFromForeignDomain(%p %ul)\n", + DomainHandle, MemberId); + + RpcTryExcept + { + Status = SamrRemoveMemberFromForeignDomain((SAMPR_HANDLE)DomainHandle, + MemberId); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return Status; +} + + +NTSTATUS +NTAPI +SamRemoveMemberFromGroup(IN SAM_HANDLE GroupHandle, + IN ULONG MemberId) +{ + NTSTATUS Status; + + TRACE("SamRemoveMemberFromGroup(%p %ul)\n", + GroupHandle, MemberId); + + RpcTryExcept + { + Status = SamrRemoveMemberFromGroup((SAMPR_HANDLE)GroupHandle, + MemberId); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return Status; +} + + +NTSTATUS +NTAPI +SamRemoveMultipleMembersFromAlias(IN SAM_HANDLE AliasHandle, + IN PSID *MemberIds, + IN ULONG MemberCount) +{ + SAMPR_PSID_ARRAY Buffer; + NTSTATUS Status; + + TRACE("SamRemoveMultipleMembersFromAlias(%p %p %lu)\n", + AliasHandle, MemberIds, MemberCount); + + if (MemberIds == NULL) + return STATUS_INVALID_PARAMETER_2; + + Buffer.Count = MemberCount; + Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds; + + RpcTryExcept + { + Status = SamrRemoveMultipleMembersFromAlias((SAMPR_HANDLE)AliasHandle, + &Buffer); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return Status; +} + + +NTSTATUS +NTAPI SamRidToSid(IN SAM_HANDLE ObjectHandle, IN ULONG Rid, OUT PSID *Sid) Modified: trunk/reactos/dll/win32/samlib/samlib.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/samlib.sp…
============================================================================== --- trunk/reactos/dll/win32/samlib/samlib.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samlib/samlib.spec [iso-8859-1] Mon Oct 22 20:43:04 2012 @@ -38,10 +38,10 @@ @ stdcall SamQueryInformationGroup(ptr long ptr) @ stdcall SamQueryInformationUser(ptr long ptr) @ stdcall SamQuerySecurityObject(ptr long ptr) -@ stub SamRemoveMemberFromAlias -@ stub SamRemoveMemberFromForeignDomain -@ stub SamRemoveMemberFromGroup -@ stub SamRemoveMultipleMembersFromAlias +@ stdcall SamRemoveMemberFromAlias(ptr long) +@ stdcall SamRemoveMemberFromForeignDomain(ptr long) +@ stdcall SamRemoveMemberFromGroup(ptr long) +@ stdcall SamRemoveMultipleMembersFromAlias(ptr ptr long) @ stdcall SamRidToSid(ptr long ptr) @ stdcall SamSetInformationAlias(ptr long ptr) @ stdcall SamSetInformationDomain(ptr long ptr) Modified: trunk/reactos/include/ddk/ntsam.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntsam.h?rev=57…
============================================================================== --- trunk/reactos/include/ddk/ntsam.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntsam.h [iso-8859-1] Mon Oct 22 20:43:04 2012 @@ -542,6 +542,22 @@ NTSTATUS NTAPI +SamRemoveMemberFromForeignDomain(IN SAM_HANDLE DomainHandle, + IN PSID MemberId); + +NTSTATUS +NTAPI +SamRemoveMemberFromGroup(IN SAM_HANDLE GroupHandle, + IN ULONG MemberId); + +NTSTATUS +NTAPI +SamRemoveMultipleMembersFromAlias(IN SAM_HANDLE AliasHandle, + IN PSID *MemberIds, + IN ULONG MemberCount); + +NTSTATUS +NTAPI SamRidToSid(IN SAM_HANDLE ObjectHandle, IN ULONG Rid, OUT PSID *Sid);
12 years
1
0
0
0
[jgardou] 57593: [SHELL32] - Add error handling when adding icons to the cache. - Plug more icon leaks.
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Oct 22 13:43:03 2012 New Revision: 57593 URL:
http://svn.reactos.org/svn/reactos?rev=57593&view=rev
Log: [SHELL32] - Add error handling when adding icons to the cache. - Plug more icon leaks. Modified: trunk/reactos/dll/win32/shell32/iconcache.cpp Modified: trunk/reactos/dll/win32/shell32/iconcache.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/iconcach…
============================================================================== --- trunk/reactos/dll/win32/shell32/iconcache.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/iconcache.cpp [iso-8859-1] Mon Oct 22 13:43:03 2012 @@ -321,7 +321,8 @@ * appends an icon pair to the end of the cache */ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags) -{ LPSIC_ENTRY lpsice; +{ + LPSIC_ENTRY lpsice; INT ret, index, index1; WCHAR path[MAX_PATH]; TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon); @@ -340,23 +341,38 @@ index = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice); if ( INVALID_INDEX == index ) { - HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile); - SHFree(lpsice); - ret = INVALID_INDEX; - } - else - { - index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon); - index1= ImageList_AddIcon (ShellBigIconList, hBigIcon); - - if (index!=index1) - { + ret = INVALID_INDEX; + goto leave; + } + + index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon); + index1= ImageList_AddIcon (ShellBigIconList, hBigIcon); + + /* Something went wrong when allocating a new image in the list. Abort. */ + if((index == -1) || (index1 == -1)) + { + WARN("Something went wrong when adding the icon to the list: small - 0x%x, big - 0x%x.\n", + index, index1); + if(index != -1) ImageList_Remove(ShellSmallIconList, index); + if(index1 != -1) ImageList_Remove(ShellBigIconList, index1); + ret = INVALID_INDEX; + goto leave; + } + + if (index!=index1) + { FIXME("iconlists out of sync 0x%x 0x%x\n", index, index1); - } - lpsice->dwListIndex = index; - ret = lpsice->dwListIndex; - } - + /* What to do ???? */ + } + lpsice->dwListIndex = index; + ret = lpsice->dwListIndex; + +leave: + if(ret == INVALID_INDEX) + { + HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile); + SHFree(lpsice); + } LeaveCriticalSection(&SHELL32_SicCS); return ret; } @@ -367,23 +383,23 @@ * gets small/big icon by number from a file */ static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags) -{ HICON hiconLarge=0; - HICON hiconSmall=0; - HICON hiconLargeShortcut; - HICON hiconSmallShortcut; - -#if defined(__CYGWIN__) || defined (__MINGW32__) || defined(_MSC_VER) +{ + HICON hiconLarge=0; + HICON hiconSmall=0; + UINT ret; static UINT (WINAPI*PrivateExtractIconExW)(LPCWSTR,int,HICON*,HICON*,UINT) = NULL; - if (!PrivateExtractIconExW) { + if (!PrivateExtractIconExW) + { HMODULE hUser32 = GetModuleHandleA("user32"); PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW"); } - if (PrivateExtractIconExW) + if (PrivateExtractIconExW) + { PrivateExtractIconExW(sSourceFile, dwSourceIndex, &hiconLarge, &hiconSmall, 1); + } else -#endif { PrivateExtractIconsW(sSourceFile, dwSourceIndex, 32, 32, &hiconLarge, NULL, 1, 0); PrivateExtractIconsW(sSourceFile, dwSourceIndex, 16, 16, &hiconSmall, NULL, 1, 0); @@ -391,29 +407,36 @@ if ( !hiconLarge || !hiconSmall) { - WARN("failure loading icon %i from %s (%p %p)\n", dwSourceIndex, debugstr_w(sSourceFile), hiconLarge, hiconSmall); - return -1; + WARN("failure loading icon %i from %s (%p %p)\n", dwSourceIndex, debugstr_w(sSourceFile), hiconLarge, hiconSmall); + if(hiconLarge) DestroyIcon(hiconLarge); + if(hiconSmall) DestroyIcon(hiconSmall); + return INVALID_INDEX; } if (0 != (dwFlags & GIL_FORSHORTCUT)) { - hiconLargeShortcut = SIC_OverlayShortcutImage(hiconLarge, TRUE); - hiconSmallShortcut = SIC_OverlayShortcutImage(hiconSmall, FALSE); - if (NULL != hiconLargeShortcut && NULL != hiconSmallShortcut) - { - hiconLarge = hiconLargeShortcut; - hiconSmall = hiconSmallShortcut; - } - else - { - WARN("Failed to create shortcut overlayed icons\n"); - if (NULL != hiconLargeShortcut) DestroyIcon(hiconLargeShortcut); - if (NULL != hiconSmallShortcut) DestroyIcon(hiconSmallShortcut); - dwFlags &= ~ GIL_FORSHORTCUT; - } - } - - return SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge, dwFlags); + HICON hiconLargeShortcut = SIC_OverlayShortcutImage(hiconLarge, TRUE); + HICON hiconSmallShortcut = SIC_OverlayShortcutImage(hiconSmall, FALSE); + if (NULL != hiconLargeShortcut && NULL != hiconSmallShortcut) + { + DestroyIcon(hiconLarge); + DestroyIcon(hiconSmall); + hiconLarge = hiconLargeShortcut; + hiconSmall = hiconSmallShortcut; + } + else + { + WARN("Failed to create shortcut overlayed icons\n"); + if (NULL != hiconLargeShortcut) DestroyIcon(hiconLargeShortcut); + if (NULL != hiconSmallShortcut) DestroyIcon(hiconSmallShortcut); + dwFlags &= ~ GIL_FORSHORTCUT; + } + } + + ret = SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge, dwFlags); + DestroyIcon(hiconLarge); + DestroyIcon(hiconSmall); + return ret; } /***************************************************************************** * SIC_GetIconIndex [internal]
12 years
1
0
0
0
[janderwald] 57592: [USBSTOR][USBHUB] - Append devobj number to device id - Delete device objects - Core-6598
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 22 11:33:26 2012 New Revision: 57592 URL:
http://svn.reactos.org/svn/reactos?rev=57592&view=rev
Log: [USBSTOR][USBHUB] - Append devobj number to device id - Delete device objects - Core-6598 Modified: trunk/reactos/drivers/usb/usbhub/fdo.c trunk/reactos/drivers/usb/usbhub/pdo.c trunk/reactos/drivers/usb/usbhub/usbhub.h trunk/reactos/drivers/usb/usbstor/fdo.c trunk/reactos/drivers/usb/usbstor/pdo.c trunk/reactos/drivers/usb/usbstor/usbstor.h Modified: trunk/reactos/drivers/usb/usbhub/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/fdo.c?r…
============================================================================== --- trunk/reactos/drivers/usb/usbhub/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub/fdo.c [iso-8859-1] Mon Oct 22 11:33:26 2012 @@ -819,6 +819,7 @@ LPWSTR DeviceString; WCHAR Buffer[200]; PHUB_CHILDDEVICE_EXTENSION UsbChildExtension; + PHUB_DEVICE_EXTENSION HubDeviceExtension; PUSB_DEVICE_DESCRIPTOR DeviceDescriptor; PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; @@ -827,6 +828,9 @@ // get child device extension // UsbChildExtension = (PHUB_CHILDDEVICE_EXTENSION)UsbChildDeviceObject->DeviceExtension; + + // get hub device extension + HubDeviceExtension = (PHUB_DEVICE_EXTENSION) UsbChildExtension->ParentDeviceObject->DeviceExtension; // // get device descriptor @@ -1011,10 +1015,12 @@ // if (UsbChildExtension->DeviceDesc.iSerialNumber) { + LPWSTR SerialBuffer = NULL; + Status = GetUsbStringDescriptor(UsbChildDeviceObject, UsbChildExtension->DeviceDesc.iSerialNumber, 0, - (PVOID*)&UsbChildExtension->usInstanceId.Buffer, + (PVOID*)&SerialBuffer, &UsbChildExtension->usInstanceId.Length); if (!NT_SUCCESS(Status)) { @@ -1022,15 +1028,31 @@ return Status; } - UsbChildExtension->usInstanceId.MaximumLength = UsbChildExtension->usInstanceId.Length; - DPRINT("Usb InstanceId %wZ\n", &UsbChildExtension->usInstanceId); + // construct instance id buffer + Index = swprintf(Buffer, L"%04d&%s", HubDeviceExtension->InstanceCount, SerialBuffer) + 1; + UsbChildExtension->usInstanceId.Buffer = (LPWSTR)ExAllocatePool(NonPagedPool, Index * sizeof(WCHAR)); + if (UsbChildExtension->usInstanceId.Buffer == NULL) + { + DPRINT1("Error: failed to allocate %lu bytes\n", Index * sizeof(WCHAR)); + Status = STATUS_INSUFFICIENT_RESOURCES; + return Status; + } + + // + // copy instance id + // + RtlCopyMemory(UsbChildExtension->usInstanceId.Buffer, Buffer, Index * sizeof(WCHAR)); + UsbChildExtension->usInstanceId.Length = UsbChildExtension->usInstanceId.MaximumLength = Index * sizeof(WCHAR); + ExFreePool(SerialBuffer); + + DPRINT("Usb InstanceId %wZ InstanceCount %x\n", &UsbChildExtension->usInstanceId, HubDeviceExtension->InstanceCount); } else { // // the device did not provide a serial number, lets create a pseudo instance id // - Index = swprintf(Buffer, L"0&%04d", UsbChildExtension->PortNumber) + 1; + Index = swprintf(Buffer, L"%04d&%04d", HubDeviceExtension->InstanceCount, UsbChildExtension->PortNumber) + 1; UsbChildExtension->usInstanceId.Buffer = (LPWSTR)ExAllocatePool(NonPagedPool, Index * sizeof(WCHAR)); if (UsbChildExtension->usInstanceId.Buffer == NULL) { @@ -1304,6 +1326,7 @@ } HubDeviceExtension->ChildDeviceObject[ChildDeviceCount] = NewChildDeviceObject; + HubDeviceExtension->InstanceCount++; IoInvalidateDeviceRelations(RootHubDeviceObject, BusRelations); return STATUS_SUCCESS; Modified: trunk/reactos/drivers/usb/usbhub/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/pdo.c?r…
============================================================================== --- trunk/reactos/drivers/usb/usbhub/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub/pdo.c [iso-8859-1] Mon Oct 22 11:33:26 2012 @@ -558,6 +558,7 @@ ULONG Index; ULONG bFound; PDEVICE_RELATIONS DeviceRelation; + PDEVICE_OBJECT ParentDevice; UsbChildExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension; Stack = IoGetCurrentIrpStackLocation(Irp); @@ -645,6 +646,7 @@ { PHUB_DEVICE_EXTENSION HubDeviceExtension = (PHUB_DEVICE_EXTENSION)UsbChildExtension->ParentDeviceObject->DeviceExtension; PUSB_BUS_INTERFACE_HUB_V5 HubInterface = &HubDeviceExtension->HubInterface; + ParentDevice = UsbChildExtension->ParentDeviceObject; DPRINT("IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n"); @@ -671,10 +673,13 @@ Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); + /* delete device */ + IoDeleteDevice(DeviceObject); + if (bFound) { - /* Delete the device object */ - IoDeleteDevice(DeviceObject); + /* invalidate device relations */ + IoInvalidateDeviceRelations(ParentDevice, BusRelations); } return STATUS_SUCCESS; @@ -730,6 +735,12 @@ // pass irp down IoSkipCurrentIrpStackLocation(Irp); return IoCallDriver(UsbChildExtension->ParentDeviceObject, Irp); + } + case IRP_MN_SURPRISE_REMOVAL: + { + DPRINT("[USBHUB] HandlePnp IRP_MN_SURPRISE_REMOVAL\n"); + Status = STATUS_SUCCESS; + break; } default: { Modified: trunk/reactos/drivers/usb/usbhub/usbhub.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/usbhub.…
============================================================================== --- trunk/reactos/drivers/usb/usbhub/usbhub.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub/usbhub.h [iso-8859-1] Mon Oct 22 11:33:26 2012 @@ -103,8 +103,9 @@ PVOID RootHubHandle; USB_BUS_INTERFACE_USBDI_V2 DeviceInterface; + UNICODE_STRING SymbolicLinkName; + ULONG InstanceCount; - UNICODE_STRING SymbolicLinkName; } HUB_DEVICE_EXTENSION, *PHUB_DEVICE_EXTENSION; // createclose.c Modified: trunk/reactos/drivers/usb/usbstor/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/fdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbstor/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbstor/fdo.c [iso-8859-1] Mon Oct 22 11:33:26 2012 @@ -125,10 +125,19 @@ IN OUT PIRP Irp) { NTSTATUS Status; - - DPRINT("Handling FDO removal\n"); - - /* We don't need to request removal of our children here */ + ULONG Index; + + DPRINT("Handling FDO removal %p\n", DeviceObject); + + /* FIXME: wait for devices finished processing */ + for(Index = 0; Index < 16; Index++) + { + if (DeviceExtension->ChildPDO[Index] != NULL) + { + DPRINT("Deleting PDO %p RefCount %x AttachedDevice %p \n", DeviceExtension->ChildPDO[Index], DeviceExtension->ChildPDO[Index]->ReferenceCount, DeviceExtension->ChildPDO[Index]->AttachedDevice); + IoDeleteDevice(DeviceExtension->ChildPDO[Index]); + } + } /* Send the IRP down the stack */ IoSkipCurrentIrpStackLocation(Irp); @@ -264,7 +273,7 @@ // // create pdo // - Status = USBSTOR_CreatePDO(DeviceObject, Index, &DeviceExtension->ChildPDO[Index]); + Status = USBSTOR_CreatePDO(DeviceObject, Index); // // check for failure @@ -282,6 +291,7 @@ // increment pdo index // Index++; + DeviceExtension->InstanceCount++; }while(Index < DeviceExtension->MaxLUN); @@ -340,8 +350,20 @@ switch(IoStack->MinorFunction) { + case IRP_MN_SURPRISE_REMOVAL: + { + DPRINT("IRP_MN_SURPRISE_REMOVAL %p\n", DeviceObject); + Irp->IoStatus.Status = STATUS_SUCCESS; + + // + // forward irp to next device object + // + IoSkipCurrentIrpStackLocation(Irp); + return IoCallDriver(DeviceExtension->LowerDeviceObject, Irp); + } case IRP_MN_QUERY_DEVICE_RELATIONS: { + DPRINT("IRP_MN_QUERY_DEVICE_RELATIONS %p\n", DeviceObject); Status = USBSTOR_FdoHandleDeviceRelations(DeviceExtension, Irp); break; } Modified: trunk/reactos/drivers/usb/usbstor/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/pdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbstor/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbstor/pdo.c [iso-8859-1] Mon Oct 22 11:33:26 2012 @@ -676,9 +676,9 @@ else { // - // FIXME: should use some random value - // - swprintf(Buffer, L"%s&%d", L"00000000", PDODeviceExtension->LUN); + // use instance count and LUN + // + swprintf(Buffer, L"%04d&%d", FDODeviceExtension->InstanceCount, PDODeviceExtension->LUN); } // @@ -897,7 +897,7 @@ // check if no unique id // Caps = (PDEVICE_CAPABILITIES)IoStack->Parameters.DeviceCapabilities.Capabilities; - Caps->UniqueID = TRUE; //FIXME + Caps->UniqueID = FALSE; // no unique id is supported Caps->Removable = TRUE; //FIXME } break; @@ -929,6 +929,11 @@ Status = STATUS_SUCCESS; break; } + case IRP_MN_SURPRISE_REMOVAL: + { + Status = STATUS_SUCCESS; + break; + } default: { // @@ -1256,13 +1261,19 @@ NTSTATUS USBSTOR_CreatePDO( IN PDEVICE_OBJECT DeviceObject, - IN UCHAR LUN, - OUT PDEVICE_OBJECT *ChildDeviceObject) + IN UCHAR LUN) { PDEVICE_OBJECT PDO; NTSTATUS Status; PPDO_DEVICE_EXTENSION PDODeviceExtension; PUFI_INQUIRY_RESPONSE Response; + PFDO_DEVICE_EXTENSION FDODeviceExtension; + + // + // get device extension + // + FDODeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + // // create child device object @@ -1292,7 +1303,7 @@ RtlZeroMemory(PDODeviceExtension, sizeof(PDO_DEVICE_EXTENSION)); PDODeviceExtension->Common.IsFDO = FALSE; PDODeviceExtension->LowerDeviceObject = DeviceObject; - PDODeviceExtension->PDODeviceObject = ChildDeviceObject; + PDODeviceExtension->PDODeviceObject = &FDODeviceExtension->ChildPDO[LUN]; PDODeviceExtension->Self = PDO; PDODeviceExtension->LUN = LUN; @@ -1309,7 +1320,7 @@ // // output device object // - *ChildDeviceObject = PDO; + FDODeviceExtension->ChildPDO[LUN] = PDO; // // send inquiry command by irp Modified: trunk/reactos/drivers/usb/usbstor/usbstor.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/usbsto…
============================================================================== --- trunk/reactos/drivers/usb/usbstor/usbstor.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbstor/usbstor.h [iso-8859-1] Mon Oct 22 11:33:26 2012 @@ -71,6 +71,7 @@ PSCSI_REQUEST_BLOCK LastTimerActiveSrb; // last timer tick active srb ULONG SrbErrorHandlingActive; // error handling of srb is activated ULONG TimerWorkQueueEnabled; // timer work queue enabled + ULONG InstanceCount; // pdo instance count }FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION; typedef struct @@ -364,8 +365,7 @@ NTSTATUS USBSTOR_CreatePDO( IN PDEVICE_OBJECT DeviceObject, - IN UCHAR LUN, - OUT PDEVICE_OBJECT *ChildDeviceObject); + IN UCHAR LUN); //--------------------------------------------------------------------- //
12 years
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
22
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
Results per page:
10
25
50
100
200