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
May 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
12 participants
227 discussions
Start a n
N
ew thread
[jimtabor] 56671: [Service Manager] - Patch by Hermes Belusca: Fix dialog painting. See bug 4965, marked as WIP.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon May 28 20:12:21 2012 New Revision: 56671 URL:
http://svn.reactos.org/svn/reactos?rev=56671&view=rev
Log: [Service Manager] - Patch by Hermes Belusca: Fix dialog painting. See bug 4965, marked as WIP. Modified: trunk/reactos/base/applications/mscutils/servman/progress.c trunk/reactos/base/applications/mscutils/servman/servman.c Modified: trunk/reactos/base/applications/mscutils/servman/progress.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/progress.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/progress.c [iso-8859-1] Mon May 28 20:12:21 2012 @@ -171,6 +171,12 @@ 0, lpProgStr); } + + /* Finally, show and update the progress dialog */ + ShowWindow(hProgDlg, SW_SHOWNORMAL); + UpdateWindow(hProgDlg); + + // TODO: Add a message loop for it ? } return hProgDlg; Modified: trunk/reactos/base/applications/mscutils/servman/servman.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/servman.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/servman.c [iso-8859-1] Mon May 28 20:12:21 2012 @@ -47,7 +47,7 @@ /* pump the message queue */ while( GetMessage( &Msg, NULL, 0, 0 ) ) { - //if(! IsDialogMessage(hProgDlg, &Msg) ) + //if ( !hProgDlg || !IsWindow(hProgDlg) || !IsDialogMessage(hProgDlg, &Msg) ) //{ TranslateMessage(&Msg); DispatchMessage(&Msg);
12 years, 7 months
1
0
0
0
[ekohl] 56670: [SAMSRV] Add Names sub keys to the Alias, Groups and Users keys of the Account an Builtin domains. These will later contain the 'Name to SID' entries that will simplify lookup by nam...
by ekohl@svn.reactos.org
Author: ekohl Date: Mon May 28 15:04:26 2012 New Revision: 56670 URL:
http://svn.reactos.org/svn/reactos?rev=56670&view=rev
Log: [SAMSRV] Add Names sub keys to the Alias, Groups and Users keys of the Account an Builtin domains. These will later contain the 'Name to SID' entries that will simplify lookup by name operations. Modified: trunk/reactos/dll/win32/samsrv/setup.c Modified: trunk/reactos/dll/win32/samsrv/setup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
============================================================================== --- trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Mon May 28 15:04:26 2012 @@ -56,6 +56,28 @@ static BOOL +CreateNamesKey(HKEY hParentKey) +{ + DWORD dwDisposition; + HKEY hNamesKey; + + if (RegCreateKeyExW(hParentKey, + L"Names", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hNamesKey, + &dwDisposition)) + return FALSE; + + RegCloseKey(hNamesKey); + return TRUE; +} + + +static BOOL CreateBuiltinAliases(HKEY hAliasesKey) { return TRUE; @@ -80,13 +102,14 @@ SampInitializeSAM(VOID) { DWORD dwDisposition; - HKEY hSamKey; - HKEY hDomainsKey; - HKEY hAccountKey; - HKEY hBuiltinKey; - HKEY hAliasesKey; - HKEY hGroupsKey; - HKEY hUsersKey; + HKEY hSamKey = NULL; + HKEY hDomainsKey = NULL; + HKEY hAccountKey = NULL; + HKEY hBuiltinKey = NULL; + HKEY hAliasesKey = NULL; + HKEY hGroupsKey = NULL; + HKEY hUsersKey = NULL; + BOOL bResult = TRUE; TRACE("SampInitializeSAM() called\n"); @@ -115,11 +138,12 @@ &dwDisposition)) { ERR("Failed to create 'Domains' key! (Error %lu)\n", GetLastError()); - RegCloseKey(hSamKey); - return FALSE; - } - - RegCloseKey (hSamKey); + bResult = FALSE; + goto done; + } + + RegCloseKey(hSamKey); + hSamKey = NULL; /* Create the 'Domains\\Account' key */ if (RegCreateKeyExW(hDomainsKey, @@ -133,8 +157,8 @@ &dwDisposition)) { ERR("Failed to create 'Domains\\Account' key! (Error %lu)\n", GetLastError()); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; } @@ -150,13 +174,19 @@ &dwDisposition)) { ERR("Failed to create 'Account\\Aliases' key! (Error %lu)\n", GetLastError()); - RegCloseKey(hAccountKey); - RegCloseKey(hDomainsKey); - return FALSE; - } - - RegCloseKey (hAliasesKey); - + bResult = FALSE; + goto done; + } + + if (!CreateNamesKey(hAliasesKey)) + { + ERR("Failed to create 'Account\\Aliases\\Names' key! (Error %lu)\n", GetLastError()); + bResult = FALSE; + goto done; + } + + RegCloseKey(hAliasesKey); + hAliasesKey = NULL; /* Create the 'Account\Groups' key */ if (RegCreateKeyExW(hAccountKey, @@ -170,12 +200,19 @@ &dwDisposition)) { ERR("Failed to create 'Account\\Groups' key! (Error %lu)\n", GetLastError()); - RegCloseKey(hAccountKey); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; + } + + if (!CreateNamesKey(hGroupsKey)) + { + ERR("Failed to create 'Account\\Groups\\Names' key! (Error %lu)\n", GetLastError()); + bResult = FALSE; + goto done; } RegCloseKey(hGroupsKey); + hGroupsKey = NULL; /* Create the 'Account\Users' key */ @@ -190,15 +227,22 @@ &dwDisposition)) { ERR("Failed to create 'Account\\Users' key! (Error %lu)\n", GetLastError()); - RegCloseKey(hAccountKey); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; + } + + if (!CreateNamesKey(hUsersKey)) + { + ERR("Failed to create 'Account\\Aliases\\Users' key! (Error %lu)\n", GetLastError()); + bResult = FALSE; + goto done; } RegCloseKey(hUsersKey); + hUsersKey = NULL; RegCloseKey(hAccountKey); - + hAccountKey = NULL; /* Create the 'Domains\\Builtin' */ if (RegCreateKeyExW(hDomainsKey, @@ -212,8 +256,8 @@ &dwDisposition)) { ERR("Failed to create Builtin key! (Error %lu)\n", GetLastError()); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; } @@ -229,23 +273,27 @@ &dwDisposition)) { ERR("Failed to create 'Builtin\\Aliases' key! (Error %lu)\n", GetLastError()); - RegCloseKey(hBuiltinKey); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; + } + + if (!CreateNamesKey(hAliasesKey)) + { + ERR("Failed to create 'Builtin\\Aliases\\Names' key! (Error %lu)\n", GetLastError()); + bResult = FALSE; + goto done; } /* Create builtin aliases */ if (!CreateBuiltinAliases(hAliasesKey)) { ERR("Failed to create builtin aliases!\n"); - RegCloseKey(hAliasesKey); - RegCloseKey(hBuiltinKey); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; } RegCloseKey(hAliasesKey); - + hAliasesKey = NULL; /* Create the 'Builtin\Groups' key */ if (RegCreateKeyExW(hBuiltinKey, @@ -259,22 +307,27 @@ &dwDisposition)) { ERR("Failed to create 'Builtin\\Groups' key! (Error %lu)\n", GetLastError()); - RegCloseKey(hBuiltinKey); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; + } + + if (!CreateNamesKey(hGroupsKey)) + { + ERR("Failed to create 'Builtin\\Groups\\Names' key! (Error %lu)\n", GetLastError()); + bResult = FALSE; + goto done; } /* Create builtin groups */ if (!CreateBuiltinGroups(hGroupsKey)) { ERR("Failed to create builtin groups!\n"); - RegCloseKey(hGroupsKey); - RegCloseKey(hBuiltinKey); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; } RegCloseKey(hGroupsKey); + hGroupsKey = NULL; /* Create the 'Builtin\Users' key */ @@ -289,28 +342,48 @@ &dwDisposition)) { ERR("Failed to create 'Builtin\\Users' key! (Error %lu)\n", GetLastError()); - RegCloseKey(hBuiltinKey); - RegCloseKey(hDomainsKey); - return FALSE; + bResult = FALSE; + goto done; + } + + if (!CreateNamesKey(hUsersKey)) + { + ERR("Failed to create 'Builtin\\Users\\Names' key! (Error %lu)\n", GetLastError()); + bResult = FALSE; + goto done; } /* Create builtin users */ if (!CreateBuiltinUsers(hUsersKey)) { ERR("Failed to create builtin users!\n"); + bResult = FALSE; + goto done; + } + +done: + if (hAliasesKey) + RegCloseKey(hAliasesKey); + + if (hGroupsKey) + RegCloseKey(hGroupsKey); + + if (hUsersKey) RegCloseKey(hUsersKey); + + if (hAccountKey) + RegCloseKey(hAccountKey); + + if (hBuiltinKey) RegCloseKey(hBuiltinKey); + + if (hDomainsKey) RegCloseKey(hDomainsKey); - return FALSE; - } - - RegCloseKey(hUsersKey); - - RegCloseKey(hBuiltinKey); - - RegCloseKey(hDomainsKey); + + if (hSamKey) + RegCloseKey(hSamKey); TRACE("SampInitializeSAM() done\n"); - return TRUE; -} + return bResult; +}
12 years, 7 months
1
0
0
0
[ekohl] 56669: [SAMSRV] - Support container objects in SampCreateDbObject. - Implement SampGetObjectAttribute and SampSetObjectAttribute.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon May 28 12:26:54 2012 New Revision: 56669 URL:
http://svn.reactos.org/svn/reactos?rev=56669&view=rev
Log: [SAMSRV] - Support container objects in SampCreateDbObject. - Implement SampGetObjectAttribute and SampSetObjectAttribute. Modified: trunk/reactos/dll/win32/samsrv/database.c trunk/reactos/dll/win32/samsrv/samsrv.h Modified: trunk/reactos/dll/win32/samsrv/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/database.…
============================================================================== --- trunk/reactos/dll/win32/samsrv/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/database.c [iso-8859-1] Mon May 28 12:26:54 2012 @@ -309,6 +309,7 @@ OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING KeyName; HANDLE ParentKeyHandle; + HANDLE ContainerKeyHandle = NULL; HANDLE ObjectKeyHandle; NTSTATUS Status; @@ -320,25 +321,73 @@ else ParentKeyHandle = ParentObject->KeyHandle; - RtlInitUnicodeString(&KeyName, - ObjectName); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ParentKeyHandle, - NULL); - - Status = NtCreateKey(&ObjectKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - 0, - NULL); - if (!NT_SUCCESS(Status)) - { - return Status; + if (ContainerName != NULL) + { + /* Open the container key */ + RtlInitUnicodeString(&KeyName, + ContainerName); + + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ParentKeyHandle, + NULL); + + Status = NtOpenKey(&ContainerKeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + /* Open the object key */ + RtlInitUnicodeString(&KeyName, + ObjectName); + + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ContainerKeyHandle, + NULL); + + Status = NtCreateKey(&ObjectKeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + 0, + NULL); + + NtClose(ContainerKeyHandle); + + if (!NT_SUCCESS(Status)) + { + return Status; + } + } + else + { + RtlInitUnicodeString(&KeyName, + ObjectName); + + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ParentKeyHandle, + NULL); + + Status = NtCreateKey(&ObjectKeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + 0, + NULL); + if (!NT_SUCCESS(Status)) + { + return Status; + } } NewObject = RtlAllocateHeap(RtlGetProcessHeap(), @@ -553,120 +602,82 @@ } -#if 0 NTSTATUS -LsapSetObjectAttribute(PLSA_DB_OBJECT DbObject, +SampSetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, + ULONG AttributeType, LPVOID AttributeData, ULONG AttributeSize) { - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName; - HANDLE AttributeKey; - NTSTATUS Status; - - RtlInitUnicodeString(&KeyName, + UNICODE_STRING ValueName; + + RtlInitUnicodeString(&ValueName, AttributeName); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - DbObject->KeyHandle, - NULL); - - Status = NtCreateKey(&AttributeKey, - KEY_SET_VALUE, - &ObjectAttributes, - 0, - NULL, - REG_OPTION_NON_VOLATILE, - NULL); - if (!NT_SUCCESS(Status)) - { - - return Status; - } - - Status = RtlpNtSetValueKey(AttributeKey, - REG_NONE, - AttributeData, - AttributeSize); - - NtClose(AttributeKey); - - return Status; + return ZwSetValueKey(DbObject->KeyHandle, + &ValueName, + 0, + AttributeType, + AttributeData, + AttributeSize); } NTSTATUS -LsapGetObjectAttribute(PLSA_DB_OBJECT DbObject, +SampGetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, + PULONG AttributeType, LPVOID AttributeData, PULONG AttributeSize) { - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName; - HANDLE AttributeKey; - ULONG ValueSize; + PKEY_VALUE_PARTIAL_INFORMATION ValueInfo; + UNICODE_STRING ValueName; + ULONG BufferLength = 0; NTSTATUS Status; - RtlInitUnicodeString(&KeyName, + RtlInitUnicodeString(&ValueName, AttributeName); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - DbObject->KeyHandle, - NULL); - - Status = NtOpenKey(&AttributeKey, - KEY_QUERY_VALUE, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - return Status; - } - - ValueSize = *AttributeSize; - Status = RtlpNtQueryValueKey(AttributeKey, - NULL, - NULL, - &ValueSize, - 0); - if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_OVERFLOW) - { - goto Done; - } - - if (AttributeData == NULL || *AttributeSize == 0) - { - *AttributeSize = ValueSize; - Status = STATUS_SUCCESS; - goto Done; - } - else if (*AttributeSize < ValueSize) - { - *AttributeSize = ValueSize; - Status = STATUS_BUFFER_OVERFLOW; - goto Done; - } - - Status = RtlpNtQueryValueKey(AttributeKey, - NULL, - AttributeData, - &ValueSize, - 0); - if (NT_SUCCESS(Status)) - { - *AttributeSize = ValueSize; - } - -Done: - NtClose(AttributeKey); + if (AttributeSize != NULL) + BufferLength = *AttributeSize; + + BufferLength += FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); + + /* Allocate memory for the value */ + ValueInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); + if (ValueInfo == NULL) + return STATUS_NO_MEMORY; + + /* Query the value */ + Status = ZwQueryValueKey(DbObject->KeyHandle, + &ValueName, + KeyValuePartialInformation, + ValueInfo, + BufferLength, + &BufferLength); + if ((NT_SUCCESS(Status)) || (Status == STATUS_BUFFER_OVERFLOW)) + { + if (AttributeType != NULL) + *AttributeType = ValueInfo->Type; + + if (AttributeSize != NULL) + *AttributeSize = ValueInfo->DataLength; + } + + /* Check if the caller wanted data back, and we got it */ + if ((NT_SUCCESS(Status)) && (AttributeData != NULL)) + { + /* Copy it */ + RtlMoveMemory(AttributeData, + ValueInfo->Data, + ValueInfo->DataLength); + } + + /* Free the memory and return status */ + RtlFreeHeap(RtlGetProcessHeap(), 0, ValueInfo); return Status; } -#endif /* EOF */ Modified: trunk/reactos/dll/win32/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.h?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] Mon May 28 12:26:54 2012 @@ -75,6 +75,20 @@ NTSTATUS SampCloseDbObject(PSAM_DB_OBJECT DbObject); +NTSTATUS +SampSetObjectAttribute(PSAM_DB_OBJECT DbObject, + LPWSTR AttributeName, + ULONG AttributeType, + LPVOID AttributeData, + ULONG AttributeSize); + +NTSTATUS +SampGetObjectAttribute(PSAM_DB_OBJECT DbObject, + LPWSTR AttributeName, + PULONG AttributeType, + LPVOID AttributeData, + PULONG AttributeSize); + /* samspc.c */ VOID SampStartRpcServer(VOID);
12 years, 7 months
1
0
0
0
[tfaber] 56668: [LIBUSB][USBCCGP] - Whitespace and DPRINT fixes
by tfaber@svn.reactos.org
Author: tfaber Date: Mon May 28 10:49:44 2012 New Revision: 56668 URL:
http://svn.reactos.org/svn/reactos?rev=56668&view=rev
Log: [LIBUSB][USBCCGP] - Whitespace and DPRINT fixes Modified: trunk/reactos/drivers/usb/usbccgp/function.c trunk/reactos/drivers/usb/usbccgp/misc.c trunk/reactos/drivers/usb/usbccgp/pdo.c trunk/reactos/lib/drivers/libusb/hub_controller.cpp trunk/reactos/lib/drivers/libusb/usb_device.cpp Modified: trunk/reactos/drivers/usb/usbccgp/function.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/functi…
============================================================================== --- trunk/reactos/drivers/usb/usbccgp/function.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbccgp/function.c [iso-8859-1] Mon May 28 10:49:44 2012 @@ -56,7 +56,7 @@ // // initialize request // - Stack=IoGetNextIrpStackLocation(Irp); + Stack = IoGetNextIrpStackLocation(Irp); Stack->MajorFunction = IRP_MJ_PNP; Stack->MinorFunction = IRP_MN_QUERY_INTERFACE; Stack->Parameters.QueryInterface.Size = sizeof(BUS_INTERFACE_STANDARD); @@ -69,7 +69,7 @@ // // call driver // - Status= IoCallDriver(DeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); // // did operation complete @@ -116,14 +116,14 @@ // // invoke callback // - Status = FDODeviceExtension->BusInterface.StartDeviceCallback(FDODeviceExtension->DeviceDescriptor, - FDODeviceExtension->ConfigurationDescriptor, + Status = FDODeviceExtension->BusInterface.StartDeviceCallback(FDODeviceExtension->DeviceDescriptor, + FDODeviceExtension->ConfigurationDescriptor, &FunctionDescriptorBuffer, &FunctionDescriptorBufferLength, DeviceObject, FDODeviceExtension->PhysicalDeviceObject); - DPRINT("USBCCGP_CustomEnumWithInterface Status %x\n", Status); + DPRINT("USBCCGP_CustomEnumWithInterface Status %lx\n", Status); if (!NT_SUCCESS(Status)) { // @@ -167,7 +167,7 @@ Offset = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->bLength; End = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->wTotalLength; - while(Offset < End) + while (Offset < End) { // // get association descriptor @@ -209,7 +209,7 @@ Offset = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->bLength; End = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->wTotalLength; - while(Offset < End) + while (Offset < End) { // // get association descriptor @@ -260,7 +260,7 @@ Offset = (PUCHAR)AssociationDescriptor + AssociationDescriptor->bLength; End = (PUCHAR)ConfigurationDescriptor + ConfigurationDescriptor->wTotalLength; - while(Offset < End) + while (Offset < End) { // // get association descriptor @@ -358,8 +358,8 @@ // get interface description // Status = USBCCGP_GetStringDescriptor(FDODeviceExtension->NextDeviceObject, - 100 * sizeof(WCHAR), - Descriptor->iFunction, + 100 * sizeof(WCHAR), + Descriptor->iFunction, 0x0409, //FIXME (PVOID*)&DescriptionBuffer); if (!NT_SUCCESS(Status)) @@ -406,7 +406,6 @@ FunctionDescriptor->HardwareId.Length = Index * sizeof(WCHAR); FunctionDescriptor->HardwareId.MaximumLength = (Index + 1) * sizeof(WCHAR); - // // now init the compatible id // @@ -475,7 +474,7 @@ return STATUS_INSUFFICIENT_RESOURCES; } - for(Index = 0; Index < DescriptorCount; Index++) + for (Index = 0; Index < DescriptorCount; Index++) { // // init function descriptors @@ -552,8 +551,8 @@ FDODeviceExtension->DeviceDescriptor->bcdDevice, FunctionIndex) + 1; Index += swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, - FDODeviceExtension->DeviceDescriptor->idProduct, - FunctionIndex) + 1; + FDODeviceExtension->DeviceDescriptor->idProduct, + FunctionIndex) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); @@ -637,7 +636,7 @@ // // init function descriptors // - for(Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++) + for (Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++) { // get interface descriptor InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(FDODeviceExtension->ConfigurationDescriptor, FDODeviceExtension->ConfigurationDescriptor, Index, 0, -1, -1, -1); @@ -679,7 +678,7 @@ // // failed to init ids // - DPRINT1("[USBCCGP] Failed to init ids with %x\n", Status); + DPRINT1("[USBCCGP] Failed to init ids with %lx\n", Status); return Status; } @@ -722,7 +721,7 @@ // // first check if all interfaces belong to the same audio class // - for(Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++) + for (Index = 0; Index < FDODeviceExtension->ConfigurationDescriptor->bNumInterfaces; Index++) { // // get interface descriptor @@ -789,7 +788,7 @@ // // failed to allocate descriptor array // - DPRINT1("[USBCCGP] Failed to allocate descriptor array %x\n", Status); + DPRINT1("[USBCCGP] Failed to allocate descriptor array %lx\n", Status); return Status; } @@ -802,7 +801,7 @@ // // failed to init ids // - DPRINT1("[USBCCGP] Failed to init ids with %x\n", Status); + DPRINT1("[USBCCGP] Failed to init ids with %lx\n", Status); return Status; } Modified: trunk/reactos/drivers/usb/usbccgp/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/misc.c…
============================================================================== --- trunk/reactos/drivers/usb/usbccgp/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbccgp/misc.c [iso-8859-1] Mon May 28 10:49:44 2012 @@ -18,7 +18,7 @@ NTAPI USBSTOR_SyncForwardIrpCompletionRoutine( PDEVICE_OBJECT DeviceObject, - PIRP Irp, + PIRP Irp, PVOID Context) { if (Irp->PendingReturned) @@ -162,7 +162,7 @@ DPRINT1("FunctionCount %lu\n", FunctionDescriptorCount); - for(Index = 0; Index < FunctionDescriptorCount; Index++) + for (Index = 0; Index < FunctionDescriptorCount; Index++) { DPRINT1("Function %lu\n", Index); DPRINT1("FunctionNumber %lu\n", FunctionDescriptor[Index].FunctionNumber); Modified: trunk/reactos/drivers/usb/usbccgp/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/pdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbccgp/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbccgp/pdo.c [iso-8859-1] Mon May 28 10:49:44 2012 @@ -136,7 +136,7 @@ // count length of string // String = DeviceId; - while(*String) + while (*String) { StringLength = wcslen(String) + 1; Length += StringLength; @@ -161,7 +161,7 @@ // *OutString = String; - while(*DeviceId) + while (*DeviceId) { StringLength = swprintf(String, L"%s&MI_%02x", DeviceId, InterfaceNumber) + 1; Length = wcslen(DeviceId) + 1; @@ -225,7 +225,7 @@ DPRINT("BusQueryDeviceID %S\n", Buffer); ExFreePool((PVOID)Irp->IoStatus.Information); - Irp->IoStatus .Information = (ULONG_PTR)Buffer; + Irp->IoStatus.Information = (ULONG_PTR)Buffer; } else { @@ -334,76 +334,76 @@ switch(IoStack->MinorFunction) { - case IRP_MN_QUERY_DEVICE_RELATIONS: - { - // - // handle device relations - // - Status = USBCCGP_PdoHandleDeviceRelations(DeviceObject, Irp); - break; - } - case IRP_MN_QUERY_DEVICE_TEXT: - { - // - // handle query device text - // - Status = USBCCGP_PdoHandleQueryDeviceText(DeviceObject, Irp); - break; - } - case IRP_MN_QUERY_ID: - { - // - // handle request - // - Status = USBCCGP_PdoHandleQueryId(DeviceObject, Irp); - break; - } - case IRP_MN_REMOVE_DEVICE: - { - // - // remove us from the fdo's pdo list - // - bFound = FALSE; - for(Index = 0; Index < PDODeviceExtension->FDODeviceExtension->FunctionDescriptorCount; Index++) - { - if (PDODeviceExtension->FDODeviceExtension->ChildPDO[Index] == DeviceObject) - { - // - // remove us - // - PDODeviceExtension->FDODeviceExtension->ChildPDO[Index] = NULL; - bFound = TRUE; - break; - } - } - - // - // Complete the IRP - // - Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - if (bFound) - { - // - // Delete the device object - // - IoDeleteDevice(DeviceObject); - } - return STATUS_SUCCESS; - } - case IRP_MN_QUERY_CAPABILITIES: - { - // - // copy device capabilities - // - RtlCopyMemory(IoStack->Parameters.DeviceCapabilities.Capabilities, &PDODeviceExtension->Capabilities, sizeof(DEVICE_CAPABILITIES)); - - /* Complete the IRP */ - Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; - } + case IRP_MN_QUERY_DEVICE_RELATIONS: + { + // + // handle device relations + // + Status = USBCCGP_PdoHandleDeviceRelations(DeviceObject, Irp); + break; + } + case IRP_MN_QUERY_DEVICE_TEXT: + { + // + // handle query device text + // + Status = USBCCGP_PdoHandleQueryDeviceText(DeviceObject, Irp); + break; + } + case IRP_MN_QUERY_ID: + { + // + // handle request + // + Status = USBCCGP_PdoHandleQueryId(DeviceObject, Irp); + break; + } + case IRP_MN_REMOVE_DEVICE: + { + // + // remove us from the fdo's pdo list + // + bFound = FALSE; + for(Index = 0; Index < PDODeviceExtension->FDODeviceExtension->FunctionDescriptorCount; Index++) + { + if (PDODeviceExtension->FDODeviceExtension->ChildPDO[Index] == DeviceObject) + { + // + // remove us + // + PDODeviceExtension->FDODeviceExtension->ChildPDO[Index] = NULL; + bFound = TRUE; + break; + } + } + + // + // Complete the IRP + // + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + if (bFound) + { + // + // Delete the device object + // + IoDeleteDevice(DeviceObject); + } + return STATUS_SUCCESS; + } + case IRP_MN_QUERY_CAPABILITIES: + { + // + // copy device capabilities + // + RtlCopyMemory(IoStack->Parameters.DeviceCapabilities.Capabilities, &PDODeviceExtension->Capabilities, sizeof(DEVICE_CAPABILITIES)); + + /* Complete the IRP */ + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + } case IRP_MN_QUERY_REMOVE_DEVICE: case IRP_MN_QUERY_STOP_DEVICE: { @@ -413,24 +413,24 @@ Status = STATUS_SUCCESS; break; } - case IRP_MN_START_DEVICE: - { - // - // no-op for PDO - // - DPRINT("[USBCCGP] PDO IRP_MN_START\n"); - Status = STATUS_SUCCESS; - break; - } - case IRP_MN_QUERY_INTERFACE: - { - // - // forward to lower device object - // - IoSkipCurrentIrpStackLocation(Irp); - return IoCallDriver(PDODeviceExtension->NextDeviceObject, Irp); - } - default: + case IRP_MN_START_DEVICE: + { + // + // no-op for PDO + // + DPRINT("[USBCCGP] PDO IRP_MN_START\n"); + Status = STATUS_SUCCESS; + break; + } + case IRP_MN_QUERY_INTERFACE: + { + // + // forward to lower device object + // + IoSkipCurrentIrpStackLocation(Irp); + return IoCallDriver(PDODeviceExtension->NextDeviceObject, Irp); + } + default: { // // do nothing @@ -465,7 +465,7 @@ NTSTATUS USBCCGP_BuildConfigurationDescriptor( - PDEVICE_OBJECT DeviceObject, + PDEVICE_OBJECT DeviceObject, PIRP Irp) { PIO_STACK_LOCATION IoStack; @@ -501,7 +501,7 @@ // TotalSize = sizeof(USB_CONFIGURATION_DESCRIPTOR); - for(Index = 0; Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; Index++) + for (Index = 0; Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; Index++) { // // get current interface descriptor @@ -555,7 +555,7 @@ // move to next descriptor // InterfaceDescriptor = (PUSB_INTERFACE_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength); - }while(TRUE); + } while(TRUE); } // @@ -577,7 +577,7 @@ RtlCopyMemory(Buffer, ConfigurationDescriptor, sizeof(USB_CONFIGURATION_DESCRIPTOR)); BufferPtr = (PUCHAR)((ULONG_PTR)Buffer + ConfigurationDescriptor->bLength); - for(Index = 0; Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; Index++) + for (Index = 0; Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; Index++) { // // get current interface descriptor @@ -634,7 +634,7 @@ // move to next descriptor // InterfaceDescriptor = (PUSB_INTERFACE_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength); - }while(TRUE); + } while(TRUE); } // @@ -674,7 +674,7 @@ NTSTATUS USBCCGP_PDOSelectConfiguration( - PDEVICE_OBJECT DeviceObject, + PDEVICE_OBJECT DeviceObject, PIRP Irp) { PIO_STACK_LOCATION IoStack; @@ -736,7 +736,7 @@ // search for the interface in the local interface list // FoundInterface = FALSE; - for(InterfaceIndex = 0; InterfaceIndex < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; InterfaceIndex++) + for (InterfaceIndex = 0; InterfaceIndex < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; InterfaceIndex++) { if (PDODeviceExtension->FunctionDescriptor->InterfaceDescriptorList[InterfaceIndex]->bInterfaceNumber == InterfaceInformation->InterfaceNumber) { @@ -760,7 +760,7 @@ // now query the total interface list // Entry = NULL; - for(InterfaceIndex = 0; InterfaceIndex < PDODeviceExtension->InterfaceListCount; InterfaceIndex++) + for (InterfaceIndex = 0; InterfaceIndex < PDODeviceExtension->InterfaceListCount; InterfaceIndex++) { if (PDODeviceExtension->InterfaceList[InterfaceIndex].Interface->InterfaceNumber == InterfaceInformation->InterfaceNumber) { @@ -786,7 +786,6 @@ NeedSelect = FALSE; if (Entry->InterfaceDescriptor->bAlternateSetting == InterfaceInformation->AlternateSetting) { - for(InterfaceIndex = 0; InterfaceIndex < InterfaceInformation->NumberOfPipes; InterfaceIndex++) { if (InterfaceInformation->Pipes[InterfaceIndex].MaximumTransferSize != Entry->Interface->Pipes[InterfaceIndex].MaximumTransferSize) @@ -894,7 +893,7 @@ FreeItem(NewUrb); } - }while(Length); + } while(Length); // // store configuration handle @@ -911,7 +910,7 @@ NTSTATUS PDO_HandleInternalDeviceControl( - PDEVICE_OBJECT DeviceObject, + PDEVICE_OBJECT DeviceObject, PIRP Irp) { PIO_STACK_LOCATION IoStack; @@ -950,7 +949,7 @@ } else if (Urb->UrbHeader.Function == URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE) { - if(Urb->UrbControlDescriptorRequest.DescriptorType == USB_DEVICE_DESCRIPTOR_TYPE) + if (Urb->UrbControlDescriptorRequest.DescriptorType == USB_DEVICE_DESCRIPTOR_TYPE) { // // is the buffer big enough @@ -1047,8 +1046,6 @@ return Status; } - - DPRINT1("IOCTL %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode); DPRINT1("InputBufferLength %lu\n", IoStack->Parameters.DeviceIoControl.InputBufferLength); DPRINT1("OutputBufferLength %lu\n", IoStack->Parameters.DeviceIoControl.OutputBufferLength); @@ -1064,7 +1061,7 @@ NTSTATUS PDO_Dispatch( - PDEVICE_OBJECT DeviceObject, + PDEVICE_OBJECT DeviceObject, PIRP Irp) { PIO_STACK_LOCATION IoStack; @@ -1085,5 +1082,4 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } - } Modified: trunk/reactos/lib/drivers/libusb/hub_controller.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hub_con…
============================================================================== --- trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] Mon May 28 10:49:44 2012 @@ -965,7 +965,7 @@ Status = m_Hardware->ClearPortStatus(PortId, C_PORT_CONNECTION); break; case C_PORT_RESET: - Status= m_Hardware->ClearPortStatus(PortId, C_PORT_RESET); + Status = m_Hardware->ClearPortStatus(PortId, C_PORT_RESET); break; default: DPRINT("[USBLIB] Unknown Value for Clear Feature %x \n", Urb->UrbControlVendorClassRequest.Value); @@ -1209,31 +1209,30 @@ UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle); - // - // generate setup packet - // - CtrlSetup.bRequest = USB_REQUEST_GET_STATUS; - CtrlSetup.wValue.LowByte = 0; - CtrlSetup.wValue.HiByte = 0; - CtrlSetup.wIndex.W = Urb->UrbControlGetStatusRequest.Index; - CtrlSetup.wLength = (USHORT)Urb->UrbControlGetStatusRequest.TransferBufferLength; - CtrlSetup.bmRequestType.B = 0x80; - - - if (Urb->UrbHeader.Function == URB_FUNCTION_GET_STATUS_FROM_INTERFACE) - { - // - // add interface type - // - CtrlSetup.bmRequestType.B |= 0x01; - } - else if (Urb->UrbHeader.Function == URB_FUNCTION_GET_STATUS_FROM_ENDPOINT) - { - // - // add interface type - // - CtrlSetup.bmRequestType.B |= 0x02; - } + // + // generate setup packet + // + CtrlSetup.bRequest = USB_REQUEST_GET_STATUS; + CtrlSetup.wValue.LowByte = 0; + CtrlSetup.wValue.HiByte = 0; + CtrlSetup.wIndex.W = Urb->UrbControlGetStatusRequest.Index; + CtrlSetup.wLength = (USHORT)Urb->UrbControlGetStatusRequest.TransferBufferLength; + CtrlSetup.bmRequestType.B = 0x80; + + if (Urb->UrbHeader.Function == URB_FUNCTION_GET_STATUS_FROM_INTERFACE) + { + // + // add interface type + // + CtrlSetup.bmRequestType.B |= 0x01; + } + else if (Urb->UrbHeader.Function == URB_FUNCTION_GET_STATUS_FROM_ENDPOINT) + { + // + // add interface type + // + CtrlSetup.bmRequestType.B |= 0x02; + } // // submit setup packet Modified: trunk/reactos/lib/drivers/libusb/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/usb_dev…
============================================================================== --- trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] Mon May 28 10:49:44 2012 @@ -380,7 +380,7 @@ RtlZeroMemory(m_ConfigurationDescriptors, sizeof(USB_CONFIGURATION) * m_DeviceDescriptor.bNumConfigurations); // retrieve the configuration descriptors - for(Index = 0; Index < m_DeviceDescriptor.bNumConfigurations; Index++) + for (Index = 0; Index < m_DeviceDescriptor.bNumConfigurations; Index++) { // retrieve configuration descriptors from device Status = CreateConfigurationDescriptor(Index); @@ -1029,7 +1029,7 @@ if (ConfigurationDescriptor) { // find configuration index - for(Index = 0; Index < m_DeviceDescriptor.bNumConfigurations; Index++) + for (Index = 0; Index < m_DeviceDescriptor.bNumConfigurations; Index++) { if (m_ConfigurationDescriptors[Index].ConfigurationDescriptor->bConfigurationValue == ConfigurationDescriptor->bConfigurationValue) { @@ -1041,7 +1041,7 @@ if (!Found) { - DPRINT1("[USBLIB] invalid configuration value %lu\n", ConfigurationDescriptor->bConfigurationValue); + DPRINT1("[USBLIB] invalid configuration value %u\n", ConfigurationDescriptor->bConfigurationValue); return STATUS_INVALID_PARAMETER; } @@ -1063,13 +1063,13 @@ if (!ConfigurationDescriptor) { // unconfigure request - DPRINT1("CUSBDevice::SelectConfiguration Unconfigure Request Status %x\n", Status); + DPRINT1("CUSBDevice::SelectConfiguration Unconfigure Request Status %lx\n", Status); m_ConfigurationIndex = 0; return Status; } // informal debug print - DPRINT1("CUSBDevice::SelectConfiguration New Configuration %x Old Configuration %x Result %x\n", ConfigurationIndex, m_ConfigurationIndex, Status); + DPRINT1("CUSBDevice::SelectConfiguration New Configuration %x Old Configuration %x Result %lx\n", ConfigurationIndex, m_ConfigurationIndex, Status); if (!NT_SUCCESS(Status)) { // @@ -1079,7 +1079,7 @@ } // destroy old interface info - while(!IsListEmpty(&m_ConfigurationDescriptors[m_ConfigurationIndex].InterfaceList)) + while (!IsListEmpty(&m_ConfigurationDescriptors[m_ConfigurationIndex].InterfaceList)) { // remove entry Entry = RemoveHeadList(&m_ConfigurationDescriptors[m_ConfigurationIndex].InterfaceList); @@ -1180,9 +1180,9 @@ Status = CommitSetupPacket(&CtrlSetup, NULL, 0, NULL); // informal debug print - DPRINT1("CUSBDevice::SelectInterface AlternateSetting %x InterfaceNumber %x Status %x\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status); + DPRINT1("CUSBDevice::SelectInterface AlternateSetting %x InterfaceNumber %x Status %lx\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status); #if 0 - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { // failed to select interface return Status; @@ -1190,12 +1190,11 @@ #endif Status = STATUS_SUCCESS; - // find interface Found = FALSE; Entry = m_ConfigurationDescriptors[ConfigurationIndex].InterfaceList.Flink; - while(Entry != &m_ConfigurationDescriptors[ConfigurationIndex].InterfaceList) + while (Entry != &m_ConfigurationDescriptors[ConfigurationIndex].InterfaceList) { // grab interface descriptor UsbInterface = (PUSB_INTERFACE)CONTAINING_RECORD(Entry, USB_INTERFACE, ListEntry); @@ -1241,7 +1240,7 @@ InterfaceInfo->NumberOfPipes = UsbInterface->InterfaceDescriptor->bNumEndpoints; // copy pipe handles - for(PipeIndex = 0; PipeIndex < UsbInterface->InterfaceDescriptor->bNumEndpoints; PipeIndex++) + for (PipeIndex = 0; PipeIndex < UsbInterface->InterfaceDescriptor->bNumEndpoints; PipeIndex++) { // copy pipe handle DPRINT1("PipeIndex %lu\n", PipeIndex); @@ -1250,7 +1249,7 @@ DPRINT1("MaximumPacketSize %d\n", InterfaceInfo->Pipes[PipeIndex].MaximumPacketSize); DPRINT1("MaximumTransferSize %d\n", InterfaceInfo->Pipes[PipeIndex].MaximumTransferSize); DPRINT1("PipeFlags %d\n", InterfaceInfo->Pipes[PipeIndex].PipeFlags); - DPRINT1("PipeType %dd\n", InterfaceInfo->Pipes[PipeIndex].PipeType); + DPRINT1("PipeType %d\n", InterfaceInfo->Pipes[PipeIndex].PipeType); DPRINT1("UsbEndPoint %x\n", InterfaceInfo->Pipes[PipeIndex].EndpointAddress); // sanity checks @@ -1264,7 +1263,6 @@ UsbInterface->EndPoints[PipeIndex].DataToggle = FALSE; } - // // done //
12 years, 7 months
1
0
0
0
[tfaber] 56667: [LIBUSB][USBCCGP][USBEHCI] - Return the actual number of bytes copied for configuration descriptor requests - Fix MSVC warnings and NULL vs 0 vs FALSE issues
by tfaber@svn.reactos.org
Author: tfaber Date: Mon May 28 10:34:45 2012 New Revision: 56667 URL:
http://svn.reactos.org/svn/reactos?rev=56667&view=rev
Log: [LIBUSB][USBCCGP][USBEHCI] - Return the actual number of bytes copied for configuration descriptor requests - Fix MSVC warnings and NULL vs 0 vs FALSE issues Modified: trunk/reactos/drivers/usb/usbccgp/pdo.c trunk/reactos/drivers/usb/usbehci/usb_request.cpp trunk/reactos/lib/drivers/libusb/hub_controller.cpp trunk/reactos/lib/drivers/libusb/usb_device.cpp Modified: trunk/reactos/drivers/usb/usbccgp/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/pdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbccgp/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbccgp/pdo.c [iso-8859-1] Mon May 28 10:34:45 2012 @@ -473,6 +473,7 @@ PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; ULONG TotalSize, Index; + ULONG Size; PURB Urb; PVOID Buffer; PUCHAR BufferPtr; @@ -640,7 +641,7 @@ // modify configuration descriptor // ConfigurationDescriptor = Buffer; - ConfigurationDescriptor->wTotalLength = TotalSize; + ConfigurationDescriptor->wTotalLength = (USHORT)TotalSize; ConfigurationDescriptor->bNumInterfaces = PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces; // @@ -652,12 +653,13 @@ // // copy descriptor // - RtlCopyMemory(Urb->UrbControlDescriptorRequest.TransferBuffer, Buffer, min(TotalSize, Urb->UrbControlDescriptorRequest.TransferBufferLength)); + Size = min(TotalSize, Urb->UrbControlDescriptorRequest.TransferBufferLength); + RtlCopyMemory(Urb->UrbControlDescriptorRequest.TransferBuffer, Buffer, Size); // // store final size // - Urb->UrbControlDescriptorRequest.TransferBufferLength = TotalSize; + Urb->UrbControlDescriptorRequest.TransferBufferLength = Size; // // free buffer @@ -846,7 +848,7 @@ // // now prepare interface urb // - UsbBuildSelectInterfaceRequest(NewUrb, GET_SELECT_INTERFACE_REQUEST_SIZE(InterfaceInformation->NumberOfPipes), PDODeviceExtension->ConfigurationHandle, InterfaceInformation->InterfaceNumber, InterfaceInformation->AlternateSetting); + UsbBuildSelectInterfaceRequest(NewUrb, (USHORT)GET_SELECT_INTERFACE_REQUEST_SIZE(InterfaceInformation->NumberOfPipes), PDODeviceExtension->ConfigurationHandle, InterfaceInformation->InterfaceNumber, InterfaceInformation->AlternateSetting); // // now select the interface Modified: trunk/reactos/drivers/usb/usbehci/usb_request.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/usb_re…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/usb_request.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/usb_request.cpp [iso-8859-1] Mon May 28 10:34:45 2012 @@ -538,7 +538,7 @@ // initialized with setup packet, must be a control transfer // TransferType = USB_ENDPOINT_TYPE_CONTROL; - ASSERT(m_EndpointDescriptor == FALSE); + ASSERT(m_EndpointDescriptor == NULL); } // Modified: trunk/reactos/lib/drivers/libusb/hub_controller.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hub_con…
============================================================================== --- trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] Mon May 28 10:34:45 2012 @@ -1293,7 +1293,6 @@ // generate setup packet // CtrlSetup.bRequest = USB_REQUEST_GET_STATUS; - CtrlSetup.wValue.LowByte = Urb->UrbControlVendorClassRequest.Index; CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value; CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index; CtrlSetup.wLength = (USHORT)Urb->UrbControlGetStatusRequest.TransferBufferLength; @@ -1410,7 +1409,7 @@ CtrlSetup.bRequest = Urb->UrbControlVendorClassRequest.Request; CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value; CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index; - CtrlSetup.wLength = Urb->UrbControlVendorClassRequest.TransferBufferLength; + CtrlSetup.wLength = (USHORT)Urb->UrbControlVendorClassRequest.TransferBufferLength; if (Urb->UrbControlVendorClassRequest.TransferFlags & USBD_TRANSFER_DIRECTION_IN) { @@ -1758,7 +1757,7 @@ CtrlSetup.bRequest = Urb->UrbControlVendorClassRequest.Request; CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value; CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index; - CtrlSetup.wLength = Urb->UrbControlVendorClassRequest.TransferBufferLength; + CtrlSetup.wLength = (USHORT)Urb->UrbControlVendorClassRequest.TransferBufferLength; if (Urb->UrbControlVendorClassRequest.TransferFlags & USBD_TRANSFER_DIRECTION_IN) { @@ -1830,7 +1829,7 @@ CtrlSetup.bRequest = Urb->UrbControlVendorClassRequest.Request; CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value; CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index; - CtrlSetup.wLength = Urb->UrbControlVendorClassRequest.TransferBufferLength; + CtrlSetup.wLength = (USHORT)Urb->UrbControlVendorClassRequest.TransferBufferLength; if (Urb->UrbControlVendorClassRequest.TransferFlags & USBD_TRANSFER_DIRECTION_IN) { @@ -2096,7 +2095,7 @@ CtrlSetup.bRequest = Urb->UrbControlVendorClassRequest.Request; CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value; CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index; - CtrlSetup.wLength = Urb->UrbControlVendorClassRequest.TransferBufferLength; + CtrlSetup.wLength = (USHORT)Urb->UrbControlVendorClassRequest.TransferBufferLength; if (Urb->UrbControlVendorClassRequest.TransferFlags & USBD_TRANSFER_DIRECTION_IN) { Modified: trunk/reactos/lib/drivers/libusb/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/usb_dev…
============================================================================== --- trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] Mon May 28 10:34:45 2012 @@ -323,7 +323,7 @@ CtrlSetup->wValue.W = DeviceAddress; // set device address - Status = CommitSetupPacket(CtrlSetup, 0, 0, 0); + Status = CommitSetupPacket(CtrlSetup, NULL, 0, NULL); // free setup packet ExFreePoolWithTag(CtrlSetup, TAG_USBLIB); @@ -640,7 +640,7 @@ // // commit setup packet // - Status = CommitSetupPacket(&CtrlSetup, 0, sizeof(USB_DEVICE_DESCRIPTOR), Mdl); + Status = CommitSetupPacket(&CtrlSetup, NULL, sizeof(USB_DEVICE_DESCRIPTOR), Mdl); // // now free the mdl @@ -713,7 +713,7 @@ // // commit packet // - Status = CommitSetupPacket(&CtrlSetup, 0, BufferSize, Mdl); + Status = CommitSetupPacket(&CtrlSetup, NULL, BufferSize, Mdl); // // free mdl @@ -809,6 +809,8 @@ IN ULONG BufferLength, OUT PULONG OutBufferLength) { + ULONG Length; + // sanity check ASSERT(BufferLength >= sizeof(USB_CONFIGURATION_DESCRIPTOR)); ASSERT(ConfigDescriptorBuffer); @@ -821,8 +823,9 @@ PC_ASSERT(m_DeviceDescriptor.bNumConfigurations == 1); // copy configuration descriptor - RtlCopyMemory(ConfigDescriptorBuffer, m_ConfigurationDescriptors[0].ConfigurationDescriptor, min(m_ConfigurationDescriptors[0].ConfigurationDescriptor->wTotalLength, BufferLength)); - *OutBufferLength = m_ConfigurationDescriptors[0].ConfigurationDescriptor->wTotalLength; + Length = min(m_ConfigurationDescriptors[0].ConfigurationDescriptor->wTotalLength, BufferLength); + RtlCopyMemory(ConfigDescriptorBuffer, m_ConfigurationDescriptors[0].ConfigurationDescriptor, Length); + *OutBufferLength = Length; } //---------------------------------------------------------------------------------------- @@ -904,7 +907,7 @@ // // commit setup packet // - Status = CommitSetupPacket(SetupPacket, 0, BufferLength, Mdl); + Status = CommitSetupPacket(SetupPacket, NULL, BufferLength, Mdl); if (Mdl != NULL) { @@ -1055,7 +1058,7 @@ CtrlSetup.wValue.W = bConfigurationValue; // select configuration - Status = CommitSetupPacket(&CtrlSetup, 0, 0, 0); + Status = CommitSetupPacket(&CtrlSetup, NULL, 0, NULL); if (!ConfigurationDescriptor) { @@ -1174,7 +1177,7 @@ CtrlSetup.bmRequestType.B = 0x01; // issue request - Status = CommitSetupPacket(&CtrlSetup, 0, 0, 0); + Status = CommitSetupPacket(&CtrlSetup, NULL, 0, NULL); // informal debug print DPRINT1("CUSBDevice::SelectInterface AlternateSetting %x InterfaceNumber %x Status %x\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status);
12 years, 7 months
1
0
0
0
[tfaber] 56666: [USBCCGP] - Fix hardware/compatible id generation (still abusing UNICODE_STRING though) - Do not touch unsupported IRP_MN_QUERY_ID requests
by tfaber@svn.reactos.org
Author: tfaber Date: Mon May 28 10:15:58 2012 New Revision: 56666 URL:
http://svn.reactos.org/svn/reactos?rev=56666&view=rev
Log: [USBCCGP] - Fix hardware/compatible id generation (still abusing UNICODE_STRING though) - Do not touch unsupported IRP_MN_QUERY_ID requests Modified: trunk/reactos/drivers/usb/usbccgp/function.c trunk/reactos/drivers/usb/usbccgp/misc.c trunk/reactos/drivers/usb/usbccgp/pdo.c Modified: trunk/reactos/drivers/usb/usbccgp/function.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/functi…
============================================================================== --- trunk/reactos/drivers/usb/usbccgp/function.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbccgp/function.c [iso-8859-1] Mon May 28 10:15:58 2012 @@ -386,9 +386,9 @@ FDODeviceExtension->DeviceDescriptor->idProduct, FDODeviceExtension->DeviceDescriptor->bcdDevice, Descriptor->bFirstInterface) + 1; - Index = swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, - FDODeviceExtension->DeviceDescriptor->idProduct, - Descriptor->bFirstInterface) + 1; + Index += swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, + FDODeviceExtension->DeviceDescriptor->idProduct, + Descriptor->bFirstInterface) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); @@ -401,7 +401,7 @@ } // copy description - RtlCopyMemory(DescriptionBuffer, Buffer, Index * sizeof(WCHAR)); + RtlCopyMemory(DescriptionBuffer, Buffer, (Index + 1) * sizeof(WCHAR)); FunctionDescriptor->HardwareId.Buffer = DescriptionBuffer; FunctionDescriptor->HardwareId.Length = Index * sizeof(WCHAR); FunctionDescriptor->HardwareId.MaximumLength = (Index + 1) * sizeof(WCHAR); @@ -411,8 +411,8 @@ // now init the compatible id // Index = swprintf(Buffer, L"USB\\Class_%02x&SubClass_%02x&Prot_%02x", Descriptor->bFunctionClass, Descriptor->bFunctionSubClass, Descriptor->bFunctionProtocol) + 1; - Index = swprintf(&Buffer[Index], L"USB\\Class_%04x&SubClass_%04x", Descriptor->bFunctionClass, Descriptor->bFunctionSubClass) + 1; - Index = swprintf(&Buffer[Index], L"USB\\Class_%04x", Descriptor->bFunctionClass) + 1; + Index += swprintf(&Buffer[Index], L"USB\\Class_%02x&SubClass_%02x", Descriptor->bFunctionClass, Descriptor->bFunctionSubClass) + 1; + Index += swprintf(&Buffer[Index], L"USB\\Class_%02x", Descriptor->bFunctionClass) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); @@ -425,7 +425,7 @@ } // copy description - RtlCopyMemory(DescriptionBuffer, Buffer, Index * sizeof(WCHAR)); + RtlCopyMemory(DescriptionBuffer, Buffer, (Index + 1) * sizeof(WCHAR)); FunctionDescriptor->CompatibleId.Buffer = DescriptionBuffer; FunctionDescriptor->CompatibleId.Length = Index * sizeof(WCHAR); FunctionDescriptor->CompatibleId.MaximumLength = (Index + 1) * sizeof(WCHAR); @@ -566,7 +566,7 @@ } // copy description - RtlCopyMemory(DescriptionBuffer, Buffer, Index * sizeof(WCHAR)); + RtlCopyMemory(DescriptionBuffer, Buffer, (Index + 1) * sizeof(WCHAR)); FunctionDescriptor->HardwareId.Buffer = DescriptionBuffer; FunctionDescriptor->HardwareId.Length = Index * sizeof(WCHAR); FunctionDescriptor->HardwareId.MaximumLength = (Index + 1) * sizeof(WCHAR); @@ -589,7 +589,7 @@ } // copy description - RtlCopyMemory(DescriptionBuffer, Buffer, Index * sizeof(WCHAR)); + RtlCopyMemory(DescriptionBuffer, Buffer, (Index + 1) * sizeof(WCHAR)); FunctionDescriptor->CompatibleId.Buffer = DescriptionBuffer; FunctionDescriptor->CompatibleId.Length = Index * sizeof(WCHAR); FunctionDescriptor->CompatibleId.MaximumLength = (Index + 1) * sizeof(WCHAR); Modified: trunk/reactos/drivers/usb/usbccgp/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/misc.c…
============================================================================== --- trunk/reactos/drivers/usb/usbccgp/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbccgp/misc.c [iso-8859-1] Mon May 28 10:15:58 2012 @@ -166,8 +166,8 @@ { DPRINT1("Function %lu\n", Index); DPRINT1("FunctionNumber %lu\n", FunctionDescriptor[Index].FunctionNumber); - DPRINT1("HardwareId %wZ\n", &FunctionDescriptor[Index].HardwareId); - DPRINT1("CompatibleId %wZ\n", &FunctionDescriptor[Index].CompatibleId); + DPRINT1("HardwareId %S\n", FunctionDescriptor[Index].HardwareId.Buffer); + DPRINT1("CompatibleId %S\n", FunctionDescriptor[Index].CompatibleId.Buffer); DPRINT1("FunctionDescription %wZ\n", &FunctionDescriptor[Index].FunctionDescription); DPRINT1("NumInterfaces %lu\n", FunctionDescriptor[Index].NumberOfInterfaces); Modified: trunk/reactos/drivers/usb/usbccgp/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/pdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbccgp/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbccgp/pdo.c [iso-8859-1] Mon May 28 10:15:58 2012 @@ -272,6 +272,13 @@ // DeviceString = &PDODeviceExtension->FunctionDescriptor->CompatibleId; } + else + { + // + // unsupported query + // + return Irp->IoStatus.Status; + } // // sanity check @@ -294,6 +301,7 @@ // copy buffer // RtlCopyMemory(Buffer, DeviceString->Buffer, DeviceString->Length); + Buffer[DeviceString->Length / sizeof(WCHAR)] = UNICODE_NULL; Irp->IoStatus.Information = (ULONG_PTR)Buffer; return STATUS_SUCCESS;
12 years, 7 months
1
0
0
0
[jimtabor] 56665: - Turn of debugs.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon May 28 04:53:13 2012 New Revision: 56665 URL:
http://svn.reactos.org/svn/reactos?rev=56665&view=rev
Log: - Turn of debugs. Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] Mon May 28 04:53:13 2012 @@ -569,9 +569,9 @@ break; case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW: - ERR("co_IntSetForegroundWindow 1 %p\n",hWnd); + TRACE("co_IntSetForegroundWindow 1 %p\n",hWnd); Ret = co_IntSetForegroundWindow(Window); - ERR("co_IntSetForegroundWindow 2 \n"); + TRACE("co_IntSetForegroundWindow 2 \n"); break; case HWNDLOCK_ROUTINE_UPDATEWINDOW:
12 years, 7 months
1
0
0
0
[jimtabor] 56664: [Win32SS] - Add utility of setting and clearing the state bits from user space. Use this later. Fix build.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon May 28 04:51:31 2012 New Revision: 56664 URL:
http://svn.reactos.org/svn/reactos?rev=56664&view=rev
Log: [Win32SS] - Add utility of setting and clearing the state bits from user space. Use this later. Fix build. Modified: trunk/reactos/win32ss/user/ntuser/misc.c Modified: trunk/reactos/win32ss/user/ntuser/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] Mon May 28 04:51:31 2012 @@ -446,6 +446,48 @@ END_CLEANUP; } +VOID FASTCALL +IntSetWindowState(PWND pWnd, UINT Flag) +{ + UINT bit; + if (gptiCurrent->ppi != pWnd->head.pti->ppi) return; + bit = 1 << LOWORD(Flag); + TRACE("SWS %x\n",bit); + switch(HIWORD(Flag)) + { + case 0: + pWnd->state |= bit; + break; + case 1: + pWnd->state2 |= bit; + break; + case 2: + pWnd->ExStyle2 |= bit; + break; + } +} + +VOID FASTCALL +IntClearWindowState(PWND pWnd, UINT Flag) +{ + UINT bit; + if (gptiCurrent->ppi != pWnd->head.pti->ppi) return; + bit = 1 << LOWORD(Flag); + TRACE("CWS %x\n",bit); + switch(HIWORD(Flag)) + { + case 0: + pWnd->state &= ~bit; + break; + case 1: + pWnd->state2 &= ~bit; + break; + case 2: + pWnd->ExStyle2 &= ~bit; + break; + } +} + NTSTATUS FASTCALL IntSafeCopyUnicodeString(PUNICODE_STRING Dest, PUNICODE_STRING Source)
12 years, 7 months
1
0
0
0
[jimtabor] 56663: [Win32SS] - Add utility of setting and clearing the state bits from user space. Use this later.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon May 28 04:49:15 2012 New Revision: 56663 URL:
http://svn.reactos.org/svn/reactos?rev=56663&view=rev
Log: [Win32SS] - Add utility of setting and clearing the state bits from user space. Use this later. Modified: trunk/reactos/win32ss/include/ntuser.h trunk/reactos/win32ss/user/ntuser/simplecall.c trunk/reactos/win32ss/user/ntuser/userfuncs.h trunk/reactos/win32ss/user/user32/include/ntwrapper.h trunk/reactos/win32ss/user/user32/misc/misc.c Modified: trunk/reactos/win32ss/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?r…
============================================================================== --- trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] Mon May 28 04:49:15 2012 @@ -521,6 +521,8 @@ #define WNDS_ANSICREATOR 0x20000000 #define WNDS_MAXIMIZESTOMONITOR 0x40000000 #define WNDS_DESTROYED 0x80000000 + +#define WNDSACTIVEFRAME 0x00000006 // State2 Flags !Not Implemented! #define WNDS2_WMPAINTSENT 0X00000001 Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] Mon May 28 04:49:15 2012 @@ -569,9 +569,9 @@ break; case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW: - TRACE("co_IntSetForegroundWindow 1 %p\n",hWnd); + ERR("co_IntSetForegroundWindow 1 %p\n",hWnd); Ret = co_IntSetForegroundWindow(Window); - TRACE("co_IntSetForegroundWindow 2 \n"); + ERR("co_IntSetForegroundWindow 2 \n"); break; case HWNDLOCK_ROUTINE_UPDATEWINDOW: @@ -749,6 +749,24 @@ UserLeave(); return 0; } + case HWNDPARAM_ROUTINE_CLEARWINDOWSTATE: + { + PWND pWnd; + UserEnterExclusive(); + pWnd = UserGetWindowObject(hWnd); + if (pWnd) IntClearWindowState(pWnd, (UINT)Param); + UserLeave(); + return 0; + } + case HWNDPARAM_ROUTINE_SETWINDOWSTATE: + { + PWND pWnd; + UserEnterExclusive(); + pWnd = UserGetWindowObject(hWnd); + if (pWnd) IntSetWindowState(pWnd, (UINT)Param); + UserLeave(); + return 0; + } } STUB; Modified: trunk/reactos/win32ss/user/ntuser/userfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/userfu…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/userfuncs.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/userfuncs.h [iso-8859-1] Mon May 28 04:49:15 2012 @@ -81,6 +81,9 @@ PVOID pvParam, UINT fWinIni); +VOID FASTCALL IntSetWindowState(PWND, UINT); +VOID FASTCALL IntClearWindowState(PWND, UINT); + /*************** MESSAGE.C ***************/ BOOL FASTCALL Modified: trunk/reactos/win32ss/user/user32/include/ntwrapper.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/includ…
============================================================================== --- trunk/reactos/win32ss/user/user32/include/ntwrapper.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/include/ntwrapper.h [iso-8859-1] Mon May 28 04:49:15 2012 @@ -6,6 +6,8 @@ #error #endif +BOOL FASTCALL TestState(PWND, UINT); + EXTINLINE BOOL WINAPI GetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi) { @@ -732,6 +734,18 @@ return NtUserCallHwnd(hWnd, HWND_ROUTINE_SETMSGBOX); } +EXTINLINE VOID NtUserxClearWindowState(PWND pWnd, UINT Flag) +{ + if (!TestState(pWnd, Flag)) return; + NtUserCallHwndParam(UserHMGetHandle(pWnd), (DWORD_PTR)Flag, HWNDPARAM_ROUTINE_CLEARWINDOWSTATE); +} + +EXTINLINE VOID NtUserxSetWindowState(PWND pWnd, UINT Flag) +{ + if (TestState(pWnd, Flag)) return; + NtUserCallHwndParam(UserHMGetHandle(pWnd), (DWORD_PTR)Flag, HWNDPARAM_ROUTINE_SETWINDOWSTATE); +} + EXTINLINE HWND NtUserxSetTaskmanWindow(HWND hWnd) { return NtUserCallHwndOpt(hWnd, HWNDOPT_ROUTINE_SETTASKMANWINDOW); Modified: trunk/reactos/win32ss/user/user32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/m…
============================================================================== --- trunk/reactos/win32ss/user/user32/misc/misc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/misc/misc.c [iso-8859-1] Mon May 28 04:49:15 2012 @@ -255,6 +255,24 @@ else return (NtUserQueryWindow(Wnd->head.h, QUERY_WINDOW_UNIQUE_PROCESS_ID) == (DWORD_PTR)NtCurrentTeb()->ClientId.UniqueProcess ); +} + +BOOL +FASTCALL +TestState(PWND pWnd, UINT Flag) +{ + UINT bit; + bit = 1 << LOWORD(Flag); + switch(HIWORD(Flag)) + { + case 0: + return (pWnd->state & bit); + case 1: + return (pWnd->state2 & bit); + case 2: + return (pWnd->ExStyle2 & bit); + } + return FALSE; } PUSER_HANDLE_ENTRY
12 years, 7 months
1
0
0
0
[jimtabor] 56662: [Win32k] - Fix the remaining wine Win test_NCRedraw test. Broken since r6737. - Miscellaneous fixes and changes.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon May 28 03:34:04 2012 New Revision: 56662 URL:
http://svn.reactos.org/svn/reactos?rev=56662&view=rev
Log: [Win32k] - Fix the remaining wine Win test_NCRedraw test. Broken since r6737. - Miscellaneous fixes and changes. Modified: trunk/reactos/win32ss/user/ntuser/painting.c trunk/reactos/win32ss/user/ntuser/painting.h Modified: trunk/reactos/win32ss/user/ntuser/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/painti…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] Mon May 28 03:34:04 2012 @@ -223,6 +223,7 @@ if (Wnd->hrgnUpdate != NULL || Wnd->state & WNDS_INTERNALPAINT) { + Wnd->state2 |= WNDS2_WMPAINTSENT; co_IntSendMessage(hWnd, WM_PAINT, 0, 0); } } @@ -232,9 +233,7 @@ { TempRegion = IntGetNCUpdateRgn(Wnd, TRUE); Wnd->state &= ~WNDS_SENDNCPAINT; - MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue); co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0); - } if (Wnd->state & WNDS_SENDERASEBACKGROUND) @@ -303,10 +302,10 @@ IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags) { INT RgnType; - BOOL HadPaintMessage, HadNCPaintMessage; - BOOL HasPaintMessage, HasNCPaintMessage; + BOOL HadPaintMessage; TRACE("IntInvalidateWindows start\n"); + /* * If the nonclient is not to be redrawn, clip the region to the client * rect @@ -347,67 +346,79 @@ * Save current state of pending updates */ - HadPaintMessage = Wnd->hrgnUpdate != NULL || - Wnd->state & WNDS_INTERNALPAINT; - HadNCPaintMessage = Wnd->state & WNDS_SENDNCPAINT; + HadPaintMessage = IntIsWindowDirty(Wnd); /* * Update the region and flags */ - if (Flags & RDW_INVALIDATE && RgnType != NULLREGION) - { - if (Wnd->hrgnUpdate == NULL) - { - Wnd->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0); - IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC); - } - - if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate, - hRgn, RGN_OR) == NULLREGION) - { - IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED); - GreDeleteObject(Wnd->hrgnUpdate); - Wnd->hrgnUpdate = NULL; - } - - if (Flags & RDW_FRAME) - Wnd->state |= WNDS_SENDNCPAINT; - if (Flags & RDW_ERASE) - Wnd->state |= WNDS_SENDERASEBACKGROUND; - - Flags |= RDW_FRAME; - } - - if (Flags & RDW_VALIDATE && RgnType != NULLREGION) - { - if (Wnd->hrgnUpdate != NULL) - { + // The following flags are used to invalidate the window. + if (Flags & (RDW_INVALIDATE|RDW_INTERNALPAINT|RDW_ERASE|RDW_FRAME)) + { + if (Flags & RDW_INTERNALPAINT) + { + Wnd->state |= WNDS_INTERNALPAINT; + } + + if (Flags & RDW_INVALIDATE && RgnType != NULLREGION) + { + /* If not the same thread set it dirty. */ + if (Wnd->head.pti != PsGetCurrentThreadWin32Thread()) + { + Wnd->state |= WNDS_UPDATEDIRTY; + } + + if (Flags & RDW_FRAME) + Wnd->state |= WNDS_SENDNCPAINT; + if (Flags & RDW_ERASE) + Wnd->state |= WNDS_SENDERASEBACKGROUND; + + if (Wnd->hrgnUpdate == NULL) + { + Wnd->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0); + IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC); + } + if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate, - hRgn, RGN_DIFF) == NULLREGION) + hRgn, RGN_OR) == NULLREGION) { IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED); GreDeleteObject(Wnd->hrgnUpdate); Wnd->hrgnUpdate = NULL; } - } - - if (Wnd->hrgnUpdate == NULL) - Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); - if (Flags & RDW_NOFRAME) - Wnd->state &= ~WNDS_SENDNCPAINT; - if (Flags & RDW_NOERASE) - Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); - } - - if (Flags & RDW_INTERNALPAINT) - { - Wnd->state |= WNDS_INTERNALPAINT; - } - - if (Flags & RDW_NOINTERNALPAINT) - { - Wnd->state &= ~WNDS_INTERNALPAINT; + Flags |= RDW_FRAME; // For children. + } + } // The following flags are used to validate the window. + else if (Flags & (RDW_VALIDATE|RDW_NOINTERNALPAINT|RDW_NOERASE|RDW_NOFRAME)) + { + /* FIXME: Handle WNDS_UPDATEDIRTY */ + + if (Flags & RDW_NOINTERNALPAINT) + { + Wnd->state &= ~WNDS_INTERNALPAINT; + } + + if (Flags & RDW_VALIDATE && RgnType != NULLREGION) + { + if (Flags & RDW_NOFRAME) + Wnd->state &= ~WNDS_SENDNCPAINT; + if (Flags & RDW_NOERASE) + Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); + + if (Wnd->hrgnUpdate != NULL) + { + if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate, + hRgn, RGN_DIFF) == NULLREGION) + { + IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED); + GreDeleteObject(Wnd->hrgnUpdate); + Wnd->hrgnUpdate = NULL; + } + } + + if (Wnd->hrgnUpdate == NULL) + Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); + } } /* @@ -431,7 +442,6 @@ IntInvalidateWindows(Child, hRgnTemp, Flags); GreDeleteObject(hRgnTemp); } - } } @@ -439,21 +449,9 @@ * Fake post paint messages to window message queue if needed */ - HasPaintMessage = Wnd->hrgnUpdate != NULL || - Wnd->state & WNDS_INTERNALPAINT; - HasNCPaintMessage = Wnd->state & WNDS_SENDNCPAINT; - - if (HasPaintMessage != HadPaintMessage) + if (HadPaintMessage != IntIsWindowDirty(Wnd)) { if (HadPaintMessage) - MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue); - else - MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue); - } - - if (HasNCPaintMessage != HadNCPaintMessage) - { - if (HadNCPaintMessage) MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue); else MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue); @@ -594,16 +592,16 @@ BOOL FASTCALL IntIsWindowDirty(PWND Wnd) { - return (Wnd->style & WS_VISIBLE) && - ((Wnd->hrgnUpdate != NULL) || - (Wnd->state & WNDS_INTERNALPAINT) || - (Wnd->state & WNDS_SENDNCPAINT)); -} - -HWND FASTCALL + return ( Wnd->style & WS_VISIBLE && + ( Wnd->hrgnUpdate != NULL || + Wnd->state & WNDS_INTERNALPAINT || + Wnd->state & WNDS_SENDNCPAINT ) ); +} + +PWND FASTCALL IntFindWindowToRepaint(PWND Window, PTHREADINFO Thread) { - HWND hChild; + PWND hChild; PWND TempWindow; for (; Window != NULL; Window = Window->spwndNext) @@ -621,12 +619,12 @@ IntWndBelongsToThread(TempWindow, Thread) && IntIsWindowDirty(TempWindow)) { - return TempWindow->head.h; + return TempWindow; } } } - return Window->head.h; + return Window; } if (Window->spwndChild) @@ -636,8 +634,7 @@ return hChild; } } - - return NULL; + return Window; } BOOL FASTCALL @@ -649,14 +646,20 @@ MSG *Message, BOOL Remove) { - if (!Thread->cPaintsReady) - return FALSE; + PWND PaintWnd; if ((MsgFilterMin != 0 || MsgFilterMax != 0) && (MsgFilterMin > WM_PAINT || MsgFilterMax < WM_PAINT)) return FALSE; - Message->hwnd = IntFindWindowToRepaint(UserGetDesktopWindow(), PsGetCurrentThreadWin32Thread()); + if (Thread->TIF_flags & TIF_SYSTEMTHREAD ) + { + ERR("WM_PAINT is in a System Thread!\n"); + } + + PaintWnd = IntFindWindowToRepaint(UserGetDesktopWindow(), Thread); + + Message->hwnd = PaintWnd ? UserHMGetHandle(PaintWnd) : NULL; if (Message->hwnd == NULL) { @@ -666,12 +669,19 @@ return FALSE; } - if (Window != NULL && Message->hwnd != Window->head.h) + if (Window != NULL && PaintWnd != Window) return FALSE; + if (PaintWnd->state & WNDS_INTERNALPAINT) + { + PaintWnd->state &= ~WNDS_INTERNALPAINT; + if (!PaintWnd->hrgnUpdate) + MsqDecPaintCountQueue(Thread->MessageQueue); + } + PaintWnd->state2 &= ~WNDS2_WMPAINTSENT; + PaintWnd->state &= ~WNDS_UPDATEDIRTY; + Message->wParam = Message->lParam = 0; Message->message = WM_PAINT; - Message->wParam = Message->lParam = 0; - return TRUE; } @@ -831,19 +841,26 @@ co_UserHideCaret(Window); + Window->state2 |= WNDS2_STARTPAINT; + Window->state &= ~WNDS_PAINTNOTPROCESSED; + if (Window->state & WNDS_SENDNCPAINT) { HRGN hRgn; + Window->state &= ~WNDS_UPDATEDIRTY; hRgn = IntGetNCUpdateRgn(Window, FALSE); Window->state &= ~WNDS_SENDNCPAINT; - MsqDecPaintCountQueue(Window->head.pti->MessageQueue); co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)hRgn, 0); if (hRgn != HRGN_WINDOW && hRgn != NULL && GreIsHandleValid(hRgn)) { /* NOTE: The region can already by deleted! */ GreDeleteObject(hRgn); } + } + else + { + Window->state &= ~WNDS_UPDATEDIRTY; } RtlZeroMemory(&Ps, sizeof(PAINTSTRUCT)); @@ -894,6 +911,7 @@ PWND Child; for (Child = Window->spwndChild; Child; Child = Child->spwndNext) { + if (Child->hrgnUpdate == NULL && Child->state & WNDS_SENDNCPAINT) // Helped fixing test_redrawnow. IntInvalidateWindows(Child, Window->hrgnUpdate, RDW_FRAME | RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN); } } @@ -958,6 +976,8 @@ UserReleaseDC(Window, hdc, TRUE); + Window->state2 &= ~(WNDS2_WMPAINTSENT|WNDS2_STARTPAINT); + UserRefObjectCo(Window, &Ref); co_UserShowCaret(Window); UserDerefObjectCo(Window); @@ -1019,6 +1039,8 @@ RECTL Rect; ASSERT_REFS_CO(Window); + + Window->state &= ~WNDS_UPDATEDIRTY; if (Window->hrgnUpdate == NULL) { @@ -1100,6 +1122,8 @@ { RETURN(FALSE); } + + Window->state &= ~WNDS_UPDATEDIRTY; if (Window->hrgnUpdate == NULL) { @@ -1974,8 +1998,13 @@ if (hwnd) { - Window = UserGetWindowObject(hwnd); - // TODO: Add Desktop and MessageBox check via FNID's. + if (!(Window = UserGetWindowObject(hwnd)) || // FIXME: + Window == UserGetDesktopWindow() || // pWnd->fnid == FNID_DESKTOP + Window == UserGetMessageWindow() ) // pWnd->fnid == FNID_MESSAGEWND + { + goto Exit; + } + if ( Window ) { /* Validate flags and check it as a mask for 0 or 1. */ @@ -1985,7 +2014,7 @@ EngSetLastError(ERROR_INVALID_PARAMETER); } } - +Exit: UserLeave(); return Ret; } Modified: trunk/reactos/win32ss/user/ntuser/painting.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/painti…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/painting.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/painting.h [iso-8859-1] Mon May 28 03:34:04 2012 @@ -7,3 +7,4 @@ INT FASTCALL co_UserGetUpdateRgn(PWND, HRGN, BOOL); VOID FASTCALL co_IntPaintWindows(PWND Window, ULONG Flags, BOOL Recurse); BOOL FASTCALL IntValidateParent(PWND Child, HRGN hValidateRgn, BOOL Recurse); +BOOL FASTCALL IntIsWindowDirty(PWND);
12 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
...
23
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
Results per page:
10
25
50
100
200