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
December 2007
----- 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
22 participants
605 discussions
Start a n
N
ew thread
[greatlrd] 31469: documented : EngLockDirectDrawSurface small optimize of EngLockDirectDrawSurface, EngDxIoctl,
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Dec 27 22:24:22 2007 New Revision: 31469 URL:
http://svn.reactos.org/svn/reactos?rev=31469&view=rev
Log: documented : EngLockDirectDrawSurface small optimize of EngLockDirectDrawSurface, EngDxIoctl, Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/eng.c Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/eng.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/eng.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/eng.c Thu Dec 27 22:24:22 2007 @@ -143,37 +143,49 @@ ULONG ulBufferSize) { PGD_ENGDXIOCTL pfnEngDxIoctl = (PGD_ENGDXIOCTL)gpDxFuncs[DXG_INDEX_DxDdIoctl].pfn; - - if (pfnEngDxIoctl == NULL) - { - DPRINT1("Warring no pfnEngDxIoctl"); - return DDERR_UNSUPPORTED; - } + DWORD retVal = DDERR_UNSUPPORTED; DPRINT1("Calling on dxg.sys pfnEngDxIoctl"); - return pfnEngDxIoctl(ulIoctl, pBuffer, ulBufferSize); -} - -/************************************************************************/ -/* EngLockDirectDrawSurface */ -/************************************************************************/ + + if (pfnEngDxIoctl != NULL) + { + retVal = pfnEngDxIoctl(ulIoctl, pBuffer, ulBufferSize); + } + + return retVal; +} + +/*++ +* @name EngLockDirectDrawSurface +* @implemented +* +* The function EngUnlockDirectDrawSurface locking the dx surface + +* @param HANDLE hSurface +* The handle of a surface +* +* @return +* This return vaild or NULL pointer to PDD_SURFACE_LOCAL object +* +* @remarks. +* None +* +*--*/ PDD_SURFACE_LOCAL STDCALL EngLockDirectDrawSurface(HANDLE hSurface) { - PGD_ENGLOCKDIRECTDRAWSURFACE pfnEngLockDirectDrawSurface = NULL; - INT i; - - DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdLockDirectDrawSurface, pfnEngLockDirectDrawSurface); - - if (pfnEngLockDirectDrawSurface == NULL) - { - DPRINT1("Warring no pfnEngLockDirectDrawSurface"); - return DDHAL_DRIVER_NOTHANDLED; - } + PGD_ENGLOCKDIRECTDRAWSURFACE pfnEngLockDirectDrawSurface = (PGD_ENGLOCKDIRECTDRAWSURFACE)gpDxFuncs[DXG_INDEX_DxDdLockDirectDrawSurface].pfn; + PDD_SURFACE_LOCAL retVal = NULL; DPRINT1("Calling on dxg.sys pfnEngLockDirectDrawSurface"); - return pfnEngLockDirectDrawSurface(hSurface); + + if (pfnEngLockDirectDrawSurface != NULL) + { + retVal = pfnEngLockDirectDrawSurface(hSurface); + } + + return retVal; }
16 years, 12 months
1
0
0
0
[greatlrd] 31468: documented : EngUnlockDirectDrawSurface
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Dec 27 22:11:56 2007 New Revision: 31468 URL:
http://svn.reactos.org/svn/reactos?rev=31468&view=rev
Log: documented : EngUnlockDirectDrawSurface Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/eng.c Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/eng.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/eng.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/eng.c Thu Dec 27 22:11:56 2007 @@ -116,7 +116,7 @@ * @name EngDxIoctl * @implemented * -* The function EngDxIoctl is the ioctl call to diffent dx functions +* The function EngDxIoctl is the ioctl call to diffent dx functions * to the driver dxg.sys * * @param ULONG ulIoctl @@ -128,7 +128,7 @@ * @param ULONG ulBufferSize * The buffer size in bytes * -* @return +* @return * always return DDERR_UNSUPPORTED * * @remarks. @@ -176,25 +176,37 @@ return pfnEngLockDirectDrawSurface(hSurface); } -/************************************************************************/ -/* EngUnlockDirectDrawSurface */ -/************************************************************************/ + +/*++ +* @name EngUnlockDirectDrawSurface +* @implemented +* +* The function EngUnlockDirectDrawSurface locking the dx surface + +* @param PDD_SURFACE_LOCAL pSurface +* The Surface we whant lock +* +* @return +* This return FALSE or TRUE, FALSE for fail, TRUE for success +* +* @remarks. +* None +* +*--*/ BOOL STDCALL EngUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface) { - PGD_ENGUNLOCKDIRECTDRAWSURFACE pfnEngUnlockDirectDrawSurface = NULL; - INT i; - - DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdUnlockDirectDrawSurface, pfnEngUnlockDirectDrawSurface); - - if (pfnEngUnlockDirectDrawSurface == NULL) - { - DPRINT1("Warring no pfnEngUnlockDirectDrawSurface"); - return DDHAL_DRIVER_NOTHANDLED; - } + PGD_ENGUNLOCKDIRECTDRAWSURFACE pfnEngUnlockDirectDrawSurface = (PGD_ENGUNLOCKDIRECTDRAWSURFACE)gpDxFuncs[DXG_INDEX_DxDdUnlockDirectDrawSurface].pfn; + BOOL retVal = FALSE; DPRINT1("Calling on dxg.sys pfnEngUnlockDirectDrawSurface"); - return pfnEngUnlockDirectDrawSurface(pSurface); -} - + + if (pfnEngUnlockDirectDrawSurface != NULL) + { + retVal = pfnEngUnlockDirectDrawSurface(pSurface); + } + + return retVal; +} +
16 years, 12 months
1
0
0
0
[hpoussin] 31467: Use UNICODE_STRING and Rtl functions instead of LPWSTR variables (can prevent some buffer overflows) Remove assumption that UNICODE_STRING buffers are always NULL terminated Remove some intermediate buffers Do not define multiple times PnP parent key
by hpoussin@svn.reactos.org
Author: hpoussin Date: Thu Dec 27 22:02:32 2007 New Revision: 31467 URL:
http://svn.reactos.org/svn/reactos?rev=31467&view=rev
Log: Use UNICODE_STRING and Rtl functions instead of LPWSTR variables (can prevent some buffer overflows) Remove assumption that UNICODE_STRING buffers are always NULL terminated Remove some intermediate buffers Do not define multiple times PnP parent key Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Thu Dec 27 22:02:32 2007 @@ -18,6 +18,8 @@ //#define ENABLE_ACPI /* GLOBALS *******************************************************************/ + +#define ENUM_ROOT L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum" PDEVICE_NODE IopRootDeviceNode; KSPIN_LOCK IopDeviceTreeLock; @@ -403,12 +405,13 @@ case DevicePropertyLocationInformation: case DevicePropertyUINumber: { - LPWSTR RegistryPropertyName, KeyNameBuffer; - UNICODE_STRING KeyName, ValueName; + LPCWSTR RegistryPropertyName; + UNICODE_STRING EnumU = RTL_CONSTANT_STRING(ENUM_ROOT); + UNICODE_STRING ValueName; OBJECT_ATTRIBUTES ObjectAttributes; KEY_VALUE_PARTIAL_INFORMATION *ValueInformation; ULONG ValueInformationLength; - HANDLE KeyHandle; + HANDLE hEnum, KeyHandle; NTSTATUS Status; switch (DeviceProperty) @@ -434,62 +437,70 @@ case DevicePropertyUINumber: RegistryPropertyName = L"UINumber"; break; default: - RegistryPropertyName = NULL; break; + /* Should not happen */ + ASSERT(FALSE); + return STATUS_UNSUCCESSFUL; } - KeyNameBuffer = ExAllocatePool(PagedPool, - (49 * sizeof(WCHAR)) + DeviceNode->InstancePath.Length); - - DPRINT("KeyNameBuffer: 0x%p, value %S\n", KeyNameBuffer, RegistryPropertyName); - - if (KeyNameBuffer == NULL) - return STATUS_INSUFFICIENT_RESOURCES; - - wcscpy(KeyNameBuffer, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); - wcscat(KeyNameBuffer, DeviceNode->InstancePath.Buffer); - RtlInitUnicodeString(&KeyName, KeyNameBuffer); - InitializeObjectAttributes(&ObjectAttributes, &KeyName, - OBJ_CASE_INSENSITIVE, NULL, NULL); - - Status = ZwOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes); - ExFreePool(KeyNameBuffer); - if (!NT_SUCCESS(Status)) - return Status; - - RtlInitUnicodeString(&ValueName, RegistryPropertyName); - ValueInformationLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, - Data[0]) + BufferLength; - ValueInformation = ExAllocatePool(PagedPool, ValueInformationLength); - if (ValueInformation == NULL) - { - ZwClose(KeyHandle); - return STATUS_INSUFFICIENT_RESOURCES; - } - - Status = ZwQueryValueKey(KeyHandle, &ValueName, - KeyValuePartialInformation, ValueInformation, - ValueInformationLength, - &ValueInformationLength); - *ResultLength = ValueInformation->DataLength; - ZwClose(KeyHandle); - - if (!NT_SUCCESS(Status)) - { - ExFreePool(ValueInformation); - if (Status == STATUS_BUFFER_OVERFLOW) - return STATUS_BUFFER_TOO_SMALL; - else - return Status; - } - - /* FIXME: Verify the value (NULL-terminated, correct format). */ - - RtlCopyMemory(PropertyBuffer, ValueInformation->Data, - ValueInformation->DataLength); - ExFreePool(ValueInformation); - - return STATUS_SUCCESS; - } + DPRINT("Registry property %S\n", RegistryPropertyName); + + /* Open Enum key */ + InitializeObjectAttributes(&ObjectAttributes, &EnumU, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL); + Status = ZwOpenKey(&hEnum, 0, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + return Status; + + /* Open instance key */ + InitializeObjectAttributes(&ObjectAttributes, &DeviceNode->InstancePath, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, hEnum, NULL); + Status = ZwOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes); + ZwClose(hEnum); + if (!NT_SUCCESS(Status)) + return Status; + + /* Allocate buffer to read as much data as required by the caller */ + ValueInformationLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, + Data[0]) + BufferLength; + ValueInformation = ExAllocatePool(PagedPool, ValueInformationLength); + if (!ValueInformation) + { + ZwClose(KeyHandle); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Read the value */ + RtlInitUnicodeString(&ValueName, RegistryPropertyName); + Status = ZwQueryValueKey(KeyHandle, &ValueName, + KeyValuePartialInformation, ValueInformation, + ValueInformationLength, + &ValueInformationLength); + ZwClose(KeyHandle); + + if (!NT_SUCCESS(Status)) + { + ExFreePool(ValueInformation); + if (Status == STATUS_BUFFER_OVERFLOW) + { + *ResultLength = ValueInformation->DataLength; + return STATUS_BUFFER_TOO_SMALL; + } + else + { + *ResultLength = 0; + return Status; + } + } + + /* Return data */ + *ResultLength = ValueInformation->DataLength; + /* FIXME: Verify the value (NULL-terminated, correct format). */ + RtlCopyMemory(PropertyBuffer, ValueInformation->Data, + ValueInformation->DataLength); + ExFreePool(ValueInformation); + + return STATUS_SUCCESS; + } case DevicePropertyBootConfiguration: Length = 0; @@ -510,43 +521,36 @@ Data = &DeviceNode->BootResources; break; - case DevicePropertyEnumeratorName: - Ptr = wcschr(DeviceNode->InstancePath.Buffer, L'\\'); - if (Ptr != NULL) - { - Length = (ULONG)((ULONG_PTR)Ptr - (ULONG_PTR)DeviceNode->InstancePath.Buffer) + sizeof(WCHAR); - Data = DeviceNode->InstancePath.Buffer; - } - else - { - Length = 0; - Data = NULL; - } - break; - - case DevicePropertyPhysicalDeviceObjectName: - Length = DeviceNode->InstancePath.Length + sizeof(WCHAR); - Data = DeviceNode->InstancePath.Buffer; - break; - - default: - return STATUS_INVALID_PARAMETER_2; - } - - *ResultLength = Length; - if (BufferLength < Length) - return STATUS_BUFFER_TOO_SMALL; - RtlCopyMemory(PropertyBuffer, Data, Length); - - /* Terminate the string */ - if (DeviceProperty == DevicePropertyEnumeratorName - || DeviceProperty == DevicePropertyPhysicalDeviceObjectName) - { - Ptr = (PWSTR)PropertyBuffer; - Ptr[(Length / sizeof(WCHAR)) - 1] = 0; - } - - return STATUS_SUCCESS; + case DevicePropertyEnumeratorName: + /* A buffer overflow can't happen here, since InstancePath + * always contains the enumerator name followed by \\ */ + Ptr = wcschr(DeviceNode->InstancePath.Buffer, L'\\'); + ASSERT(Ptr); + Length = (Ptr - DeviceNode->InstancePath.Buffer + 1) * sizeof(WCHAR); + Data = DeviceNode->InstancePath.Buffer; + break; + + case DevicePropertyPhysicalDeviceObjectName: + /* InstancePath buffer is NULL terminated, so we can do this */ + Length = DeviceNode->InstancePath.MaximumLength; + Data = DeviceNode->InstancePath.Buffer; + break; + + default: + return STATUS_INVALID_PARAMETER_2; + } + + /* Prepare returned values */ + *ResultLength = Length; + if (BufferLength < Length) + return STATUS_BUFFER_TOO_SMALL; + RtlCopyMemory(PropertyBuffer, Data, Length); + + /* NULL terminate the string (if required) */ + if (DeviceProperty == DevicePropertyEnumeratorName) + ((LPWSTR)PropertyBuffer)[Length / sizeof(WCHAR)] = UNICODE_NULL; + + return STATUS_SUCCESS; } /* @@ -1062,82 +1066,110 @@ } -static +/* + * IopCreateDeviceKeyPath + * + * Creates a registry key + * + * Parameters + * RegistryPath + * Name of the key to be created. + * Handle + * Handle to the newly created key + * + * Remarks + * This method can create nested trees, so parent of RegistryPath can + * be not existant, and will be created if needed. + */ NTSTATUS -IopCreateDeviceKeyPath(PWSTR Path, - PHANDLE Handle) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - WCHAR KeyBuffer[MAX_PATH]; - UNICODE_STRING KeyName; - HANDLE KeyHandle; - NTSTATUS Status; - PWCHAR Current; - PWCHAR Next; - - *Handle = NULL; - - if (_wcsnicmp(Path, L"\\Registry\\", 10) != 0) - { - return STATUS_INVALID_PARAMETER; - } - - wcsncpy (KeyBuffer, Path, MAX_PATH-1); - - /* Skip \\Registry\\ */ - Current = KeyBuffer; - Current = wcschr (Current, L'\\') + 1; - Current = wcschr (Current, L'\\') + 1; - - while (TRUE) - { - Next = wcschr (Current, L'\\'); - if (Next == NULL) - { - /* The end */ - } - else - { - *Next = 0; - } - - RtlInitUnicodeString (&KeyName, KeyBuffer); - InitializeObjectAttributes (&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - DPRINT("Create '%S'\n", KeyName.Buffer); - - Status = ZwCreateKey (&KeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - 0, - NULL); - if (!NT_SUCCESS (Status)) - { - DPRINT ("ZwCreateKey() failed with status %x\n", Status); - return Status; - } - - if (Next == NULL) - { - *Handle = KeyHandle; - return STATUS_SUCCESS; - } - else - { - ZwClose (KeyHandle); - *Next = L'\\'; - } - - Current = Next + 1; - } - - return STATUS_UNSUCCESSFUL; +NTAPI +IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, + OUT PHANDLE Handle) +{ + UNICODE_STRING EnumU = RTL_CONSTANT_STRING(ENUM_ROOT); + HANDLE hParent = NULL, hKey; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyName; + LPCWSTR Current, Last; + ULONG dwLength; + NTSTATUS Status; + + /* Assume failure */ + *Handle = NULL; + + /* Open root key for device instances */ + InitializeObjectAttributes(&ObjectAttributes, + &EnumU, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = ZwOpenKey(&hParent, + KEY_CREATE_SUB_KEY, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwOpenKey('%wZ') failed with status 0x%08lx\n", &EnumU, Status); + return Status; + } + + Current = KeyName.Buffer = RegistryPath->Buffer; + Last = &RegistryPath->Buffer[RegistryPath->Length / sizeof(WCHAR)]; + + /* Go up to the end of the string */ + while (Current <= Last) + { + if (Current != Last && *Current != '\\') + { + /* Not the end of the string and not a separator */ + Current++; + continue; + } + + /* Prepare relative key name */ + dwLength = (ULONG_PTR)Current - (ULONG_PTR)KeyName.Buffer; + KeyName.MaximumLength = KeyName.Length = dwLength; + DPRINT("Create '%wZ'\n", &KeyName); + + /* Open key */ + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + hParent, + NULL); + Status = ZwCreateKey(&hKey, + Current == Last ? KEY_ALL_ACCESS : KEY_CREATE_SUB_KEY, + &ObjectAttributes, + 0, + NULL, + 0, + NULL); + + /* Close parent key handle, we don't need it anymore */ + if (hParent) + ZwClose(hParent); + + /* Key opening/creating failed? */ + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwCreateKey('%wZ') failed with status 0x%08lx\n", &KeyName, Status); + return Status; + } + + /* Check if it is the end of the string */ + if (Current == Last) + { + /* Yes, return success */ + *Handle = hKey; + return STATUS_SUCCESS; + } + + /* Start with this new parent key */ + hParent = hKey; + Current++; + KeyName.Buffer = (LPWSTR)Current; + } + + return STATUS_UNSUCCESSFUL; } @@ -1224,41 +1256,6 @@ &DefaultConfigFlags, sizeof(DefaultConfigFlags)); } - -#if 0 - if (DeviceNode->PhysicalDeviceObject != NULL) - { - /* Create the 'Control' key */ - RtlInitUnicodeString(&KeyName, - L"Control"); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_OPENIF, - InstanceKey, - NULL); - Status = ZwCreateKey(&LogConfKey, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - REG_OPTION_VOLATILE, - NULL); - if (NT_SUCCESS(Status)) - { - ULONG Reference = (ULONG)DeviceNode->PhysicalDeviceObject; - RtlInitUnicodeString(&KeyName, - L"DeviceReference"); - Status = ZwSetValueKey(LogConfKey, - &KeyName, - 0, - REG_DWORD, - &Reference, - sizeof(PVOID)); - - ZwClose(LogConfKey); - } - } -#endif DPRINT("IopSetDeviceInstanceData() done\n"); @@ -1606,98 +1603,96 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode, PUNICODE_STRING ParentIdPrefix) { - ULONG KeyNameBufferLength; - PWSTR KeyNameBuffer = NULL; - PKEY_VALUE_PARTIAL_INFORMATION ParentIdPrefixInformation = NULL; - UNICODE_STRING KeyName; - UNICODE_STRING KeyValue; - UNICODE_STRING ValueName; - OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE hKey = NULL; - ULONG crc32; - NTSTATUS Status; - - /* HACK: As long as some devices have a NULL device - * instance path, the following test is required :( - */ - if (DeviceNode->Parent->InstancePath.Length == 0) - { - DPRINT1("Parent of %wZ has NULL Instance path, please report!\n", - &DeviceNode->InstancePath); - return STATUS_UNSUCCESSFUL; - } - - /* 1. Try to retrieve ParentIdPrefix from registry */ - KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + MAX_PATH * sizeof(WCHAR); - ParentIdPrefixInformation = ExAllocatePool(PagedPool, KeyNameBufferLength + sizeof(WCHAR)); - if (!ParentIdPrefixInformation) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - KeyNameBuffer = ExAllocatePool(PagedPool, (49 * sizeof(WCHAR)) + DeviceNode->Parent->InstancePath.Length); - if (!KeyNameBuffer) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - wcscpy(KeyNameBuffer, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); - wcscat(KeyNameBuffer, DeviceNode->Parent->InstancePath.Buffer); - RtlInitUnicodeString(&KeyName, KeyNameBuffer); - InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL); - Status = ZwOpenKey(&hKey, KEY_QUERY_VALUE | KEY_SET_VALUE, &ObjectAttributes); - if (!NT_SUCCESS(Status)) - goto cleanup; - RtlInitUnicodeString(&ValueName, L"ParentIdPrefix"); - Status = ZwQueryValueKey( - hKey, &ValueName, - KeyValuePartialInformation, ParentIdPrefixInformation, - KeyNameBufferLength, &KeyNameBufferLength); - if (NT_SUCCESS(Status)) - { - if (ParentIdPrefixInformation->Type != REG_SZ) - Status = STATUS_UNSUCCESSFUL; - else - { - KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; - KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; - } - goto cleanup; - } - if (Status != STATUS_OBJECT_NAME_NOT_FOUND) - { - KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; - KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; - goto cleanup; - } - - /* 2. Create the ParentIdPrefix value */ - crc32 = RtlComputeCrc32(0, - (PUCHAR)DeviceNode->Parent->InstancePath.Buffer, - DeviceNode->Parent->InstancePath.Length); - - swprintf((PWSTR)ParentIdPrefixInformation->Data, L"%lx&%lx", DeviceNode->Parent->Level, crc32); - RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation->Data); - - /* 3. Try to write the ParentIdPrefix to registry */ - Status = ZwSetValueKey(hKey, - &ValueName, - 0, - REG_SZ, - (PVOID)KeyValue.Buffer, - (wcslen(KeyValue.Buffer) + 1) * sizeof(WCHAR)); + ULONG BufferLength; + UNICODE_STRING EnumU = RTL_CONSTANT_STRING(ENUM_ROOT); + PKEY_VALUE_PARTIAL_INFORMATION ParentIdPrefixInformation; + UNICODE_STRING KeyValue; + UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"ParentIdPrefix"); + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE hEnum, hKey = NULL; + ULONG crc32; + NTSTATUS Status; + + /* Allocate a buffer big enough to read a MAX_PATH prefix */ + BufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + MAX_PATH * sizeof(WCHAR); + ParentIdPrefixInformation = ExAllocatePool(PagedPool, BufferLength + sizeof(WCHAR)); + + /* Check if allocation succeeded */ + if (!ParentIdPrefixInformation) + { + Status = STATUS_NO_MEMORY; + goto cleanup; + } + + /* Open enum key */ + InitializeObjectAttributes(&ObjectAttributes, &EnumU, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL); + Status = ZwOpenKey(&hEnum, 0, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + goto cleanup; + + /* Open instance key */ + InitializeObjectAttributes(&ObjectAttributes, &DeviceNode->Parent->InstancePath, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, hEnum, NULL); + Status = ZwOpenKey(&hKey, KEY_QUERY_VALUE | KEY_SET_VALUE, &ObjectAttributes); + ZwClose(hEnum); + if (!NT_SUCCESS(Status)) + goto cleanup; + + /* Read the prefix */ + Status = ZwQueryValueKey( + hKey, &ValueName, + KeyValuePartialInformation, ParentIdPrefixInformation, + BufferLength, &BufferLength); + if (NT_SUCCESS(Status)) + { + /* Yes, we read something */ + if (ParentIdPrefixInformation->Type != REG_SZ) + /* Hm, it was of the wrong type. Fail */ + Status = STATUS_UNSUCCESSFUL; + else + { + /* OK, value is correct ; prepare to return it */ + KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; + KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; + } + + /* We're done */ + goto cleanup; + } + + /* Check if we failed due to value not calculated */ + if (Status != STATUS_OBJECT_NAME_NOT_FOUND) + /* Another reason, fail */ + goto cleanup; + + /* Compute the prefix string of the parent */ + crc32 = RtlComputeCrc32(0, + (PUCHAR)DeviceNode->Parent->InstancePath.Buffer, + DeviceNode->Parent->InstancePath.Length); + + /* Prepare the value to return */ + /* (yes, it's safe to reuse ParentIdPrefixInformation buffer, which is at least MAX_PATH WCHARs long */ + swprintf((PWSTR)ParentIdPrefixInformation, L"%lx&%lx", DeviceNode->Parent->Level, crc32); + RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation); + + /* 3. Try to write the ParentIdPrefix to registry */ + Status = ZwSetValueKey(hKey, + &ValueName, + 0, + REG_SZ, + (PVOID)KeyValue.Buffer, + KeyValue.MaximumLength); cleanup: - if (NT_SUCCESS(Status)) - { - /* Duplicate the string to return it */ - Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &KeyValue, ParentIdPrefix); - } - ExFreePool(ParentIdPrefixInformation); - ExFreePool(KeyNameBuffer); - if (hKey != NULL) - ZwClose(hKey); - return Status; + if (NT_SUCCESS(Status)) + { + /* Duplicate the string to return it */ + Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &KeyValue, ParentIdPrefix); + } + /* General cleanup */ + ExFreePool(ParentIdPrefixInformation); + if (hKey != NULL) + ZwClose(hKey); + return Status; } @@ -1727,9 +1722,9 @@ IO_STATUS_BLOCK IoStatusBlock; PDEVICE_NODE ParentDeviceNode; WCHAR InstancePath[MAX_PATH]; + UNICODE_STRING InstancePathU = { 0, sizeof(InstancePath), InstancePath }; IO_STACK_LOCATION Stack; NTSTATUS Status; - PWSTR KeyBuffer; PWSTR Ptr; USHORT Length; USHORT TotalLength; @@ -1791,12 +1786,7 @@ if (NT_SUCCESS(Status)) { /* Copy the device id string */ - wcscpy(InstancePath, (PWSTR)IoStatusBlock.Information); - - /* - * FIXME: Check for valid characters, if there is invalid characters - * then bugcheck. - */ + RtlAppendUnicodeToString(&InstancePathU, (PWSTR)IoStatusBlock.Information); } else { @@ -1834,21 +1824,16 @@ if (NT_SUCCESS(Status)) { /* Append the instance id string */ - wcscat(InstancePath, L"\\"); + RtlAppendUnicodeToString(&InstancePathU, L"\\"); if (ParentIdPrefix.Length > 0) { /* Add information from parent bus device to InstancePath */ - wcscat(InstancePath, ParentIdPrefix.Buffer); + RtlAppendUnicodeStringToString(&InstancePathU, &ParentIdPrefix); if (IoStatusBlock.Information && *(PWSTR)IoStatusBlock.Information) - wcscat(InstancePath, L"&"); + RtlAppendUnicodeToString(&InstancePathU, L"&"); } if (IoStatusBlock.Information) - wcscat(InstancePath, (PWSTR)IoStatusBlock.Information); - - /* - * FIXME: Check for valid characters, if there is invalid characters - * then bugcheck - */ + RtlAppendUnicodeToString(&InstancePathU, (PWSTR)IoStatusBlock.Information); } else { @@ -1856,29 +1841,25 @@ } RtlFreeUnicodeString(&ParentIdPrefix); - if (!RtlCreateUnicodeString(&DeviceNode->InstancePath, InstancePath)) - { - DPRINT("No resources\n"); - /* FIXME: Cleanup and disable device */ - } - - DPRINT("InstancePath is %S\n", DeviceNode->InstancePath.Buffer); - - /* - * Create registry key for the instance id, if it doesn't exist yet - */ - KeyBuffer = ExAllocatePool( - PagedPool, - (49 * sizeof(WCHAR)) + DeviceNode->InstancePath.Length); - wcscpy(KeyBuffer, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); - wcscat(KeyBuffer, DeviceNode->InstancePath.Buffer); - Status = IopCreateDeviceKeyPath(KeyBuffer, &InstanceKey); - ExFreePool(KeyBuffer); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to create the instance key! (Status %lx)\n", Status); - } - + /* + * FIXME: Check for valid characters, if there is invalid characters + * then bugcheck. + */ + + Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, + &InstancePathU, &DeviceNode->InstancePath); + if (!NT_SUCCESS(Status)) + { + DPRINT("No resources\n"); + /* FIXME: Cleanup and disable device */ + } + + DPRINT("InstancePath is %wZ\n", &DeviceNode->InstancePath); + + /* Create registry key for the instance id, if it doesn't exist yet */ + Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, &InstanceKey); + if (!NT_SUCCESS(Status)) + DPRINT1("IopCreateDeviceKeyPath('%wZ') failed (Status 0x%08lx)\n", &DeviceNode->InstancePath, Status); { /* Set 'Capabilities' value */ @@ -2329,102 +2310,106 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode, PVOID Context) { - RTL_QUERY_REGISTRY_TABLE QueryTable[3]; - PDEVICE_NODE ParentDeviceNode; - PUNICODE_STRING Service; - UNICODE_STRING ClassGUID; - NTSTATUS Status; - - DPRINT("IopActionConfigureChildServices(%p, %p)\n", DeviceNode, Context); - - ParentDeviceNode = (PDEVICE_NODE)Context; - - /* - * We are called for the parent too, but we don't need to do special - * handling for this node - */ - if (DeviceNode == ParentDeviceNode) - { - DPRINT("Success\n"); - return STATUS_SUCCESS; - } - - /* - * Make sure this device node is a direct child of the parent device node - * that is given as an argument - */ - if (DeviceNode->Parent != ParentDeviceNode) - { - /* Stop the traversal immediately and indicate successful operation */ - DPRINT("Stop\n"); - return STATUS_UNSUCCESSFUL; - } - - if (!IopDeviceNodeHasFlag(DeviceNode, DNF_DISABLED)) - { - WCHAR RegKeyBuffer[MAX_PATH]; - UNICODE_STRING RegKey; - - RegKey.Length = 0; - RegKey.MaximumLength = sizeof(RegKeyBuffer); - RegKey.Buffer = RegKeyBuffer; - - /* - * Retrieve configuration from Enum key - */ - - Service = &DeviceNode->ServiceName; - - RtlZeroMemory(QueryTable, sizeof(QueryTable)); - RtlInitUnicodeString(Service, NULL); - RtlInitUnicodeString(&ClassGUID, NULL); - - QueryTable[0].Name = L"Service"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[0].EntryContext = Service; - - QueryTable[1].Name = L"ClassGUID"; - QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[1].EntryContext = &ClassGUID; - QueryTable[1].DefaultType = REG_SZ; - QueryTable[1].DefaultData = L""; - QueryTable[1].DefaultLength = 0; - - RtlAppendUnicodeToString(&RegKey, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); - RtlAppendUnicodeStringToString(&RegKey, &DeviceNode->InstancePath); - - Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, - RegKey.Buffer, QueryTable, NULL, NULL); - - if (!NT_SUCCESS(Status)) - { - /* FIXME: Log the error */ - DPRINT("Could not retrieve configuration for device %wZ (Status 0x%08x)\n", - &DeviceNode->InstancePath, Status); - IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); - return STATUS_SUCCESS; - } - - if (Service->Buffer == NULL) - { - IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); - - if (ClassGUID.Length != 0) - { - /* Device has a ClassGUID value, but no Service value. - * Suppose it is using the NULL driver, so state the - * device is started */ - DPRINT1("%wZ is using NULL driver\n", &DeviceNode->InstancePath); - IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); - DeviceNode->Flags |= DN_STARTED; - } - return STATUS_SUCCESS; - } - - DPRINT("Got Service %S\n", Service->Buffer); - } - - return STATUS_SUCCESS; + RTL_QUERY_REGISTRY_TABLE QueryTable[4]; + PDEVICE_NODE ParentDeviceNode; + PUNICODE_STRING Service; + UNICODE_STRING ClassGUID; + NTSTATUS Status; + + DPRINT("IopActionConfigureChildServices(%p, %p)\n", DeviceNode, Context); + + ParentDeviceNode = (PDEVICE_NODE)Context; + + /* + * We are called for the parent too, but we don't need to do special + * handling for this node + */ + if (DeviceNode == ParentDeviceNode) + { + DPRINT("Success\n"); + return STATUS_SUCCESS; + } + + /* + * Make sure this device node is a direct child of the parent device node + * that is given as an argument + */ + ASSERT(DeviceNode->Parent == ParentDeviceNode); + + if (!IopDeviceNodeHasFlag(DeviceNode, DNF_DISABLED)) + { + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING EnumU = RTL_CONSTANT_STRING(ENUM_ROOT); + HANDLE hEnum; + + /* Open Enum key */ + InitializeObjectAttributes(&ObjectAttributes, &EnumU, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL) + Status = ZwOpenKey(&hEnum, 0, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + /* FIXME: Log the error */ + IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); + return Status; + } + + /* Prepare query table */ + RtlZeroMemory(QueryTable, sizeof(QueryTable)); + Service = &DeviceNode->ServiceName; + RtlInitUnicodeString(Service, NULL); + RtlInitUnicodeString(&ClassGUID, NULL); + + /* Hopefully, this string is always NULL terminated */ + QueryTable[0].Name = DeviceNode->InstancePath.Buffer; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_SUBKEY; + + QueryTable[1].Name = L"Service"; + QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[1].EntryContext = Service; + + QueryTable[2].Name = L"ClassGUID"; + QueryTable[2].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[2].EntryContext = &ClassGUID; + QueryTable[2].DefaultType = REG_SZ; + QueryTable[2].DefaultData = L""; + QueryTable[2].DefaultLength = 0; + + /* Read registry */ + Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, (PWSTR)hEnum, + QueryTable, NULL, NULL); + ZwClose(hEnum); + + /* Check for an error */ + if (!NT_SUCCESS(Status)) + { + /* FIXME: Log the error */ + DPRINT("Could not retrieve configuration for device %wZ (Status 0x%08x)\n", + &DeviceNode->InstancePath, Status); + IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); + return STATUS_SUCCESS; + } + + /* Check for a NULL service */ + if (Service->Length == 0) + { + IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); + + if (ClassGUID.Length != 0) + { + /* Device has a ClassGUID value, but no Service value. + * Suppose it is using the NULL driver, so state the + * device is started */ + DPRINT1("%wZ is using NULL driver\n", &DeviceNode->InstancePath); + IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); + DeviceNode->Flags |= DN_STARTED; + } + return STATUS_SUCCESS; + } + + DPRINT("Got Service %wZ\n", Service); + } + + return STATUS_SUCCESS; } /* @@ -2476,16 +2461,7 @@ * Make sure this device node is a direct child of the parent device node * that is given as an argument */ -#if 0 - if (DeviceNode->Parent != ParentDeviceNode) - { - /* - * Stop the traversal immediately and indicate unsuccessful operation - */ - DPRINT("Stop\n"); - return STATUS_UNSUCCESSFUL; - } -#endif + ASSERT(DeviceNode->Parent == ParentDeviceNode); if (!IopDeviceNodeHasFlag(DeviceNode, DNF_DISABLED) && !IopDeviceNodeHasFlag(DeviceNode, DNF_ADDED) && @@ -2563,8 +2539,8 @@ IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); IopDeviceNodeSetFlag(DeviceNode, DNF_START_FAILED); /* FIXME: Log the error (possibly in IopInitializeDeviceNodeService) */ - CPRINT("Initialization of service %S failed (Status %x)\n", - DeviceNode->ServiceName.Buffer, Status); + DPRINT("Initialization of service %wZ failed (Status %x)\n", + &DeviceNode->ServiceName, Status); } } }
16 years, 12 months
1
0
0
0
[hpoussin] 31466: NULL terminate string before sending it
by hpoussin@svn.reactos.org
Author: hpoussin Date: Thu Dec 27 21:53:24 2007 New Revision: 31466 URL:
http://svn.reactos.org/svn/reactos?rev=31466&view=rev
Log: NULL terminate string before sending it Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/plugpla…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c Thu Dec 27 21:53:24 2007 @@ -49,26 +49,36 @@ PUNICODE_STRING DeviceIds) { PPNP_EVENT_ENTRY EventEntry; + UNICODE_STRING Copy; ULONG TotalSize; - + NTSTATUS Status; + + ASSERT(DeviceIds); + + /* Allocate a big enough buffer */ + Copy.Length = 0; + Copy.MaximumLength = DeviceIds->Length + sizeof(UNICODE_NULL); TotalSize = FIELD_OFFSET(PLUGPLAY_EVENT_BLOCK, TargetDevice.DeviceIds) + - DeviceIds->MaximumLength; + Copy.MaximumLength; EventEntry = ExAllocatePool(NonPagedPool, TotalSize + FIELD_OFFSET(PNP_EVENT_ENTRY, Event)); - if (EventEntry == NULL) + if (!EventEntry) return STATUS_INSUFFICIENT_RESOURCES; - memcpy(&EventEntry->Event.EventGuid, - Guid, - sizeof(GUID)); + /* Fill the buffer with the event GUID */ + RtlCopyMemory(&EventEntry->Event.EventGuid, + Guid, + sizeof(GUID)); EventEntry->Event.EventCategory = TargetDeviceChangeEvent; EventEntry->Event.TotalSize = TotalSize; - memcpy(&EventEntry->Event.TargetDevice.DeviceIds, - DeviceIds->Buffer, - DeviceIds->MaximumLength); + /* Fill the device id */ + Copy.Buffer = EventEntry->Event.TargetDevice.DeviceIds; + Status = RtlAppendUnicodeStringToString(&Copy, DeviceIds); + if (!NT_SUCCESS(Status)) + return Status; InsertHeadList(&IopPnpEventQueueHead, &EventEntry->ListEntry);
16 years, 12 months
1
0
0
0
[greatlrd] 31465: implement DxEngGetDeviceGammaRamp implement DxEngSetDeviceGammaRamp
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Dec 27 21:51:27 2007 New Revision: 31465 URL:
http://svn.reactos.org/svn/reactos?rev=31465&view=rev
Log: implement DxEngGetDeviceGammaRamp implement DxEngSetDeviceGammaRamp Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c trunk/reactos/include/reactos/drivers/directx/dxeng.h trunk/reactos/subsystems/win32/win32k/include/intddraw.h trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Thu Dec 27 21:51:27 2007 @@ -441,7 +441,7 @@ DX_WINDBG_trace(); - // EnterCriticalSection(&ddcs); + EnterCriticalSection(&ddcs); *ppSurf = NULL; _SEH_TRY @@ -464,8 +464,8 @@ ret = DDERR_INVALIDPARAMS; } _SEH_END; - // LeaveCriticalSection(&ddcs); - return ret; + LeaveCriticalSection(&ddcs); + return ret; } @@ -476,7 +476,8 @@ { HRESULT ret; DX_WINDBG_trace(); - // EnterCriticalSection(&ddcs); + + EnterCriticalSection(&ddcs); *ppSurf = NULL; _SEH_TRY @@ -489,7 +490,7 @@ } _SEH_END; - // LeaveCriticalSection(&ddcs); + LeaveCriticalSection(&ddcs); return ret; } Modified: trunk/reactos/include/reactos/drivers/directx/dxeng.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/di…
============================================================================== --- trunk/reactos/include/reactos/drivers/directx/dxeng.h (original) +++ trunk/reactos/include/reactos/drivers/directx/dxeng.h Thu Dec 27 21:51:27 2007 @@ -67,7 +67,7 @@ /* Notes : same protypes NtGdiEngGetDeviceGammaRamp, diffent is we skipp the user mode checks and seh */ BOOL -DxEngGetDeviceGammaRamp(HDC hDC, LPVOID lpRamp); +DxEngGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp); /* Notes : Lock the hDC */ PDC DxEngLockDC(HDC hDC); @@ -75,7 +75,8 @@ /* Notes : Unlock the hDC */ BOOL DxEngUnlockDC(PDC pDC); - +/* Notes : Set Gamma ramp */ +BOOL DxEngSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Unuse); /* prototypes are not done yet, I need gather all my notes * to make them correct @@ -89,7 +90,6 @@ DWORD DxEngReferenceHdev(DWORD x1); DWORD DxEngIsHdevLockedByCurrentThread(DWORD x1); DWORD DxEngUnreferenceHdev(DWORD x1); -DWORD DxEngSetDeviceGammaRamp(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngSpTearDownSprites(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngSpUnTearDownSprites(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngSpSpritesVisible(DWORD x1); Modified: trunk/reactos/subsystems/win32/win32k/include/intddraw.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/intddraw.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/intddraw.h Thu Dec 27 21:51:27 2007 @@ -121,5 +121,8 @@ } \ } +/* Gammaramp internal prototype */ +BOOL FASTCALL IntGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp); +BOOL FASTCALL IntSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp); #endif /* _INT_W32k_DDRAW */ Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c Thu Dec 27 21:51:27 2007 @@ -123,16 +123,29 @@ return FALSE; } -/************************************************************************/ -/* DxEngGetDeviceGammaRamp */ -/************************************************************************/ -/* same protypes NtGdiEngGetDeviceGammaRamp, diffent is we skipp the user mode checks and seh */ +/*++ +* @name DxEngGetDeviceGammaRamp +* @implemented +* +* The function DxEngSetDeviceGammaRamp Set Gamma ramp from from dxg.sys + +* @param HDEV hPDev +* The hdev +* +* @param PGAMMARAMP Ramp +* to fill in our gama ramp +* +* @return +* This return FALSE or TRUE, FALSE for fail, TRUE for success +* +* @remarks. +* ReactOS does not loop it, only set the gamma once. +* +*--*/ BOOL -DxEngGetDeviceGammaRamp(HDC hDC, LPVOID lpRamp) -{ - /* FIXME redirect it to NtGdiEngGetDeviceGammaRamp internal call */ - UNIMPLEMENTED; - return FALSE; +DxEngGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp) +{ + return IntGetDeviceGammaRamp(hPDev, Ramp); } @@ -140,12 +153,12 @@ * @name DxEngLockDC * @implemented * -* The function DxEngLockDC lock a hdc from dxg.sys +* The function DxEngLockDC lock a hdc from dxg.sys * * @param HDC hDC * The handle we need want lock * -* @return +* @return * This api return PDC or NULL depns if it sussess lock the hdc or not * * @remarks. @@ -163,13 +176,13 @@ * @name DxEngUnlockDC * @implemented * -* The function DxEngUnlockDC Unlock a pDC (hdc) from dxg.sys +* The function DxEngUnlockDC Unlock a pDC (hdc) from dxg.sys * @param PDC pDC * The handle we need unlock * -* @return -* This api always return TRUE if it sussess or not +* @return +* This api always return TRUE if it sussess or not * * @remarks. * none @@ -265,13 +278,34 @@ return FALSE; } -/************************************************************************/ -/* DxEngSetDeviceGammaRamp */ -/************************************************************************/ -DWORD DxEngSetDeviceGammaRamp(DWORD x1, DWORD x2, DWORD x3) -{ - UNIMPLEMENTED; - return FALSE; + +/*++ +* @name DxEngSetDeviceGammaRamp +* @implemented +* +* The function DxEngSetDeviceGammaRamp Set Gamma ramp from from dxg.sys + +* @param HDEV hPDev +* The hdev +* +* @param PGAMMARAMP Ramp +* to set in our gama ramp +* +* @param BOOL Unuse +* Info on this are avail at request. at moment ReactOS does not +* does not use it. and problare never need it. +* +* @return +* This return FALSE or TRUE, FALSE for fail, TRUE for success +* +* @remarks. +* ReactOS does not loop it, only set the gamma once. +* +*--*/ +BOOL +DxEngSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Unuse) +{ + return IntSetDeviceGammaRamp(hPDev, Ramp); } /************************************************************************/
16 years, 12 months
1
0
0
0
[greatlrd] 31464: TAG video buffer memory at alloc
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Dec 27 21:30:36 2007 New Revision: 31464 URL:
http://svn.reactos.org/svn/reactos?rev=31464&view=rev
Log: TAG video buffer memory at alloc Modified: trunk/reactos/drivers/video/videoprt/resource.c trunk/reactos/drivers/video/videoprt/videoprt.h Modified: trunk/reactos/drivers/video/videoprt/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/res…
============================================================================== --- trunk/reactos/drivers/video/videoprt/resource.c (original) +++ trunk/reactos/drivers/video/videoprt/resource.c Thu Dec 27 21:30:36 2007 @@ -709,7 +709,7 @@ OUT PVOID *Buffer) { DPRINT("VideoPortAllocateBuffer\n"); - *Buffer = ExAllocatePool(PagedPool, Size); + *Buffer = ExAllocatePoolWithTag ( PagedPool, Size, TAG_VIDEO_PORT_BUFFER ) ; return *Buffer == NULL ? ERROR_NOT_ENOUGH_MEMORY : NO_ERROR; } Modified: trunk/reactos/drivers/video/videoprt/videoprt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/vid…
============================================================================== --- trunk/reactos/drivers/video/videoprt/videoprt.h (original) +++ trunk/reactos/drivers/video/videoprt/videoprt.h Thu Dec 27 21:30:36 2007 @@ -37,6 +37,7 @@ #include <debug.h> #define TAG_VIDEO_PORT TAG('V', 'I', 'D', 'P') +#define TAG_VIDEO_PORT_BUFFER TAG('V', 'p', 'm', '\0' ) #define DPFLTR_IHVVIDEO_ID 80 /* FIXME */
16 years, 12 months
1
0
0
0
[jimtabor] 31463: Support NtGdiGetDhpdev.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Dec 27 20:56:31 2007 New Revision: 31463 URL:
http://svn.reactos.org/svn/reactos?rev=31463&view=rev
Log: Support NtGdiGetDhpdev. Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/objects/dc.c Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h Thu Dec 27 20:56:31 2007 @@ -49,13 +49,14 @@ ULONG Status; } GDIPOINTER, *PGDIPOINTER; -typedef struct +typedef struct _GDIDEVICE { HANDLE Handle; // HSURF PVOID pvEntry; ULONG lucExcLock; ULONG Tid; + struct _GDIDEVICE *ppdevNext; FLONG flFlags; PERESOURCE hsemDevLock; Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Thu Dec 27 20:56:31 2007 @@ -543,7 +543,7 @@ PrimarySurface.DisplayNumber = DisplayNumber; PrimarySurface.flFlags = PDEV_DISPLAY; // Hard set,, add more flags. PrimarySurface.hsemDevLock = (PERESOURCE)EngCreateSemaphore(); - + PrimarySurface.ppdevNext = NULL; // Fixme! We need to support more than display drvs. ret = TRUE; goto cleanup; } @@ -3353,22 +3353,19 @@ NtGdiGetDhpdev( IN HDEV hdev) { - PGDIDEVICE pGdiDevice = (PGDIDEVICE) hdev; + PGDIDEVICE pPDev, pGdiDevice = (PGDIDEVICE) hdev; if (!pGdiDevice) return NULL; - // ATM we have one, so this cheesie test - if (pGdiDevice != &PrimarySurface) return NULL; -// -// if ( pGdiDevice < MmSystemRangeStart) return NULL; -// pPDev = &PrimarySurface; -// KeEnterCriticalRegion(); -// do -// { -// if (pGdiDevice == pPDev) break; -// else -// pPDev = pPDev->ppdevNext; -// } while (pPDev != NULL); -// KeLeaveCriticalRegion(); -// if (!pPDev) return NULL; + if ( pGdiDevice < (PGDIDEVICE)MmSystemRangeStart) return NULL; + pPDev = &PrimarySurface; + KeEnterCriticalRegion(); + do + { + if (pGdiDevice == pPDev) break; + else + pPDev = pPDev->ppdevNext; + } while (pPDev != NULL); + KeLeaveCriticalRegion(); + if (!pPDev) return NULL; return pGdiDevice->PDev; }
16 years, 12 months
1
0
0
0
[pschweitzer] 31462: If download if canceled, delete temporary file
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Dec 27 20:06:30 2007 New Revision: 31462 URL:
http://svn.reactos.org/svn/reactos?rev=31462&view=rev
Log: If download if canceled, delete temporary file Modified: trunk/rosapps/downloader/download.c Modified: trunk/rosapps/downloader/download.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/download.c?rev=…
============================================================================== --- trunk/rosapps/downloader/download.c (original) +++ trunk/rosapps/downloader/download.c Thu Dec 27 20:06:30 2007 @@ -316,17 +316,22 @@ end: if (bTempfile) { - DWORD dwSize = sizeof(DWORD); - DWORD dwValue, dwType = REG_DWORD; - if (RegQueryValueEx(hKey, - L"DeleteInstaller", - NULL, - &dwType, - (LPBYTE)&dwValue, - &dwSize) == ERROR_SUCCESS) - if (dwValue == 0x1) - DeleteFileW(path); - RegCloseKey(hKey); + if (bCancelled) + DeleteFileW(path); + else + { + DWORD dwSize = sizeof(DWORD); + DWORD dwValue, dwType = REG_DWORD; + if (RegQueryValueEx(hKey, + L"DeleteInstaller", + NULL, + &dwType, + (LPBYTE)&dwValue, + &dwSize) == ERROR_SUCCESS) + if (dwValue == 0x1) + DeleteFileW(path); + RegCloseKey(hKey); + } } EndDialog(Dlg, 0); return 0;
16 years, 12 months
1
0
0
0
[pschweitzer] 31461: [FORMATTING] Fix indentation
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Dec 27 19:52:25 2007 New Revision: 31461 URL:
http://svn.reactos.org/svn/reactos?rev=31461&view=rev
Log: [FORMATTING] Fix indentation Modified: trunk/rosapps/downloader/download.c Modified: trunk/rosapps/downloader/download.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/download.c?rev=…
============================================================================== --- trunk/rosapps/downloader/download.c (original) +++ trunk/rosapps/downloader/download.c Thu Dec 27 19:52:25 2007 @@ -43,29 +43,29 @@ extern WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT]; typedef struct _IBindStatusCallbackImpl - { - const IBindStatusCallbackVtbl *vtbl; - LONG ref; - HWND hDialog; - BOOL *pbCancelled; - } IBindStatusCallbackImpl; +{ + const IBindStatusCallbackVtbl *vtbl; + LONG ref; + HWND hDialog; + BOOL *pbCancelled; +} IBindStatusCallbackImpl; static HRESULT WINAPI dlQueryInterface(IBindStatusCallback* This, REFIID riid, void** ppvObject) { if (NULL == ppvObject) - { + { return E_POINTER; - } + } if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IBindStatusCallback)) - { + { IBindStatusCallback_AddRef( This ); *ppvObject = This; return S_OK; - } - - return E_NOINTERFACE; + } + + return E_NOINTERFACE; } static ULONG WINAPI @@ -83,10 +83,10 @@ DWORD ref = InterlockedDecrement(&This->ref); if( !ref ) - { + { DestroyWindow( This->hDialog ); HeapFree(GetProcessHeap(), 0, This); - } + } return ref; } @@ -117,7 +117,7 @@ static HRESULT WINAPI dlOnProgress(IBindStatusCallback* iface, ULONG ulProgress, - ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText) + ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText) { IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; HWND Item; @@ -126,29 +126,29 @@ Item = GetDlgItem(This->hDialog, IDC_PROGRESS); if (NULL != Item && 0 != ulProgressMax) - { + { SendMessageW(Item, PBM_SETPOS, (ulProgress * 100) / ulProgressMax, 0); - } + } Item = GetDlgItem(This->hDialog, IDC_STATUS); if (NULL != Item && NULL != szStatusText) - { + { SendMessageW(Item, WM_GETTEXT, sizeof(OldText) / sizeof(OldText[0]), - (LPARAM) OldText); + (LPARAM) OldText); if (sizeof(OldText) / sizeof(OldText[0]) - 1 <= wcslen(OldText) || 0 != wcscmp(OldText, szStatusText)) - { + { SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) szStatusText); - } - } + } + } SetLastError(0); r = GetWindowLongPtrW(This->hDialog, GWLP_USERDATA); if (0 != r || 0 != GetLastError()) - { + { *This->pbCancelled = TRUE; DPRINT("Cancelled\n"); return E_ABORT; - } + } return S_OK; } @@ -171,7 +171,7 @@ static HRESULT WINAPI dlOnDataAvailable(IBindStatusCallback* iface, DWORD grfBSCF, - DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed) + DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed) { DPRINT1("OnDataAvailable implemented\n"); @@ -188,17 +188,17 @@ static const IBindStatusCallbackVtbl dlVtbl = { - dlQueryInterface, - dlAddRef, - dlRelease, - dlOnStartBinding, - dlGetPriority, - dlOnLowResource, - dlOnProgress, - dlOnStopBinding, - dlGetBindInfo, - dlOnDataAvailable, - dlOnObjectAvailable + dlQueryInterface, + dlAddRef, + dlRelease, + dlOnStartBinding, + dlGetPriority, + dlOnLowResource, + dlOnProgress, + dlOnStopBinding, + dlGetBindInfo, + dlOnDataAvailable, + dlOnObjectAvailable }; static IBindStatusCallback* @@ -287,18 +287,18 @@ dl = CreateDl(Context, &bCancelled); r = URLDownloadToFileW(NULL, SelectedApplication->Location, path, 0, dl); if (NULL != dl) - { + { IBindStatusCallback_Release(dl); - } + } if (S_OK != r) - { + { MessageBoxW(0,Strings[IDS_DOWNLOAD_ERROR],0,0); goto end; - } + } else if (bCancelled) - { + { goto end; - } + } ShowWindow(Dlg, SW_HIDE); /* run it */ @@ -306,9 +306,9 @@ si.cb = sizeof(si); r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi); if (0 == r) - { + { goto end; - } + } CloseHandle(pi.hThread); WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); @@ -340,7 +340,7 @@ HWND Item; switch (Msg) - { + { case WM_INITDIALOG:/* Icon = LoadIconW((HINSTANCE) GetWindowLongPtr(Dlg, GWLP_HINSTANCE), MAKEINTRESOURCEW(IDI_ICON_MAIN)); @@ -349,13 +349,13 @@ SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) Icon); SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) Icon); }*/ - SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0); - Item = GetDlgItem(Dlg, IDC_PROGRESS); - if (NULL != Item) - { - SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0,100)); - SendMessageW(Item, PBM_SETPOS, 0, 0); - }/* + SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0); + Item = GetDlgItem(Dlg, IDC_PROGRESS); + if (NULL != Item) + { + SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0,100)); + SendMessageW(Item, PBM_SETPOS, 0, 0); + }/* Item = GetDlgItem(Dlg, IDC_REMOVE); if (NULL != Item) { @@ -370,27 +370,27 @@ ShowWindow(Item, SW_HIDE); } }*/ - Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId); - if (NULL == Thread) - { + Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId); + if (NULL == Thread) + { + return FALSE; + } + CloseHandle(Thread); + return TRUE; + + case WM_COMMAND: + if (wParam == IDCANCEL) + { + SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1); + PostMessage(Dlg, WM_CLOSE, 0, 0); + } return FALSE; - } - CloseHandle(Thread); - return TRUE; - - case WM_COMMAND: - if (wParam == IDCANCEL) - { - SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1); - PostMessage(Dlg, WM_CLOSE, 0, 0); - } - return FALSE; - - case WM_CLOSE: - EndDialog(Dlg, 0); - return TRUE; - - default: - return FALSE; - } -} + + case WM_CLOSE: + EndDialog(Dlg, 0); + return TRUE; + + default: + return FALSE; + } +}
16 years, 12 months
1
0
0
0
[pschweitzer] 31460: Added help tooltips to header buttons
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Dec 27 17:40:02 2007 New Revision: 31460 URL:
http://svn.reactos.org/svn/reactos?rev=31460&view=rev
Log: Added help tooltips to header buttons Modified: trunk/rosapps/downloader/lang/de-DE.rc trunk/rosapps/downloader/lang/en-US.rc trunk/rosapps/downloader/lang/es-ES.rc trunk/rosapps/downloader/lang/fr-FR.rc trunk/rosapps/downloader/lang/id-ID.rc trunk/rosapps/downloader/lang/it-IT.rc trunk/rosapps/downloader/lang/ru-RU.rc trunk/rosapps/downloader/lang/uk-UA.rc trunk/rosapps/downloader/main.c trunk/rosapps/downloader/resources.h Modified: trunk/rosapps/downloader/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/lang/de-DE.rc?r…
============================================================================== --- trunk/rosapps/downloader/lang/de-DE.rc (original) +++ trunk/rosapps/downloader/lang/de-DE.rc Thu Dec 27 17:40:02 2007 @@ -54,4 +54,7 @@ IDS_DOWNLOAD_FOLDER "Downloader" IDS_UNABLECREATE_FOLDER "Es konnte kein Ordner mit diesem Namen erstellt werden!" IDS_UPDATE_URL "
http://svn.reactos.org
" + TTT_HELPBUTTON, "Get help about the downloader" + TTT_UPDATEBUTTON, "Not yet available" + TTT_PROFBUTTON, "Let you configure the downloader" END Modified: trunk/rosapps/downloader/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/lang/en-US.rc?r…
============================================================================== --- trunk/rosapps/downloader/lang/en-US.rc (original) +++ trunk/rosapps/downloader/lang/en-US.rc Thu Dec 27 17:40:02 2007 @@ -54,4 +54,7 @@ IDS_DOWNLOAD_FOLDER "Downloader" IDS_UNABLECREATE_FOLDER "Unable to create a folder with this name!" IDS_UPDATE_URL "
http://svn.reactos.org
" + TTT_HELPBUTTON, "Get help about the downloader" + TTT_UPDATEBUTTON, "Not yet available" + TTT_PROFBUTTON, "Let you configure the downloader" END Modified: trunk/rosapps/downloader/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/lang/es-ES.rc?r…
============================================================================== --- trunk/rosapps/downloader/lang/es-ES.rc (original) +++ trunk/rosapps/downloader/lang/es-ES.rc Thu Dec 27 17:40:02 2007 @@ -59,4 +59,7 @@ IDS_DOWNLOAD_FOLDER "Downloader" IDS_UNABLECREATE_FOLDER "¡Imposible crear una carpeta con este nombre!" IDS_UPDATE_URL "
http://svn.reactos.org
" + TTT_HELPBUTTON, "Get help about the downloader" + TTT_UPDATEBUTTON, "Not yet available" + TTT_PROFBUTTON, "Let you configure the downloader" END Modified: trunk/rosapps/downloader/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/lang/fr-FR.rc?r…
============================================================================== --- trunk/rosapps/downloader/lang/fr-FR.rc (original) +++ trunk/rosapps/downloader/lang/fr-FR.rc Thu Dec 27 17:40:02 2007 @@ -54,4 +54,7 @@ IDS_DOWNLOAD_FOLDER "Downloader" IDS_UNABLECREATE_FOLDER "Échec lors du répertoire avec ce nom !" IDS_UPDATE_URL "
http://svn.reactos.org
" + TTT_HELPBUTTON, "Obtenez de l'aide à propros du téléchargeur" + TTT_UPDATEBUTTON, "Pas encore disponible" + TTT_PROFBUTTON, "Vous permet de configurer le téléchargeur" END Modified: trunk/rosapps/downloader/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/lang/id-ID.rc?r…
============================================================================== --- trunk/rosapps/downloader/lang/id-ID.rc (original) +++ trunk/rosapps/downloader/lang/id-ID.rc Thu Dec 27 17:40:02 2007 @@ -54,4 +54,7 @@ IDS_DOWNLOAD_FOLDER "Downloader" IDS_UNABLECREATE_FOLDER "Unable to create a folder with this name!" IDS_UPDATE_URL "
http://svn.reactos.org
" + TTT_HELPBUTTON, "Get help about the downloader" + TTT_UPDATEBUTTON, "Not yet available" + TTT_PROFBUTTON, "Let you configure the downloader" END Modified: trunk/rosapps/downloader/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/lang/it-IT.rc?r…
============================================================================== --- trunk/rosapps/downloader/lang/it-IT.rc (original) +++ trunk/rosapps/downloader/lang/it-IT.rc Thu Dec 27 17:40:02 2007 @@ -54,4 +54,7 @@ IDS_DOWNLOAD_FOLDER "Downloader" IDS_UNABLECREATE_FOLDER "Unable to create a folder with this name!" IDS_UPDATE_URL "
http://svn.reactos.org
" + TTT_HELPBUTTON, "Get help about the downloader" + TTT_UPDATEBUTTON, "Not yet available" + TTT_PROFBUTTON, "Let you configure the downloader" END Modified: trunk/rosapps/downloader/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/lang/ru-RU.rc?r…
============================================================================== --- trunk/rosapps/downloader/lang/ru-RU.rc (original) +++ trunk/rosapps/downloader/lang/ru-RU.rc Thu Dec 27 17:40:02 2007 @@ -56,4 +56,7 @@ IDS_DOWNLOAD_FOLDER "Ñêà÷àòü!" IDS_UNABLECREATE_FOLDER "Íå óäàëîñü ñîçäàòü ïàïêó ñ òàêèì èìåíåì!" IDS_UPDATE_URL "
http://svn.reactos.org
" + TTT_HELPBUTTON, "Get help about the downloader" + TTT_UPDATEBUTTON, "Not yet available" + TTT_PROFBUTTON, "Let you configure the downloader" END Modified: trunk/rosapps/downloader/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/lang/uk-UA.rc?r…
============================================================================== --- trunk/rosapps/downloader/lang/uk-UA.rc (original) +++ trunk/rosapps/downloader/lang/uk-UA.rc Thu Dec 27 17:40:02 2007 @@ -62,4 +62,7 @@ IDS_DOWNLOAD_FOLDER "Downloader" IDS_UNABLECREATE_FOLDER "Íå âäàëîñÿ ñòâîðèòè ïàïêó ç òàêèì ³ì'ÿì!" IDS_UPDATE_URL "
http://svn.reactos.org
" + TTT_HELPBUTTON, "Get help about the downloader" + TTT_UPDATEBUTTON, "Not yet available" + TTT_PROFBUTTON, "Let you configure the downloader" END Modified: trunk/rosapps/downloader/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/main.c?rev=3146…
============================================================================== --- trunk/rosapps/downloader/main.c (original) +++ trunk/rosapps/downloader/main.c Thu Dec 27 17:40:02 2007 @@ -143,6 +143,31 @@ } } +BOOL CreateToolTip(HWND hwndTool, HWND hDlg, WCHAR* pText) +{ + if (!hwndTool || !hDlg || !pText) + return FALSE; + + HWND hwndTip = CreateWindowExW(0, TOOLTIPS_CLASS, NULL, + WS_POPUP |TTS_ALWAYSTIP | TTS_BALLOON, + CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, + hDlg, NULL, + GetModuleHandle(NULL), NULL); + if (!hwndTip) + return FALSE; + + TOOLINFO toolInfo = {0}; + toolInfo.cbSize = sizeof(toolInfo); + toolInfo.hwnd = hDlg; + toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS; + toolInfo.uId = (UINT_PTR)hwndTool; + toolInfo.lpszText = pText; + SendMessage(hwndTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo); + + return TRUE; +} + BOOL SetupControls (HWND hwnd) { @@ -150,6 +175,7 @@ HIMAGELIST hImageList; HINSTANCE hInstance = GetModuleHandle(NULL); WCHAR Cats[MAX_STRING_LENGHT], Apps[MAX_STRING_LENGHT]; + WCHAR Tooltip1[MAX_STRING_LENGHT], Tooltip2[MAX_STRING_LENGHT], Tooltip3[MAX_STRING_LENGHT]; TCHAR Buf[MAX_PATH]; char Tmp[MAX_PATH]; int i; @@ -184,18 +210,28 @@ WS_CHILD | WS_VISIBLE | BS_ICON, 550, 10, 40, 40, hwnd, 0, hInstance, NULL); + LoadString(hInstance, TTT_HELPBUTTON, Tooltip1, MAX_STRING_LENGHT); + CreateToolTip(hHelpButton, hwnd, Tooltip1); + hUpdateButton = CreateWindowW(L"Button", L"", WS_CHILD | WS_VISIBLE | BS_ICON, 450, 10, 40, 40, hwnd, 0, hInstance, NULL); + LoadString(hInstance, TTT_UPDATEBUTTON, Tooltip2, MAX_STRING_LENGHT); + CreateToolTip(hUpdateButton, hwnd, Tooltip2); + hProfButton = CreateWindowW(L"Button", L"", WS_CHILD | WS_VISIBLE | BS_ICON, 500, 10, 40, 40, hwnd, 0, hInstance, NULL); + LoadString(hInstance, TTT_PROFBUTTON, Tooltip3, MAX_STRING_LENGHT); + CreateToolTip(hProfButton, hwnd, Tooltip3); + hDownloadButton = CreateWindowW(L"Button", L"", WS_CHILD | WS_VISIBLE | BS_BITMAP, 330, 505, 140, 33, hwnd, 0, hInstance, NULL); + hUninstallButton = CreateWindowW(L"Button", L"", WS_CHILD | WS_VISIBLE | BS_BITMAP, 260, 505, 140, 33, Modified: trunk/rosapps/downloader/resources.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/downloader/resources.h?rev…
============================================================================== --- trunk/rosapps/downloader/resources.h (original) +++ trunk/rosapps/downloader/resources.h Thu Dec 27 17:40:02 2007 @@ -58,6 +58,10 @@ #define IDS_UNABLECREATE_FOLDER 25 #define IDS_UPDATE_URL 26 +#define TTT_HELPBUTTON 50 +#define TTT_UPDATEBUTTON 51 +#define TTT_PROFBUTTON 52 + #define IDD_PROF 6000
16 years, 12 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
61
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Results per page:
10
25
50
100
200