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
2025
June
May
April
March
February
January
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
November 2005
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 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
27 participants
875 discussions
Start a n
N
ew thread
[ion] 18944: - RtlCreateUnicodeString fails if the Length is > 0xFFFE on Windows NT 5.2 and higher. Spotted by Thomas.
by ion@svn.reactos.com
- RtlCreateUnicodeString fails if the Length is > 0xFFFE on Windows NT 5.2 and higher. Spotted by Thomas. Modified: trunk/reactos/lib/rtl/unicode.c _____ Modified: trunk/reactos/lib/rtl/unicode.c --- trunk/reactos/lib/rtl/unicode.c 2005-11-01 23:39:12 UTC (rev 18943) +++ trunk/reactos/lib/rtl/unicode.c 2005-11-01 23:54:39 UTC (rev 18944) @@ -1943,6 +1943,8 @@ PAGED_CODE_RTL(); Length = (wcslen(Source) + 1) * sizeof(WCHAR); + if (Length > 0xFFFE) return FALSE; +
…
[View More]
UniDest->Buffer = RtlpAllocateStringMemory(Length, TAG_USTR); if (UniDest->Buffer == NULL) return FALSE;
[View Less]
19 years, 7 months
1
0
0
0
[gvg] 18943: Patch by hpoussin/GvG
by gvg@svn.reactos.com
Patch by hpoussin/GvG - Read parameters in the right registry key - Force exclusive opening on device object - Add hack for first stage setup (link main device object to \??\Keyboard) - Use buffered IO - Reference pointer port DOs when they are linked to pointer class DO Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.c _____ Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.c --- trunk/reactos/drivers/input/kbdclass/kbdclass.c 2005-11-01 23:37:26 UTC (rev 18942) +++ trunk/
…
[View More]
reactos/drivers/input/kbdclass/kbdclass.c 2005-11-01 23:39:12 UTC (rev 18943) @@ -48,6 +48,20 @@ } static NTSTATUS NTAPI +KbdclassCleanup( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + DPRINT("IRP_MJ_CLEANUP\n"); + + if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO) + return ForwardIrpAndForget(DeviceObject, Irp); + + /* FIXME: close all associated Port devices */ + return STATUS_SUCCESS; +} + +static NTSTATUS NTAPI KbdclassRead( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) @@ -79,7 +93,7 @@ NTSTATUS Status; DPRINT("IRP_MJ_DEVICE_CONTROL\n"); - + if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO) return ForwardIrpAndForget(DeviceObject, Irp); @@ -148,6 +162,7 @@ IN PUNICODE_STRING RegistryPath, IN PKBDCLASS_DRIVER_EXTENSION DriverExtension) { + UNICODE_STRING ParametersRegistryKey; RTL_QUERY_REGISTRY_TABLE Parameters[4]; NTSTATUS Status; @@ -155,6 +170,18 @@ ULONG DefaultKeyboardDataQueueSize = 0x64; UNICODE_STRING DefaultKeyboardDeviceBaseName = RTL_CONSTANT_STRING(L"KeyboardClass"); + ParametersRegistryKey.Length = 0; + ParametersRegistryKey.MaximumLength = RegistryPath->Length + sizeof(L"\\Parameters") + sizeof(UNICODE_NULL); + ParametersRegistryKey.Buffer = ExAllocatePool(PagedPool, ParametersRegistryKey.MaximumLength); + if (!ParametersRegistryKey.Buffer) + { + DPRINT("ExAllocatePool() failed\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + RtlCopyUnicodeString(&ParametersRegistryKey, RegistryPath); + RtlAppendUnicodeToString(&ParametersRegistryKey, L"\\Parameters"); + ParametersRegistryKey.Buffer[ParametersRegistryKey.Length / sizeof(WCHAR)] = UNICODE_NULL; + RtlZeroMemory(Parameters, sizeof(Parameters)); Parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL; @@ -163,14 +190,14 @@ Parameters[0].DefaultType = REG_DWORD; Parameters[0].DefaultData = &DefaultConnectMultiplePorts; Parameters[0].DefaultLength = sizeof(ULONG); - + Parameters[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL; Parameters[1].Name = L"KeyboardDataQueueSize"; Parameters[1].EntryContext = &DriverExtension->KeyboardDataQueueSize; Parameters[1].DefaultType = REG_DWORD; Parameters[1].DefaultData = &DefaultKeyboardDataQueueSize; Parameters[1].DefaultLength = sizeof(ULONG); - + Parameters[2].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL; Parameters[2].Name = L"KeyboardDeviceBaseName"; Parameters[2].EntryContext = &DriverExtension->KeyboardDeviceBaseName; @@ -180,7 +207,7 @@ Status = RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, - RegistryPath->Buffer, + ParametersRegistryKey.Buffer, Parameters, NULL, NULL); @@ -198,6 +225,16 @@ DriverExtension->KeyboardDataQueueSize = DefaultKeyboardDataQueueSize; } } + else if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + { + /* Registry path doesn't exist. Set defaults */ + DriverExtension->ConnectMultiplePorts = DefaultConnectMultiplePorts; + DriverExtension->KeyboardDataQueueSize = DefaultKeyboardDataQueueSize; + Status = RtlDuplicateUnicodeString( + RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, + &DefaultKeyboardDeviceBaseName, + &DriverExtension->KeyboardDeviceBaseName); + } return Status; } @@ -208,6 +245,7 @@ OUT PDEVICE_OBJECT *ClassDO OPTIONAL) { PKBDCLASS_DRIVER_EXTENSION DriverExtension; + UNICODE_STRING SymbolicLinkName = RTL_CONSTANT_STRING(L"\\??\\Keyboard"); ULONG DeviceId = 0; ULONG PrefixLength; UNICODE_STRING DeviceNameU; @@ -255,7 +293,7 @@ &DeviceNameU, FILE_DEVICE_KEYBOARD, FILE_DEVICE_SECURE_OPEN, - FALSE, + TRUE, &Fdo); if (NT_SUCCESS(Status)) goto cleanup; @@ -269,9 +307,11 @@ DPRINT("Too much devices starting with '\\Device\\%wZ'\n", &DriverExtension->KeyboardDeviceBaseName); Status = STATUS_UNSUCCESSFUL; cleanup: - ExFreePool(DeviceNameU.Buffer); if (!NT_SUCCESS(Status)) + { + ExFreePool(DeviceNameU.Buffer); return Status; + } DeviceExtension = (PKBDCLASS_DEVICE_EXTENSION)Fdo->DeviceExtension; RtlZeroMemory(DeviceExtension, sizeof(KBDCLASS_DEVICE_EXTENSION)); @@ -282,11 +322,17 @@ DeviceExtension->ReadIsPending = FALSE; DeviceExtension->InputCount = 0; DeviceExtension->PortData = ExAllocatePool(NonPagedPool, DeviceExtension->DriverExtension->KeyboardDataQueueSize * sizeof(KEYBOARD_INPUT_DATA)); - Fdo->Flags |= DO_POWER_PAGABLE; + Fdo->Flags |= DO_POWER_PAGABLE | DO_BUFFERED_IO; Fdo->Flags &= ~DO_DEVICE_INITIALIZING; /* FIXME: create registry entry in HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP */ + /* HACK: 1st stage setup needs a keyboard to open it in user-mode + * Create a link to user space... */ + IoCreateSymbolicLink(&SymbolicLinkName, &DeviceNameU); + + ExFreePool(DeviceNameU.Buffer); + if (ClassDO) *ClassDO = Fdo; @@ -323,7 +369,7 @@ /* A read request is waiting for input, so go straight to it */ /* FIXME: use SEH */ RtlCopyMemory( - Irp->MdlAddress ? MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority) : Irp->UserBuffer, + Irp->MdlAddress ? MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority) : Irp->AssociatedIrp.SystemBuffer, KeyboardDataStart, sizeof(KEYBOARD_INPUT_DATA)); @@ -416,6 +462,9 @@ else IoStatus.Status = Status; + if (NT_SUCCESS(Status)) + ObReferenceObject(KeyboardPortDO); + return IoStatus.Status; } @@ -440,7 +489,7 @@ NULL, Pdo->DeviceType, FILE_DEVICE_SECURE_OPEN, - FALSE, + TRUE, &Fdo); if (!NT_SUCCESS(Status)) { @@ -461,7 +510,6 @@ return Status; } Fdo->Flags |= DO_BUFFERED_IO; - Fdo->Flags &= ~DO_DEVICE_INITIALIZING; if (DriverExtension->ConnectMultiplePorts) Status = ConnectKeyboardPortDriver(Fdo, DriverExtension->MainKbdclassDeviceObject); @@ -470,11 +518,12 @@ if (!NT_SUCCESS(Status)) { DPRINT("ConnectKeyboardPortDriver() failed with status 0x%08lx\n", Status); + IoDetachDevice(DeviceExtension->LowerDevice); /* FIXME: why can't I cleanup without error? */ - //IoDetachDevice(Fdo); //IoDeleteDevice(Fdo); return Status; } + Fdo->Flags &= ~DO_DEVICE_INITIALIZING; /* Register GUID_DEVINTERFACE_KEYBOARD interface */ Status = IoRegisterDeviceInterface( @@ -621,7 +670,7 @@ { /* FIXME: Log the error */ DPRINT("ConnectKeyboardPortDriver() failed with status 0x%08lx\n", Status); - /* FIXME: cleanup */ + ObReferenceObject(PortDeviceObject); } } else @@ -632,7 +681,7 @@ { /* FIXME: Log the error */ DPRINT("CreatePointerClassDeviceObject() failed with status 0x%08lx\n", Status); - /* FIXME: cleanup */ + ObReferenceObject(PortDeviceObject); continue; } Status = ConnectKeyboardPortDriver(PortDeviceObject, ClassDO); @@ -640,7 +689,8 @@ { /* FIXME: Log the error */ DPRINT("ConnectKeyboardPortDriver() failed with status 0x%08lx\n", Status); - /* FIXME: cleanup */ + ObReferenceObject(PortDeviceObject); + IoDeleteDevice(ClassDO); } } } @@ -708,6 +758,7 @@ DriverObject->MajorFunction[IRP_MJ_CREATE] = KbdclassCreate; DriverObject->MajorFunction[IRP_MJ_CLOSE] = KbdclassClose; + DriverObject->MajorFunction[IRP_MJ_CLEANUP] = KbdclassCleanup; DriverObject->MajorFunction[IRP_MJ_READ] = KbdclassRead; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = KbdclassDeviceControl; DriverObject->DriverStartIo = KbdclassStartIo;
[View Less]
19 years, 7 months
1
0
0
0
[ion] 18942: - Revert so call "Fixes" introduced in 18941 because they are bugs which I had to fix in 18002 and adding back bugs isn't really a good idea.
by ion@svn.reactos.com
- Revert so call "Fixes" introduced in 18941 because they are bugs which I had to fix in 18002 and adding back bugs isn't really a good idea. Modified: trunk/reactos/lib/rtl/unicode.c _____ Modified: trunk/reactos/lib/rtl/unicode.c --- trunk/reactos/lib/rtl/unicode.c 2005-11-01 22:45:35 UTC (rev 18941) +++ trunk/reactos/lib/rtl/unicode.c 2005-11-01 23:37:26 UTC (rev 18942) @@ -357,6 +357,7 @@ if (AnsiString->Buffer) { RtlpFreeStringMemory(AnsiString->Buffer,
…
[View More]
TAG_ASTR); + RtlZeroMemory(AnsiString, sizeof(ANSI_STRING)); } } @@ -369,10 +370,7 @@ { PAGED_CODE_RTL(); - if (OemString->Buffer) - { - RtlpFreeStringMemory(OemString->Buffer, TAG_OSTR); - } + if (OemString->Buffer) RtlpFreeStringMemory(OemString->Buffer, TAG_OSTR); } /* @@ -387,6 +385,7 @@ if (UnicodeString->Buffer) { RtlpFreeStringMemory(UnicodeString->Buffer, TAG_ASTR); + RtlZeroMemory(UnicodeString, sizeof(UNICODE_STRING)); } } @@ -485,7 +484,7 @@ if(SourceString) { DestSize = wcslen(SourceString) * sizeof(WCHAR); - if (DestSize > 0xFFFE) return STATUS_NAME_TOO_LONG; + if (DestSize >= 0xFFFC) return STATUS_NAME_TOO_LONG; DestinationString->Length = (USHORT)DestSize; DestinationString->MaximumLength = (USHORT)DestSize + sizeof(WCHAR); } @@ -1944,8 +1943,6 @@ PAGED_CODE_RTL(); Length = (wcslen(Source) + 1) * sizeof(WCHAR); - if (Length > 0xFFFE) return FALSE; - UniDest->Buffer = RtlpAllocateStringMemory(Length, TAG_USTR); if (UniDest->Buffer == NULL) return FALSE;
[View Less]
19 years, 7 months
1
0
0
0
[weiden] 18941: various minor fixes
by weiden@svn.reactos.com
various minor fixes Modified: trunk/reactos/lib/rtl/unicode.c _____ Modified: trunk/reactos/lib/rtl/unicode.c --- trunk/reactos/lib/rtl/unicode.c 2005-11-01 22:39:14 UTC (rev 18940) +++ trunk/reactos/lib/rtl/unicode.c 2005-11-01 22:45:35 UTC (rev 18941) @@ -69,6 +69,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlAnsiStringToUnicodeSize(AnsiSource); if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; UniDest->Length = (USHORT)
…
[View More]
Length - sizeof(WCHAR); @@ -350,10 +352,11 @@ NTAPI RtlFreeAnsiString(IN PANSI_STRING AnsiString) { + PAGED_CODE_RTL(); + if (AnsiString->Buffer) { RtlpFreeStringMemory(AnsiString->Buffer, TAG_ASTR); - RtlZeroMemory(AnsiString, sizeof(ANSI_STRING)); } } @@ -364,7 +367,12 @@ NTAPI RtlFreeOemString(IN POEM_STRING OemString) { - if (OemString->Buffer) RtlpFreeStringMemory(OemString->Buffer, TAG_OSTR); + PAGED_CODE_RTL(); + + if (OemString->Buffer) + { + RtlpFreeStringMemory(OemString->Buffer, TAG_OSTR); + } } /* @@ -374,10 +382,11 @@ NTAPI RtlFreeUnicodeString(IN PUNICODE_STRING UnicodeString) { + PAGED_CODE_RTL(); + if (UnicodeString->Buffer) { RtlpFreeStringMemory(UnicodeString->Buffer, TAG_ASTR); - RtlZeroMemory(UnicodeString, sizeof(UNICODE_STRING)); } } @@ -476,7 +485,7 @@ if(SourceString) { DestSize = wcslen(SourceString) * sizeof(WCHAR); - if (DestSize > 0xFFFC) return STATUS_NAME_TOO_LONG; + if (DestSize > 0xFFFE) return STATUS_NAME_TOO_LONG; DestinationString->Length = (USHORT)DestSize; DestinationString->MaximumLength = (USHORT)DestSize + sizeof(WCHAR); } @@ -905,6 +914,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlUnicodeStringToAnsiSize(UniSource); if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; @@ -958,6 +969,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlOemStringToUnicodeSize(OemSource); if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; @@ -1008,6 +1021,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlUnicodeStringToOemSize(UniSource); if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; @@ -1119,6 +1134,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlOemStringToCountedUnicodeSize(OemSource); if (!Length) @@ -1427,6 +1444,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlUnicodeStringToCountedOemSize(UniSource); if (!Length) @@ -1532,6 +1551,8 @@ { ULONG i, j; + PAGED_CODE_RTL(); + if (AllocateDestinationString == TRUE) { UniDest->MaximumLength = UniSource->Length; @@ -1572,6 +1593,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlUnicodeStringToAnsiSize(UniSource); if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; @@ -1623,6 +1646,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlUnicodeStringToCountedOemSize(UniSource); if (!Length) @@ -1680,6 +1705,8 @@ ULONG Length; ULONG Index; + PAGED_CODE_RTL(); + Length = RtlUnicodeStringToOemSize(UniSource); if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; @@ -1914,7 +1941,11 @@ { ULONG Length; + PAGED_CODE_RTL(); + Length = (wcslen(Source) + 1) * sizeof(WCHAR); + if (Length > 0xFFFE) return FALSE; + UniDest->Buffer = RtlpAllocateStringMemory(Length, TAG_USTR); if (UniDest->Buffer == NULL) return FALSE; @@ -1965,6 +1996,8 @@ ULONG i; ULONG StopGap; + PAGED_CODE_RTL(); + if (AllocateDestinationString) { UniDest->MaximumLength = UniSource->Length; @@ -2108,6 +2141,8 @@ IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString) { + PAGED_CODE_RTL(); + if (SourceString == NULL || DestinationString == NULL) return STATUS_INVALID_PARAMETER;
[View Less]
19 years, 7 months
1
0
0
0
[weiden] 18940: fixed a typo
by weiden@svn.reactos.com
fixed a typo Modified: trunk/reactos/lib/rtl/sd.c _____ Modified: trunk/reactos/lib/rtl/sd.c --- trunk/reactos/lib/rtl/sd.c 2005-11-01 22:36:00 UTC (rev 18939) +++ trunk/reactos/lib/rtl/sd.c 2005-11-01 22:39:14 UTC (rev 18940) @@ -868,8 +868,8 @@ AbsSD->Owner = NULL; AbsSD->Group = NULL; + AbsSD->Sacl = NULL; AbsSD->Dacl = NULL; - AbsSD->Sacl = NULL; } /* clear the self-relative flag */ @@ -889,8 +889,8 @@ AbsSD-&
…
[View More]
gt;Control &= ~SE_SELF_RELATIVE; AbsSD->Owner = pOwner; AbsSD->Group = pGroup; - AbsSD->Sacl = pDacl; - AbsSD->Dacl = pSacl; + AbsSD->Sacl = pSacl; + AbsSD->Dacl = pDacl; #endif
[View Less]
19 years, 7 months
1
0
0
0
[weiden] 18939: properly handle fragmented self-relative security descriptors in the 64 bit version of RtlSelfRelativeToAbsoluteSD2
by weiden@svn.reactos.com
properly handle fragmented self-relative security descriptors in the 64 bit version of RtlSelfRelativeToAbsoluteSD2 Modified: trunk/reactos/lib/rtl/sd.c _____ Modified: trunk/reactos/lib/rtl/sd.c --- trunk/reactos/lib/rtl/sd.c 2005-11-01 21:53:36 UTC (rev 18938) +++ trunk/reactos/lib/rtl/sd.c 2005-11-01 22:36:00 UTC (rev 18939) @@ -735,8 +735,9 @@ PISECURITY_DESCRIPTOR AbsSD = SelfRelativeSecurityDescriptor; PISECURITY_DESCRIPTOR_RELATIVE RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)
…
[View More]
SelfRelativeSecurityDescriptor; #ifdef _WIN64 - PVOID DataStart; + PVOID DataStart, DataEnd; ULONG DataSize; + LONG MoveDelta; ULONG OwnerLength; ULONG GroupLength; ULONG DaclLength; @@ -784,7 +785,37 @@ ASSERT(sizeof(SECURITY_DESCRIPTOR) > sizeof(SECURITY_DESCRIPTOR_RELATIVE)); - DataSize = OwnerLength + GroupLength + DaclLength + SaclLength; + /* calculate the start and end of the data area, we simply just move the + data by the difference between the size of the relative and absolute + security descriptor structure */ + DataStart = pOwner; + DataEnd = (PVOID)((ULONG_PTR)pOwner + OwnerLength); + if (pGroup != NULL) + { + if (((ULONG_PTR)pGroup < (ULONG_PTR)DataStart) || DataStart == NULL) + DataStart = pGroup; + if (((ULONG_PTR)pGroup + GroupLength > (ULONG_PTR)DataEnd) || DataEnd == NULL) + DataEnd = (PVOID)((ULONG_PTR)pGroup + GroupLength); + } + if (pDacl != NULL) + { + if (((ULONG_PTR)pDacl < (ULONG_PTR)DataStart) || DataStart == NULL) + DataStart = pDacl; + if (((ULONG_PTR)pDacl + DaclLength > (ULONG_PTR)DataEnd) || DataEnd == NULL) + DataEnd = (PVOID)((ULONG_PTR)pDacl + DaclLength); + } + if (pSacl != NULL) + { + if (((ULONG_PTR)pSacl < (ULONG_PTR)DataStart) || DataStart == NULL) + DataStart = pSacl; + if (((ULONG_PTR)pSacl + DaclLength > (ULONG_PTR)DataEnd) || DataEnd == NULL) + DataEnd = (PVOID)((ULONG_PTR)pSacl + SaclLength); + } + + ASSERT((ULONG_PTR)DataEnd >= (ULONG_PTR)DataStart); + + DataSize = (ULONG)((ULONG_PTR)DataEnd >= (ULONG_PTR)DataStart); + if (*BufferSize < sizeof(SECURITY_DESCRIPTOR) + DataSize) { *BufferSize = sizeof(SECURITY_DESCRIPTOR) + DataSize; @@ -793,17 +824,6 @@ if (DataSize != 0) { - /* calculate the start of the data area, we simply just move the data by - the difference between the size of the relative and absolute security - descriptor structure */ - DataStart = pOwner; - if ((pGroup != NULL && (ULONG_PTR)pGroup < (ULONG_PTR)DataStart) || DataStart == NULL) - DataStart = pGroup; - if ((pDacl != NULL && (ULONG_PTR)pDacl < (ULONG_PTR)DataStart) || DataStart == NULL) - DataStart = pDacl; - if ((pSacl != NULL && (ULONG_PTR)pSacl < (ULONG_PTR)DataStart) || DataStart == NULL) - DataStart = pSacl; - /* if DataSize != 0 ther must be at least one SID or ACL in the security descriptor! Also the data area must be located somewhere after the end of the SECURITY_DESCRIPTOR_RELATIVE structure */ @@ -815,28 +835,26 @@ DataStart, DataSize); + MoveDelta = (LONG)((LONG_PTR)(AbsSD + 1) - (LONG_PTR)DataStart); + /* adjust the pointers if neccessary */ if (pOwner != NULL) - AbsSD->Owner = (PSID)((ULONG_PTR)pOwner + - sizeof(SECURITY_DESCRIPTOR) - sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + AbsSD->Owner = (PSID)((LONG_PTR)pOwner + MoveDelta); else AbsSD->Owner = NULL; if (pGroup != NULL) - AbsSD->Group = (PSID)((ULONG_PTR)pGroup + - sizeof(SECURITY_DESCRIPTOR) - sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + AbsSD->Group = (PSID)((LONG_PTR)pGroup + MoveDelta); else AbsSD->Group = NULL; if (pSacl != NULL) - AbsSD->Sacl = (PACL)((ULONG_PTR)pSacl + - sizeof(SECURITY_DESCRIPTOR) - sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + AbsSD->Sacl = (PACL)((LONG_PTR)pSacl + MoveDelta); else AbsSD->Sacl = NULL; if (pDacl != NULL) - AbsSD->Dacl = (PACL)((ULONG_PTR)pDacl + - sizeof(SECURITY_DESCRIPTOR) - sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + AbsSD->Dacl = (PACL)((LONG_PTR)pDacl + MoveDelta); else AbsSD->Dacl = NULL; }
[View Less]
19 years, 7 months
1
0
0
0
[weiden] 18938: implemented RtlSelfRelativeToAbsoluteSD2 for 32 and 64 bit builds
by weiden@svn.reactos.com
implemented RtlSelfRelativeToAbsoluteSD2 for 32 and 64 bit builds Modified: trunk/reactos/lib/rtl/sd.c _____ Modified: trunk/reactos/lib/rtl/sd.c --- trunk/reactos/lib/rtl/sd.c 2005-11-01 20:30:17 UTC (rev 18937) +++ trunk/reactos/lib/rtl/sd.c 2005-11-01 21:53:36 UTC (rev 18938) @@ -726,14 +726,157 @@ /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI RtlSelfRelativeToAbsoluteSD2(PISECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, PULONG
…
[View More]
BufferSize) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PISECURITY_DESCRIPTOR AbsSD = SelfRelativeSecurityDescriptor; + PISECURITY_DESCRIPTOR_RELATIVE RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)SelfRelativeSecurityDescriptor; +#ifdef _WIN64 + PVOID DataStart; + ULONG DataSize; + ULONG OwnerLength; + ULONG GroupLength; + ULONG DaclLength; + ULONG SaclLength; +#endif + PSID pOwner; + PSID pGroup; + PACL pDacl; + PACL pSacl; + + PAGED_CODE_RTL(); + + if (SelfRelativeSecurityDescriptor == NULL) + { + return STATUS_INVALID_PARAMETER_1; + } + if (BufferSize == NULL) + { + return STATUS_INVALID_PARAMETER_2; + } + + if (RelSD->Revision != SECURITY_DESCRIPTOR_REVISION1) + { + return STATUS_UNKNOWN_REVISION; + } + if (!(RelSD->Control & SE_SELF_RELATIVE)) + { + return STATUS_BAD_DESCRIPTOR_FORMAT; + } + + ASSERT(FIELD_OFFSET(SECURITY_DESCRIPTOR, Owner) == + FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Owner)); + +#ifdef _WIN64 + + RtlpQuerySecurityDescriptor(SelfRelativeSecurityDescriptor, + &pOwner, + &OwnerLength, + &pGroup, + &GroupLength, + &pDacl, + &DaclLength, + &pSacl, + &SaclLength); + + ASSERT(sizeof(SECURITY_DESCRIPTOR) > sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + + DataSize = OwnerLength + GroupLength + DaclLength + SaclLength; + if (*BufferSize < sizeof(SECURITY_DESCRIPTOR) + DataSize) + { + *BufferSize = sizeof(SECURITY_DESCRIPTOR) + DataSize; + return STATUS_BUFFER_TOO_SMALL; + } + + if (DataSize != 0) + { + /* calculate the start of the data area, we simply just move the data by + the difference between the size of the relative and absolute security + descriptor structure */ + DataStart = pOwner; + if ((pGroup != NULL && (ULONG_PTR)pGroup < (ULONG_PTR)DataStart) || DataStart == NULL) + DataStart = pGroup; + if ((pDacl != NULL && (ULONG_PTR)pDacl < (ULONG_PTR)DataStart) || DataStart == NULL) + DataStart = pDacl; + if ((pSacl != NULL && (ULONG_PTR)pSacl < (ULONG_PTR)DataStart) || DataStart == NULL) + DataStart = pSacl; + + /* if DataSize != 0 ther must be at least one SID or ACL in the security + descriptor! Also the data area must be located somewhere after the + end of the SECURITY_DESCRIPTOR_RELATIVE structure */ + ASSERT(DataStart != NULL); + ASSERT((ULONG_PTR)DataStart >= (ULONG_PTR)(RelSD + 1)); + + /* it's time to move the data */ + RtlMoveMemory((PVOID)(AbsSD + 1), + DataStart, + DataSize); + + /* adjust the pointers if neccessary */ + if (pOwner != NULL) + AbsSD->Owner = (PSID)((ULONG_PTR)pOwner + + sizeof(SECURITY_DESCRIPTOR) - sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + else + AbsSD->Owner = NULL; + + if (pGroup != NULL) + AbsSD->Group = (PSID)((ULONG_PTR)pGroup + + sizeof(SECURITY_DESCRIPTOR) - sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + else + AbsSD->Group = NULL; + + if (pSacl != NULL) + AbsSD->Sacl = (PACL)((ULONG_PTR)pSacl + + sizeof(SECURITY_DESCRIPTOR) - sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + else + AbsSD->Sacl = NULL; + + if (pDacl != NULL) + AbsSD->Dacl = (PACL)((ULONG_PTR)pDacl + + sizeof(SECURITY_DESCRIPTOR) - sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + else + AbsSD->Dacl = NULL; + } + else + { + /* all pointers must be NULL! */ + ASSERT(pOwner == NULL); + ASSERT(pGroup == NULL); + ASSERT(pSacl == NULL); + ASSERT(pDacl == NULL); + + AbsSD->Owner = NULL; + AbsSD->Group = NULL; + AbsSD->Dacl = NULL; + AbsSD->Sacl = NULL; + } + + /* clear the self-relative flag */ + AbsSD->Control &= ~SE_SELF_RELATIVE; + +#else + + RtlpQuerySecurityDescriptorPointers(SelfRelativeSecurityDescriptor, + &pOwner, + &pGroup, + &pSacl, + &pDacl); + + ASSERT(sizeof(SECURITY_DESCRIPTOR) == sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + + /* clear the self-relative flag and simply convert the offsets to pointers */ + AbsSD->Control &= ~SE_SELF_RELATIVE; + AbsSD->Owner = pOwner; + AbsSD->Group = pGroup; + AbsSD->Sacl = pDacl; + AbsSD->Dacl = pSacl; + +#endif + + return STATUS_SUCCESS; }
[View Less]
19 years, 7 months
1
0
0
0
[mf] 18937: create two new functions String::str() and String::toLower() to avoid _tcslwr() calls and allow convenient string conversions
by mf@svn.reactos.com
create two new functions String::str() and String::toLower() to avoid _tcslwr() calls and allow convenient string conversions Modified: trunk/reactos/subsys/system/explorer/dialogs/searchprogram.cpp Modified: trunk/reactos/subsys/system/explorer/explorer.cpp Modified: trunk/reactos/subsys/system/explorer/shell/entries.cpp Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellfs.cpp Modified: trunk/reactos/subsys/system/
…
[View More]
explorer/shell/unixfs.cpp Modified: trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp Modified: trunk/reactos/subsys/system/explorer/taskbar/traynotify.cpp Modified: trunk/reactos/subsys/system/explorer/utility/utility.h _____ Modified: trunk/reactos/subsys/system/explorer/dialogs/searchprogram.cpp --- trunk/reactos/subsys/system/explorer/dialogs/searchprogram.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/dialogs/searchprogram.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -151,9 +151,7 @@ TCHAR buffer[1024]; GetWindowText(GetDlgItem(_hwnd, IDC_FILTER), buffer, COUNTOF(buffer)); -#ifndef __WINE__ ///@todo _tcslwr() for Wine - _tcslwr(buffer); -#endif + CharLower(buffer); _lwr_filter = buffer; HiddenWindow hide_listctrl(_list_ctrl); @@ -230,10 +228,8 @@ String lwr_path = cache_entry._path; String lwr_name = cache_entry._entry->_display_name; -#ifndef __WINE__ ///@todo _tcslwr() for Wine - _tcslwr(&lwr_path.at(0)); - _tcslwr(&lwr_name.at(0)); -#endif + lwr_path.toLower(); + lwr_name.toLower(); if (_lwr_filter.empty()) if (_tcsstr(lwr_name, _T("uninstal")) || _tcsstr(lwr_name, _T("deinstal"))) // filter out deinstallation links _____ Modified: trunk/reactos/subsys/system/explorer/explorer.cpp --- trunk/reactos/subsys/system/explorer/explorer.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/explorer.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -182,9 +182,7 @@ const FileTypeInfo& FileTypeManager::operator[](String ext) { -#ifndef __WINE__ ///@todo _tcslwr() for Wine - _tcslwr(&ext.at(0)); -#endif + ext.toLower(); iterator found = find(ext); if (found != end()) @@ -414,9 +412,7 @@ { CachePair key(path, idx); -#ifndef __WINE__ ///@todo _tcslwr() for Wine - _tcslwr(&key.first.at(0)); -#endif + key.first.toLower(); PathIdxMap::iterator found = _pathIdxMap.find(key); _____ Modified: trunk/reactos/subsys/system/explorer/shell/entries.cpp --- trunk/reactos/subsys/system/explorer/shell/entries.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/shell/entries.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -514,7 +514,7 @@ LPCTSTR name = NULL; TCHAR buffer[MAX_PATH]; - if ( !path || 0 == path_count ) + if (!path || path_count==0) return false; const Entry* entry; _____ Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp --- trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -679,7 +679,7 @@ tvi.hInsertAfter = TVI_LAST; tvi.item.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE; ResString sFavorites(IDS_FAVORITES); - tvi.item.pszText = (LPTSTR)sFavorites.c_str(); + tvi.item.pszText = sFavorites.str(); tvi.item.iSelectedImage = tvi.item.iImage = 0; HTREEITEM hitem_bookmarks = TreeView_InsertItem(_hsidebar, &tvi); @@ -1673,7 +1673,7 @@ TCHAR path[MAX_PATH]; - if (shell_entry->get_path(path,COUNTOF(path))) { + if (shell_entry->get_path(path, COUNTOF(path))) { String url; if (path[0] == ':') _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellfs.cpp --- trunk/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -128,7 +128,7 @@ // get full path of a shell entry bool ShellEntry::get_path(PTSTR path, size_t path_count) const { - if ( !path || 0 == path_count ) + if (!path || path_count==0) return false; /* path[0] = TEXT('\0'); @@ -152,7 +152,7 @@ { CONTEXT("ShellDirectory::get_path()"); - if ( !path || 0 == path_count ) + if (!path || path_count==0) return false; path[0] = TEXT('\0'); _____ Modified: trunk/reactos/subsys/system/explorer/shell/unixfs.cpp --- trunk/reactos/subsys/system/explorer/shell/unixfs.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/shell/unixfs.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -161,7 +161,7 @@ int level = 0; size_t len = 0; - if ( !path || 0 == path_count ) + if (!path || path_count==0) return false; if ( path_count > 1 ) _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp --- trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -282,7 +282,7 @@ NMTTDISPINFO* ttdi = (NMTTDISPINFO*) pnmh; int id = ttdi->hdr.idFrom; - ttdi->lpszText = (LPTSTR)_entries[id]._title.c_str(); + ttdi->lpszText = _entries[id]._title.str(); #ifdef TTF_DI_SETITEM ttdi->uFlags |= TTF_DI_SETITEM; #endif _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp --- trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -257,9 +257,7 @@ *ignore_name = '\0'; String lwr_filter = _create_info._filter; -#ifndef __WINE__ ///@todo _tcslwr() for Wine - _tcslwr((LPTSTR)lwr_filter.c_str()); -#endif + lwr_filter.toLower(); int cnt = 0; for(Entry*entry=dir._down; entry; entry=entry->_next) { @@ -281,10 +279,8 @@ String lwr_name = entry->_data.cFileName; String lwr_disp = entry->_display_name; -#ifndef __WINE__ ///@todo _tcslwr() for Wine - _tcslwr((LPTSTR)lwr_name.c_str()); - _tcslwr((LPTSTR)lwr_disp.c_str()); -#endif + lwr_name.toLower(); + lwr_disp.toLower(); if (!_tcsstr(lwr_name,lwr_filter) && !_tcsstr(lwr_disp,lwr_filter)) continue; @@ -1548,7 +1544,6 @@ try { // insert directory "<user name>\Start Menu" - ShellDirectory usr_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_STARTMENU, _hwnd), _hwnd); _dirs.push_back(StartMenuDirectory(usr_startmenu, (LPCTSTR)SpecialFolderFSPath(CSIDL_PROGRAMS, _hwnd))); } catch(COMException&) { @@ -2217,9 +2212,7 @@ super::AddEntries(); String lwr_filter = _create_info._filter; -#ifndef __WINE__ ///@todo _tcslwr() for Wine - _tcslwr((LPTSTR)lwr_filter.c_str()); -#endif + lwr_filter.toLower(); for(BookmarkList::iterator it=_bookmarks.begin(); it!=_bookmarks.end(); ++it) { BookmarkNode& node = *it; @@ -2246,11 +2239,9 @@ String lwr_desc = bookmark._description; String lwr_url = bookmark._url; -#ifndef __WINE__ ///@todo _tcslwr() for Wine - _tcslwr((LPTSTR)lwr_name.c_str()); - _tcslwr((LPTSTR)lwr_desc.c_str()); - _tcslwr((LPTSTR)lwr_url.c_str()); -#endif + lwr_name.toLower(); + lwr_desc.toLower(); + lwr_url.toLower(); if (!_tcsstr(lwr_name,lwr_filter) && !_tcsstr(lwr_desc,lwr_filter) && !_tcsstr(lwr_url,lwr_filter)) continue; _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/traynotify.cpp --- trunk/reactos/subsys/system/explorer/taskbar/traynotify.cpp 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/taskbar/traynotify.cpp 2005-11-01 20:30:17 UTC (rev 18937) @@ -555,7 +555,7 @@ static ResString sShowIcons(IDS_SHOW_HIDDEN_ICONS); static ResString sHideIcons(IDS_HIDE_ICONS); - pdi->lpszText = (LPTSTR)(_show_hidden? sHideIcons: sShowIcons).c_str(); + pdi->lpszText = (_show_hidden? sHideIcons: sShowIcons).str(); } else { NotifyIconSet::iterator found = IconHitTest(pt); @@ -565,7 +565,7 @@ // enable multiline tooltips (break at CR/LF and for very long one-line strings) SendMessage(pnmh->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 400); - pdi->lpszText = (LPTSTR)entry._tipText.c_str(); + pdi->lpszText = entry._tipText.str(); } } } @@ -974,24 +974,24 @@ tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE; ResString str_cur(IDS_ITEMS_CUR); - tv.pszText = (LPTSTR)str_cur.c_str(); + tv.pszText = str_cur.str(); tv.iSelectedImage = tv.iImage = 0; // IDI_DOT _hitemCurrent = TreeView_InsertItem(_tree_ctrl, &tvi); ResString str_conf(IDS_ITEMS_CONFIGURED); - tv.pszText = (LPTSTR)str_conf.c_str(); + tv.pszText = str_conf.str(); tv.iSelectedImage = tv.iImage = 2; // IDI_DOT_RED _hitemConfig = TreeView_InsertItem(_tree_ctrl, &tvi); tvi.hParent = _hitemCurrent; ResString str_visible(IDS_ITEMS_VISIBLE); - tv.pszText = (LPTSTR)str_visible.c_str(); + tv.pszText = str_visible.str(); tv.iSelectedImage = tv.iImage = 0; // IDI_DOT _hitemCurrent_visible = TreeView_InsertItem(_tree_ctrl, &tvi); ResString str_hidden(IDS_ITEMS_HIDDEN); - tv.pszText = (LPTSTR)str_hidden.c_str(); + tv.pszText = str_hidden.str(); tv.iSelectedImage = tv.iImage = 1; // IDI_DOT_TRANS _hitemCurrent_hidden = TreeView_InsertItem(_tree_ctrl, &tvi); @@ -1075,7 +1075,7 @@ tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM; tv.lParam = (LPARAM)idx; - tv.pszText = (LPTSTR)txt.c_str(); + tv.pszText = txt.str(); tv.iSelectedImage = tv.iImage = ImageList_AddAlphaIcon(_himl, hicon, GetStockBrush(WHITE_BRUSH), hdc); (void)TreeView_InsertItem(_tree_ctrl, &tvi); } _____ Modified: trunk/reactos/subsys/system/explorer/utility/utility.h --- trunk/reactos/subsys/system/explorer/utility/utility.h 2005-11-01 18:53:37 UTC (rev 18936) +++ trunk/reactos/subsys/system/explorer/utility/utility.h 2005-11-01 20:30:17 UTC (rev 18937) @@ -798,6 +798,8 @@ operator wstring() const {WCHAR b[BUFFER_LEN]; return wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), -1, b, BUFFER_LEN)-1);} #endif + LPTSTR str() {return (LPTSTR)data();} /// return modifyable character string pointer + String& printf(LPCTSTR fmt, ...) { va_list l; @@ -839,6 +841,12 @@ return *this; } + + void toLower() + { + if (!empty()) + CharLower(str()); + } }; #define _STRING_DEFINED
[View Less]
19 years, 7 months
1
0
0
0
[greatlrd] 18936: do not try free memmory at exit it seam like the DdDeleteDirectDrawObject doing it for us, and it does not crash any longer at exists
by greatlrd@svn.reactos.com
do not try free memmory at exit it seam like the DdDeleteDirectDrawObject doing it for us, and it does not crash any longer at exists Modified: trunk/reactos/lib/ddraw/hal/ddraw_hal.c Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c _____ Modified: trunk/reactos/lib/ddraw/hal/ddraw_hal.c --- trunk/reactos/lib/ddraw/hal/ddraw_hal.c 2005-11-01 18:42:50 UTC (rev 18935) +++ trunk/reactos/lib/ddraw/hal/ddraw_hal.c 2005-11-01 18:53:37 UTC (rev 18936) @@ -315,6 +315,7 @@
…
[View More]
DdDeleteDirectDrawObject (&This->DirectDrawGlobal); + /* if(This->DirectDrawGlobal.lpDDKernelCaps) HeapFree(GetProcessHeap(), 0, This->DirectDrawGlobal.lpDDKernelCaps); @@ -344,6 +345,7 @@ if(This->DirectDrawGlobal.lpD3DGlobalDriverData) HeapFree(GetProcessHeap(), 0, (PVOID)This->DirectDrawGlobal.lpD3DGlobalDriverData); + */ } _____ Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c --- trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-11-01 18:42:50 UTC (rev 18935) +++ trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-11-01 18:53:37 UTC (rev 18936) @@ -80,6 +80,7 @@ This->Local.lpGbl = &This->Global; This->Local.lpSurfMore = &This->More; + /* FIXME do a memcopy */ This->Local.ddsCaps = *(DDSCAPS*)&This->ddsd.ddsCaps;
[View Less]
19 years, 7 months
1
0
0
0
[greatlrd] 18935: Fixed a crach. and do not hardcode the flag ddsd to primersurface amd other value.
by greatlrd@svn.reactos.com
Fixed a crach. and do not hardcode the flag ddsd to primersurface amd other value. Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c _____ Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c --- trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-11-01 18:27:09 UTC (rev 18934) +++ trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-11-01 18:42:50 UTC (rev 18935) @@ -60,11 +60,7 @@ /************ Create Surface ***********************/ - /* FIXME we are skipping filling in some data, I do
…
[View More]
not care for now */ - - LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal = &This->owner->DirectDrawGlobal; - This->ddsd.dwFlags = DDSD_CAPS; - This->ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + /* FIXME we are skipping filling in some data, I do not care for now */ /* surface global struct */ memset(&This->Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); @@ -72,8 +68,8 @@ This->Global.wHeight = This->owner->DirectDrawGlobal.vmiData.dwDisplayHeight; This->Global.wWidth = This->owner->DirectDrawGlobal.vmiData.dwDisplayWidth; This->Global.dwLinearSize = This->owner->DirectDrawGlobal.vmiData.lDisplayPitch; - + /* surface more struct */ memset(&This->More, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); This->More.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); @@ -87,18 +83,17 @@ /* FIXME do a memcopy */ This->Local.ddsCaps = *(DDSCAPS*)&This->ddsd.ddsCaps; - /* for the double pointer below */ - DDRAWI_DDRAWSURFACE_LCL *pLocal[2]; - pLocal[0] = &This->Local; - pLocal[1] = NULL; + /* for the double pointer below */ + This->pLocal[0] = &This->Local; + This->pLocal[1] = NULL; /* the parameter struct */ DDHAL_CREATESURFACEDATA CreateData; memset(&CreateData, 0, sizeof(DDHAL_CREATESURFACEDATA)); - CreateData.lpDD = pDirectDrawGlobal; + CreateData.lpDD = &This->owner->DirectDrawGlobal; CreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC) &This->ddsd; CreateData.dwSCnt = 1; - CreateData.lplpSList = pLocal; + CreateData.lplpSList = This->pLocal; CreateData.ddRVal = DD_FALSE; /* this is the call we were waiting for */
[View Less]
19 years, 7 months
1
0
0
0
← Newer
1
...
83
84
85
86
87
88
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Results per page:
10
25
50
100
200