From 689159fedc6cefecaaa8b72571cf04e0b1ef4232 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 18 May 2014 05:52:09 +0000 Subject: [PATCH 01/69] [ACPI] - Fix a buffer overrun that caused a BSOD with ACPI enabled on Hyper-V - Dynamically allocate the hardware ID buffer to prevent another HID overrun - Switched sprintf to snprintf to prevent this from happening to another ID svn path=/trunk/; revision=63344 --- reactos/drivers/bus/acpi/busmgr/bus.c | 45 ++++++++++++--------- reactos/drivers/bus/acpi/include/acpi_bus.h | 6 +-- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/reactos/drivers/bus/acpi/busmgr/bus.c b/reactos/drivers/bus/acpi/busmgr/bus.c index 77b822d2149..ebdb3a62c1b 100644 --- a/reactos/drivers/bus/acpi/busmgr/bus.c +++ b/reactos/drivers/bus/acpi/busmgr/bus.c @@ -1142,7 +1142,7 @@ acpi_bus_add ( char *uid = NULL; ACPI_PNP_DEVICE_ID_LIST *cid_list = NULL; int i = 0; - char static_uid_buffer[5]; + acpi_unique_id static_uid_buffer; if (!child) return_VALUE(AE_BAD_PARAMETER); @@ -1165,15 +1165,15 @@ acpi_bus_add ( */ switch (type) { case ACPI_BUS_TYPE_SYSTEM: - sprintf(device->pnp.bus_id, "%s", "ACPI"); + snprintf(device->pnp.bus_id, sizeof(device->pnp.bus_id), "%s", "ACPI"); break; case ACPI_BUS_TYPE_POWER_BUTTONF: case ACPI_BUS_TYPE_POWER_BUTTON: - sprintf(device->pnp.bus_id, "%s", "PWRF"); + snprintf(device->pnp.bus_id, sizeof(device->pnp.bus_id), "%s", "PWRF"); break; case ACPI_BUS_TYPE_SLEEP_BUTTONF: case ACPI_BUS_TYPE_SLEEP_BUTTON: - sprintf(device->pnp.bus_id, "%s", "SLPF"); + snprintf(device->pnp.bus_id, sizeof(device->pnp.bus_id), "%s", "SLPF"); break; default: buffer.Length = sizeof(bus_id); @@ -1188,7 +1188,7 @@ acpi_bus_add ( else break; } - sprintf(device->pnp.bus_id, "%s", bus_id); + snprintf(device->pnp.bus_id, sizeof(device->pnp.bus_id), "%s", bus_id); buffer.Pointer = NULL; /* HACK: Skip HPET */ @@ -1277,12 +1277,12 @@ acpi_bus_add ( case ACPI_BUS_TYPE_POWER: hid = ACPI_POWER_HID; uid = static_uid_buffer; - sprintf(uid, "%d", (PowerDeviceCount++)); + snprintf(uid, sizeof(static_uid_buffer), "%d", (PowerDeviceCount++)); break; case ACPI_BUS_TYPE_PROCESSOR: hid = ACPI_PROCESSOR_HID; uid = static_uid_buffer; - sprintf(uid, "_%d", (ProcessorCount++)); + snprintf(uid, sizeof(static_uid_buffer), "_%d", (ProcessorCount++)); break; case ACPI_BUS_TYPE_SYSTEM: hid = ACPI_SYSTEM_HID; @@ -1290,27 +1290,27 @@ acpi_bus_add ( case ACPI_BUS_TYPE_THERMAL: hid = ACPI_THERMAL_HID; uid = static_uid_buffer; - sprintf(uid, "%d", (ThermalZoneCount++)); + snprintf(uid, sizeof(static_uid_buffer), "%d", (ThermalZoneCount++)); break; case ACPI_BUS_TYPE_POWER_BUTTON: hid = ACPI_BUTTON_HID_POWER; uid = static_uid_buffer; - sprintf(uid, "%d", (PowerButtonCount++)); + snprintf(uid, sizeof(static_uid_buffer), "%d", (PowerButtonCount++)); break; case ACPI_BUS_TYPE_POWER_BUTTONF: hid = ACPI_BUTTON_HID_POWERF; uid = static_uid_buffer; - sprintf(uid, "%d", (FixedPowerButtonCount++)); + snprintf(uid, sizeof(static_uid_buffer), "%d", (FixedPowerButtonCount++)); break; case ACPI_BUS_TYPE_SLEEP_BUTTON: hid = ACPI_BUTTON_HID_SLEEP; uid = static_uid_buffer; - sprintf(uid, "%d", (SleepButtonCount++)); + snprintf(uid, sizeof(static_uid_buffer), "%d", (SleepButtonCount++)); break; case ACPI_BUS_TYPE_SLEEP_BUTTONF: hid = ACPI_BUTTON_HID_SLEEPF; uid = static_uid_buffer; - sprintf(uid, "%d", (FixedSleepButtonCount++)); + snprintf(uid, sizeof(static_uid_buffer), "%d", (FixedSleepButtonCount++)); break; } @@ -1321,16 +1321,19 @@ acpi_bus_add ( */ if (((ACPI_HANDLE)parent == ACPI_ROOT_OBJECT) && (type == ACPI_BUS_TYPE_DEVICE)) { hid = ACPI_BUS_HID; - sprintf(device->pnp.device_name, "%s", ACPI_BUS_DEVICE_NAME); - sprintf(device->pnp.device_class, "%s", ACPI_BUS_CLASS); + snprintf(device->pnp.device_name, sizeof(device->pnp.device_name), "%s", ACPI_BUS_DEVICE_NAME); + snprintf(device->pnp.device_class, sizeof(device->pnp.device_class), "%s", ACPI_BUS_CLASS); } if (hid) { - sprintf(device->pnp.hardware_id, "%s", hid); - device->flags.hardware_id = 1; + device->pnp.hardware_id = ExAllocatePoolWithTag(NonPagedPool, strlen(hid) + 1, 'IPCA'); + if (device->pnp.hardware_id) { + snprintf(device->pnp.hardware_id, strlen(hid) + 1, "%s", hid); + device->flags.hardware_id = 1; + } } if (uid) { - sprintf(device->pnp.unique_id, "%s", uid); + snprintf(device->pnp.unique_id, sizeof(device->pnp.unique_id), "%s", uid); device->flags.unique_id = 1; } @@ -1434,6 +1437,9 @@ end: if (device->pnp.cid_list) { ExFreePoolWithTag(device->pnp.cid_list, 'IPCA'); } + if (device->pnp.hardware_id) { + ExFreePoolWithTag(device->pnp.hardware_id, 'IPCA'); + } ExFreePoolWithTag(device, 'IPCA'); return_VALUE(result); } @@ -1454,9 +1460,12 @@ acpi_bus_remove ( acpi_device_unregister(device); - if (device && device->pnp.cid_list) + if (device->pnp.cid_list) ExFreePoolWithTag(device->pnp.cid_list, 'IPCA'); + if (device->pnp.hardware_id) + ExFreePoolWithTag(device->pnp.hardware_id, 'IPCA'); + if (device) ExFreePoolWithTag(device, 'IPCA'); diff --git a/reactos/drivers/bus/acpi/include/acpi_bus.h b/reactos/drivers/bus/acpi/include/acpi_bus.h index 4320f63a1dd..148373f6608 100644 --- a/reactos/drivers/bus/acpi/include/acpi_bus.h +++ b/reactos/drivers/bus/acpi/include/acpi_bus.h @@ -164,10 +164,10 @@ struct acpi_device_flags { /* Plug and Play */ -typedef char acpi_bus_id[20]; +typedef char acpi_bus_id[8]; typedef unsigned long acpi_bus_address; -typedef char acpi_hardware_id[20]; -typedef char acpi_unique_id[20]; +typedef char *acpi_hardware_id; +typedef char acpi_unique_id[9]; typedef char acpi_device_name[40]; typedef char acpi_device_class[20]; From ae4a8102df76eabf46f5785e6aab745565ec1930 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 18 May 2014 06:19:05 +0000 Subject: [PATCH 02/69] [ACPI] - Start reporting compatible IDs for ACPI-enumerated devices other than processors - Not sure how this was overlooked for so long... svn path=/trunk/; revision=63345 --- reactos/drivers/bus/acpi/buspdo.c | 71 +++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/reactos/drivers/bus/acpi/buspdo.c b/reactos/drivers/bus/acpi/buspdo.c index cb5965f5072..a50fa173650 100644 --- a/reactos/drivers/bus/acpi/buspdo.c +++ b/reactos/drivers/bus/acpi/buspdo.c @@ -400,7 +400,7 @@ Bus_PDO_QueryDeviceId( PIO_STACK_LOCATION stack; PWCHAR buffer, src; WCHAR temp[256]; - ULONG length; + ULONG length, i; NTSTATUS status = STATUS_SUCCESS; struct acpi_device *Device; @@ -490,11 +490,18 @@ Bus_PDO_QueryDeviceId( /* This is a REG_MULTI_SZ value */ length = 0; + status = STATUS_NOT_SUPPORTED; /* See comment in BusQueryDeviceID case */ if (DeviceData->AcpiHandle) { acpi_bus_get_device(DeviceData->AcpiHandle, &Device); + + if (!Device->flags.hardware_id) + { + /* We don't have the ID to satisfy this request */ + break; + } DPRINT("Device name: %s\n", Device->pnp.device_name); DPRINT("Hardware ID: %s\n", Device->pnp.hardware_id); @@ -557,11 +564,17 @@ Bus_PDO_QueryDeviceId( { acpi_bus_get_device(DeviceData->AcpiHandle, &Device); + if (!Device->flags.hardware_id) + { + /* We don't have the ID to satisfy this request */ + break; + } + + DPRINT("Device name: %s\n", Device->pnp.device_name); + DPRINT("Hardware ID: %s\n", Device->pnp.hardware_id); + if (strcmp(Device->pnp.hardware_id, "Processor") == 0) { - DPRINT("Device name: %s\n", Device->pnp.device_name); - DPRINT("Hardware ID: %s\n", Device->pnp.hardware_id); - length += swprintf(&temp[length], L"ACPI\\%hs", Device->pnp.hardware_id); @@ -572,21 +585,43 @@ Bus_PDO_QueryDeviceId( Device->pnp.hardware_id); temp[length++] = UNICODE_NULL; temp[length++] = UNICODE_NULL; - - NT_ASSERT(length * sizeof(WCHAR) <= sizeof(temp)); - - buffer = ExAllocatePoolWithTag (PagedPool, length * sizeof(WCHAR), 'IPCA'); - if (!buffer) - { - status = STATUS_INSUFFICIENT_RESOURCES; - break; - } - - RtlCopyMemory (buffer, temp, length * sizeof(WCHAR)); - Irp->IoStatus.Information = (ULONG_PTR) buffer; - DPRINT("BusQueryHardwareIDs: %ls\n",buffer); - status = STATUS_SUCCESS; } + else if (Device->flags.compatible_ids) + { + for (i = 0; i < Device->pnp.cid_list->Count; i++) + { + length += swprintf(&temp[length], + L"ACPI\\%hs", + Device->pnp.cid_list->Ids[i].String); + temp[length++] = UNICODE_NULL; + + length += swprintf(&temp[length], + L"*%hs", + Device->pnp.cid_list->Ids[i].String); + temp[length++] = UNICODE_NULL; + } + + temp[length++] = UNICODE_NULL; + } + else + { + /* No compatible IDs */ + break; + } + + NT_ASSERT(length * sizeof(WCHAR) <= sizeof(temp)); + + buffer = ExAllocatePoolWithTag (PagedPool, length * sizeof(WCHAR), 'IPCA'); + if (!buffer) + { + status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + + RtlCopyMemory (buffer, temp, length * sizeof(WCHAR)); + Irp->IoStatus.Information = (ULONG_PTR) buffer; + DPRINT("BusQueryCompatibleIDs: %ls\n",buffer); + status = STATUS_SUCCESS; } break; From a59063a064f594255a531e39081981b40141577f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 18 May 2014 06:58:51 +0000 Subject: [PATCH 03/69] [ACPI] - Fix 2nd stage boot svn path=/trunk/; revision=63346 --- reactos/drivers/bus/acpi/buspdo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/drivers/bus/acpi/buspdo.c b/reactos/drivers/bus/acpi/buspdo.c index a50fa173650..3c09e521723 100644 --- a/reactos/drivers/bus/acpi/buspdo.c +++ b/reactos/drivers/bus/acpi/buspdo.c @@ -551,6 +551,7 @@ Bus_PDO_QueryDeviceId( RtlCopyMemory (buffer, src, length * sizeof(WCHAR)); Irp->IoStatus.Information = (ULONG_PTR) buffer; DPRINT("BusQueryHardwareIDs: %ls\n",buffer); + status = STATUS_SUCCESS; break; case BusQueryCompatibleIDs: From 9c10a292db781d5a24293546939aad7cb805225f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 18 May 2014 07:21:58 +0000 Subject: [PATCH 04/69] [HIVESYS] - Add PS/2 input devices to the critical device database svn path=/trunk/; revision=63347 --- reactos/boot/bootdata/hivesys.inf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/reactos/boot/bootdata/hivesys.inf b/reactos/boot/bootdata/hivesys.inf index 8433438a741..feba91ffcfb 100644 --- a/reactos/boot/bootdata/hivesys.inf +++ b/reactos/boot/bootdata/hivesys.inf @@ -74,6 +74,29 @@ HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0300","Clas HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0301","Service",0x00000000,"VBE" HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0301","ClassGUID",0x00000000,"{4D36E968-E325-11CE-BFC1-08002BE10318}" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0303","Service",0x00000000,"i8042prt" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0303","ClassGUID",0x00000000,"{4D36E96B-E325-11CE-BFC1-08002BE10318}" + +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F0E","Service",0x00000000,"i8042prt" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F0E","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" + +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F19","Service",0x00000000,"i8042prt" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F19","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" + +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PS2_MOUSE","Service",0x00000000,"i8042prt" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PS2_MOUSE","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" + +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F13","Service",0x00000000,"i8042prt" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F13","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" + +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*IBM3780","Service",0x00000000,"i8042prt" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*IBM3780","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" + +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F12","Service",0x00000000,"i8042prt" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F12","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" + +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F03","Service",0x00000000,"i8042prt" +HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0F03","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}" HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot","AlternateShell",2,"cmd.exe" From 0a83347ad4e9c42530420dd410a9d1b116200034 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 18 May 2014 08:43:31 +0000 Subject: [PATCH 05/69] [NDIS] - Restore the pending NDIS request before calling the completion routine - Fixes crash with Broadcom 57xx drivers (link detection still not working) svn path=/trunk/; revision=63348 --- reactos/drivers/network/ndis/ndis/miniport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/network/ndis/ndis/miniport.c b/reactos/drivers/network/ndis/ndis/miniport.c index 3119e6f9295..f84df4e9ea3 100644 --- a/reactos/drivers/network/ndis/ndis/miniport.c +++ b/reactos/drivers/network/ndis/ndis/miniport.c @@ -1317,10 +1317,11 @@ MiniportWorker(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context) if (NdisStatus == NDIS_STATUS_PENDING) break; + Adapter->NdisMiniportBlock.PendingRequest = (PNDIS_REQUEST)WorkItemContext; switch (((PNDIS_REQUEST)WorkItemContext)->RequestType) { case NdisRequestQueryInformation: - NdisMQueryInformationComplete((NDIS_HANDLE)Adapter, NdisStatus); + NdisMQueryInformationComplete((NDIS_HANDLE)Adapter, NdisStatus); break; case NdisRequestSetInformation: @@ -1331,6 +1332,7 @@ MiniportWorker(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context) NDIS_DbgPrint(MIN_TRACE, ("Unknown NDIS request type.\n")); break; } + Adapter->NdisMiniportBlock.PendingRequest = NULL; break; default: From abcd5483083fecfaf60c4caf2740b9df9e225b1c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 18 May 2014 08:54:32 +0000 Subject: [PATCH 06/69] [ACPI] - Handle IRP_MN_CANCEL_REMOVE_DEVICE, IRP_MN_QUERY_REMOVE_DEVICE, and IRP_MN_REMOVE_DEVICE for child devices - Fixes issues loading new drivers for ACPI-enumerated devices svn path=/trunk/; revision=63349 --- reactos/drivers/bus/acpi/buspdo.c | 36 ++++++++++++++++++++++ reactos/drivers/bus/acpi/include/acpisys.h | 1 + 2 files changed, 37 insertions(+) diff --git a/reactos/drivers/bus/acpi/buspdo.c b/reactos/drivers/bus/acpi/buspdo.c index 3c09e521723..0f70facb580 100644 --- a/reactos/drivers/bus/acpi/buspdo.c +++ b/reactos/drivers/bus/acpi/buspdo.c @@ -165,6 +165,42 @@ Bus_PDO_PnP ( } status = STATUS_SUCCESS;// We must not fail this IRP. break; + + case IRP_MN_REMOVE_DEVICE: + // + // We handle REMOVE_DEVICE just like STOP_DEVICE. This is because + // the device is still physically present (or at least we don't know any better) + // so we have to retain the PDO after stopping and removing power from it. + // + if (DeviceData->InterfaceName.Length != 0) + IoSetDeviceInterfaceState(&DeviceData->InterfaceName, FALSE); + + if (DeviceData->AcpiHandle && acpi_bus_power_manageable(DeviceData->AcpiHandle) && + !ACPI_SUCCESS(acpi_bus_set_power(DeviceData->AcpiHandle, ACPI_STATE_D3))) + { + DPRINT1("Device %x failed to enter D3!\n", DeviceData->AcpiHandle); + state.DeviceState = PowerDeviceD3; + PoSetPowerState(DeviceData->Common.Self, DevicePowerState, state); + DeviceData->Common.DevicePowerState = PowerDeviceD3; + } + + SET_NEW_PNP_STATE(DeviceData->Common, Stopped); + status = STATUS_SUCCESS; + break; + + case IRP_MN_QUERY_REMOVE_DEVICE: + SET_NEW_PNP_STATE(DeviceData->Common, RemovalPending); + status = STATUS_SUCCESS; + break; + + case IRP_MN_CANCEL_REMOVE_DEVICE: + if (RemovalPending == DeviceData->Common.DevicePnPState) + { + RESTORE_PREVIOUS_PNP_STATE(DeviceData->Common); + } + status = STATUS_SUCCESS; + break; + case IRP_MN_QUERY_CAPABILITIES: // diff --git a/reactos/drivers/bus/acpi/include/acpisys.h b/reactos/drivers/bus/acpi/include/acpisys.h index e1f8fa555df..71646859e3d 100644 --- a/reactos/drivers/bus/acpi/include/acpisys.h +++ b/reactos/drivers/bus/acpi/include/acpisys.h @@ -13,6 +13,7 @@ typedef enum _DEVICE_PNP_STATE { Started, // Device has received the START_DEVICE IRP StopPending, // Device has received the QUERY_STOP IRP Stopped, // Device has received the STOP_DEVICE IRP + RemovalPending, // Device has received the QUERY_REMOVE IRP UnKnown // Unknown state } DEVICE_PNP_STATE; From ac454fae845059586c940695e4eca109162a96cb Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 18 May 2014 14:39:03 +0000 Subject: [PATCH 07/69] [CMAKE/MSVC] * Define _ALLOW_KEYWORD_MACROS to get the news MSVC toolchain to allow us to redefine inline (it became a keyword). Reported by David Quintana. svn path=/trunk/; revision=63353 --- reactos/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index a6a48ac077b..894af650fb2 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -63,6 +63,9 @@ if(NOT CMAKE_CROSSCOMPILING) if(ARCH STREQUAL "i386") add_definitions(/D_X86_ /DWIN32 /D_WINDOWS) endif() + if(MSVC_VERSION GREATER 1799) + add_definitions(/D_ALLOW_KEYWORD_MACROS) + endif() add_definitions(/Dinline=__inline) else() add_compile_flags("-fshort-wchar -Wno-multichar") From 9e6083e5c2c6aa8ce0529ab3097760c5595c132a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 18 May 2014 14:59:31 +0000 Subject: [PATCH 08/69] [NTOSKRNL] - Do not ASSERT that a page fault im MmArmAccessFault happens on an invalid page. Instead handle write-on-readonly-PTE faults (Copy-on-write still unhandled). This ASSERT was not triggered so far, since ARM3 mapped all pages as read/write regardless of protection! So all (page file backed) sections mapped into user space were writable and could be happily modified from user mode! - Fix MI_MAKE_HARDWARE_PTE_USER, so that it respects the actual protection. svn path=/trunk/; revision=63354 --- reactos/ntoskrnl/mm/ARM3/miarm.h | 3 ++- reactos/ntoskrnl/mm/ARM3/pagfault.c | 32 +++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/miarm.h b/reactos/ntoskrnl/mm/ARM3/miarm.h index 00566877b05..1a86f7e40fc 100644 --- a/reactos/ntoskrnl/mm/ARM3/miarm.h +++ b/reactos/ntoskrnl/mm/ARM3/miarm.h @@ -887,9 +887,10 @@ MI_MAKE_HARDWARE_PTE_USER(IN PMMPTE NewPte, ASSERT(MappingPte <= MiHighestUserPte); /* Start fresh */ - *NewPte = ValidKernelPte; + NewPte->u.Long = 0; /* Set the protection and page */ + NewPte->u.Hard.Valid = TRUE; NewPte->u.Hard.Owner = TRUE; NewPte->u.Hard.PageFrameNumber = PageFrameNumber; NewPte->u.Long |= MmProtectToPteMask[ProtectionMask]; diff --git a/reactos/ntoskrnl/mm/ARM3/pagfault.c b/reactos/ntoskrnl/mm/ARM3/pagfault.c index d8516bff64c..662d1ea9702 100644 --- a/reactos/ntoskrnl/mm/ARM3/pagfault.c +++ b/reactos/ntoskrnl/mm/ARM3/pagfault.c @@ -1835,9 +1835,37 @@ UserFault: ASSERT(MI_IS_PAGE_LARGE(PointerPde) == FALSE); } - /* Now capture the PTE. Ignore virtual faults for now */ + /* Now capture the PTE. */ TempPte = *PointerPte; - ASSERT(TempPte.u.Hard.Valid == 0); + + /* Check if the PTE is valid */ + if (TempPte.u.Hard.Valid) + { + /* Check if this is a write on a readonly PTE */ + if (StoreInstruction) + { + /* Is this a copy on write PTE? */ + if (TempPte.u.Hard.CopyOnWrite) + { + /* Not supported yet */ + ASSERT(FALSE); + } + + /* Is this a read-only PTE? */ + if (!TempPte.u.Hard.Write) + { + /* Return the status */ + MiUnlockProcessWorkingSet(CurrentProcess, CurrentThread); + return STATUS_ACCESS_VIOLATION; + } + } + + /* FIXME: Execution is ignored for now, since we don't have no-execute pages yet */ + + /* The fault has already been resolved by a different thread */ + MiUnlockProcessWorkingSet(CurrentProcess, CurrentThread); + return STATUS_SUCCESS; + } /* Quick check for demand-zero */ if (TempPte.u.Long == (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS)) From 005d881ce1cc678d98b660a39cca6d447a98e289 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 18 May 2014 15:14:24 +0000 Subject: [PATCH 09/69] [USETUP] First part of the partition management code rewrite. This part fixes the handling of primary partitions. Extended partitions and logical drives are not handled yet. Safety checks and warnings are still missing! Partitions created by the new code are accepted by gparted and Windows. svn path=/trunk/; revision=63355 --- reactos/base/setup/usetup/bootsup.c | 8 +- reactos/base/setup/usetup/interface/usetup.c | 251 ++- reactos/base/setup/usetup/partlist.c | 1888 ++++++++---------- reactos/base/setup/usetup/partlist.h | 50 +- 4 files changed, 953 insertions(+), 1244 deletions(-) diff --git a/reactos/base/setup/usetup/bootsup.c b/reactos/base/setup/usetup/bootsup.c index 74d5ad3ffff..183641cfca0 100644 --- a/reactos/base/setup/usetup/bootsup.c +++ b/reactos/base/setup/usetup/bootsup.c @@ -1444,7 +1444,6 @@ InstallFat16BootCodeToDisk( NTSTATUS Status; PFAT_BOOTSECTOR OrigBootSector; PFAT_BOOTSECTOR NewBootSector; - PARTITION_INFORMATION *PartInfo; /* Allocate buffer for original bootsector */ OrigBootSector = RtlAllocateHeap(ProcessHeap, 0, SECTORSIZE); @@ -1543,8 +1542,7 @@ InstallFat16BootCodeToDisk( FIELD_OFFSET(FAT_BOOTSECTOR, BootCodeAndData) - FIELD_OFFSET(FAT_BOOTSECTOR, OemName)); - PartInfo = &PartitionList->CurrentPartition->PartInfo[PartitionList->CurrentPartitionNumber]; - NewBootSector->HiddenSectors = PartInfo->HiddenSectors; + NewBootSector->HiddenSectors = PartitionList->CurrentDisk->SectorsPerTrack; /* Free the original boot sector */ RtlFreeHeap(ProcessHeap, 0, OrigBootSector); @@ -1606,7 +1604,6 @@ InstallFat32BootCodeToDisk( PFAT32_BOOTSECTOR NewBootSector; LARGE_INTEGER FileOffset; USHORT BackupBootSector; - PARTITION_INFORMATION *PartInfo; /* Allocate buffer for original bootsector */ OrigBootSector = RtlAllocateHeap(ProcessHeap, 0, SECTORSIZE); @@ -1704,8 +1701,7 @@ InstallFat32BootCodeToDisk( FIELD_OFFSET(FAT32_BOOTSECTOR, BootCodeAndData) - FIELD_OFFSET(FAT32_BOOTSECTOR, OemName)); - PartInfo = &PartitionList->CurrentPartition->PartInfo[PartitionList->CurrentPartitionNumber]; - NewBootSector->HiddenSectors = PartInfo->HiddenSectors; + NewBootSector->HiddenSectors = PartitionList->CurrentDisk->SectorsPerTrack; /* Get the location of the backup boot sector */ BackupBootSector = OrigBootSector->BackupBootSector; diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index 8ba4d858be9..c0c597e617c 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -1428,6 +1428,7 @@ LayoutSettingsPage(PINPUT_RECORD Ir) } +#if 0 static BOOL IsDiskSizeValid(PPARTENTRY PartEntry) { @@ -1456,6 +1457,7 @@ IsDiskSizeValid(PPARTENTRY PartEntry) return TRUE; } } +#endif static PAGE_NUMBER @@ -1512,32 +1514,32 @@ SelectPartitionPage(PINPUT_RECORD Ir) { if (AutoPartition) { - PPARTENTRY PartEntry = PartitionList->CurrentPartition; - ULONG MaxSize = (PartEntry->UnpartitionedLength + (1 << 19)) >> 20; /* in MBytes (rounded) */ - if(!IsDiskSizeValid(PartitionList->CurrentPartition)) +#if 0 + if (!IsDiskSizeValid(PartitionList->CurrentPartition)) { MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY); return SELECT_PARTITION_PAGE; /* let the user select another partition */ } - +#endif CreateNewPartition(PartitionList, - MaxSize, + PartitionList->CurrentPartition->SectorCount.QuadPart, TRUE); - DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter[0]; + DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; return SELECT_FILE_SYSTEM_PAGE; } } else { - if(!IsDiskSizeValid(PartitionList->CurrentPartition)) +#if 0 + if (!IsDiskSizeValid(PartitionList->CurrentPartition)) { MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY); return SELECT_PARTITION_PAGE; /* let the user select another partition */ } - - DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter[0]; +#endif + DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; return SELECT_FILE_SYSTEM_PAGE; } @@ -1547,7 +1549,7 @@ SelectPartitionPage(PINPUT_RECORD Ir) { /* Update status text */ if (PartitionList->CurrentPartition == NULL || - PartitionList->CurrentPartition->Unpartitioned == TRUE) + PartitionList->CurrentPartition->IsPartitioned == FALSE) { CONSOLE_SetStatusText(MUIGetString(STRING_INSTALLCREATEPARTITION)); } @@ -1582,26 +1584,28 @@ SelectPartitionPage(PINPUT_RECORD Ir) } else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */ { - if(!IsDiskSizeValid(PartitionList->CurrentPartition)) +#if 0 + if (!IsDiskSizeValid(PartitionList->CurrentPartition)) { MUIDisplayError(ERROR_INSUFFICIENT_DISKSPACE, Ir, POPUP_WAIT_ANY_KEY); return SELECT_PARTITION_PAGE; /* let the user select another partition */ } +#endif if (PartitionList->CurrentPartition == NULL || - PartitionList->CurrentPartition->Unpartitioned == TRUE) + PartitionList->CurrentPartition->IsPartitioned == FALSE) { CreateNewPartition(PartitionList, 0ULL, TRUE); } - DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter[0]; + DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; return SELECT_FILE_SYSTEM_PAGE; } else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'C') /* C */ { - if (PartitionList->CurrentPartition->Unpartitioned == FALSE) + if (PartitionList->CurrentPartition->IsPartitioned == TRUE) { MUIDisplayError(ERROR_NEW_PARTITION, Ir, POPUP_WAIT_ANY_KEY); return SELECT_PARTITION_PAGE; @@ -1611,7 +1615,7 @@ SelectPartitionPage(PINPUT_RECORD Ir) } else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'D') /* D */ { - if (PartitionList->CurrentPartition->Unpartitioned == TRUE) + if (PartitionList->CurrentPartition->IsPartitioned == FALSE) { MUIDisplayError(ERROR_DELETE_SPACE, Ir, POPUP_WAIT_ANY_KEY); return SELECT_PARTITION_PAGE; @@ -1779,6 +1783,7 @@ CreatePartitionPage(PINPUT_RECORD Ir) ULONG MaxSize; ULONGLONG PartSize; ULONGLONG DiskSize; + ULONGLONG SectorCount; PCHAR Unit; if (PartitionList == NULL || @@ -1796,17 +1801,17 @@ CreatePartitionPage(PINPUT_RECORD Ir) CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHOOSENEWPARTITION)); + DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; #if 0 - if (DiskEntry->DiskSize >= 0x280000000ULL) /* 10 GB */ + if (DiskSize >= 10737418240) /* 10 GB */ { - DiskSize = (DiskEntry->DiskSize + (1 << 29)) >> 30; + DiskSize = DiskSize / 1073741824; Unit = MUIGetString(STRING_GB); } else #endif { - DiskSize = (DiskEntry->DiskSize + (1 << 19)) >> 20; - + DiskSize = DiskSize / 1048576; if (DiskSize == 0) DiskSize = 1; @@ -1841,7 +1846,7 @@ CreatePartitionPage(PINPUT_RECORD Ir) #if 0 CONSOLE_PrintTextXY(8, 10, "Maximum size of the new partition is %I64u MB", - PartitionList->CurrentPartition->UnpartitionedLength / (1024*1024)); + PartitionList->CurrentPartition->SectorCount * DiskEntry->BytesPerSector / 1048576); #endif CONSOLE_SetStatusText(MUIGetString(STRING_CREATEPARTITION)); @@ -1849,9 +1854,10 @@ CreatePartitionPage(PINPUT_RECORD Ir) PartEntry = PartitionList->CurrentPartition; while (TRUE) { - MaxSize = (PartEntry->UnpartitionedLength + (1 << 19)) >> 20; /* in MBytes (rounded) */ + MaxSize = (PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector) / 1048576; /* in MBytes (rounded) */ - if (MaxSize > PARTITION_MAXSIZE) MaxSize = PARTITION_MAXSIZE; + if (MaxSize > PARTITION_MAXSIZE) + MaxSize = PARTITION_MAXSIZE; ShowPartitionSizeInputBox(12, 14, xScreen - 12, 17, /* left, top, right, bottom */ MaxSize, InputBuffer, &Quit, &Cancel); @@ -1887,23 +1893,22 @@ CreatePartitionPage(PINPUT_RECORD Ir) if (PartSize == MaxSize) { /* Use all of the unpartitioned disk space */ - PartSize = PartEntry->UnpartitionedLength; + SectorCount = PartEntry->SectorCount.QuadPart; } else { - /* Round-up by cylinder size */ - PartSize = (PartSize * 1024 * 1024 + DiskEntry->CylinderSize - 1) / - DiskEntry->CylinderSize * DiskEntry->CylinderSize; + /* Calculate the sector count from the size in MB */ + SectorCount = PartSize * 1048576 / DiskEntry->BytesPerSector; /* But never get larger than the unpartitioned disk space */ - if (PartSize > PartEntry->UnpartitionedLength) - PartSize = PartEntry->UnpartitionedLength; + if (SectorCount > PartEntry->SectorCount.QuadPart) + SectorCount = PartEntry->SectorCount.QuadPart; } DPRINT ("Partition size: %I64u bytes\n", PartSize); CreateNewPartition(PartitionList, - PartSize, + SectorCount, FALSE); return SELECT_PARTITION_PAGE; @@ -1923,7 +1928,6 @@ DeletePartitionPage(PINPUT_RECORD Ir) ULONGLONG PartSize; PCHAR Unit; PCHAR PartType; - UCHAR PartNumber; if (PartitionList == NULL || PartitionList->CurrentDisk == NULL || @@ -1935,7 +1939,6 @@ DeletePartitionPage(PINPUT_RECORD Ir) DiskEntry = PartitionList->CurrentDisk; PartEntry = PartitionList->CurrentPartition; - PartNumber = PartitionList->CurrentPartitionNumber; MUIDisplayPage(DELETE_PARTITION_PAGE); @@ -1945,46 +1948,47 @@ DeletePartitionPage(PINPUT_RECORD Ir) { PartType = MUIGetString(STRING_UNFORMATTED); } - else if (PartEntry->Unpartitioned == FALSE) + else if (PartEntry->IsPartitioned == TRUE) { - if ((PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT_12) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT_16) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_HUGE) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_XINT13)) + if ((PartEntry->PartitionType == PARTITION_FAT_12) || + (PartEntry->PartitionType == PARTITION_FAT_16) || + (PartEntry->PartitionType == PARTITION_HUGE) || + (PartEntry->PartitionType == PARTITION_XINT13)) { PartType = "FAT"; } - else if ((PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT32) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT32_XINT13)) + else if ((PartEntry->PartitionType == PARTITION_FAT32) || + (PartEntry->PartitionType == PARTITION_FAT32_XINT13)) { PartType = "FAT32"; } - else if (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_EXT2) + else if (PartEntry->PartitionType == PARTITION_EXT2) { PartType = "EXT2"; } - else if (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_IFS) + else if (PartEntry->PartitionType == PARTITION_IFS) { PartType = "NTFS"; /* FIXME: Not quite correct! */ } } + PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; #if 0 - if (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart >= 0x280000000LL) /* 10 GB */ + if (PartSize >= 10737418240) /* 10 GB */ { - PartSize = (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart + (1 << 29)) >> 30; + PartSize = PartSize / 1073741824; Unit = MUIGetString(STRING_GB); } else #endif - if (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart >= 0xA00000LL) /* 10 MB */ + if (PartSize >= 10485760) /* 10 MB */ { - PartSize = (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart + (1 << 19)) >> 20; + PartSize = PartSize / 1048576; Unit = MUIGetString(STRING_MB); } else { - PartSize = (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart + (1 << 9)) >> 10; + PartSize = PartSize / 1024; Unit = MUIGetString(STRING_KB); } @@ -1992,9 +1996,9 @@ DeletePartitionPage(PINPUT_RECORD Ir) { CONSOLE_PrintTextXY(6, 10, MUIGetString(STRING_HDDINFOUNK2), - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : PartEntry->DriveLetter[PartNumber], - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : ':', - PartEntry->PartInfo[PartNumber].PartitionType, + (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, + (PartEntry->DriveLetter == 0) ? '-' : ':', + PartEntry->PartitionType, PartSize, Unit); } @@ -2002,24 +2006,24 @@ DeletePartitionPage(PINPUT_RECORD Ir) { CONSOLE_PrintTextXY(6, 10, " %c%c %s %I64u %s", - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : PartEntry->DriveLetter[PartNumber], - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : ':', + (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, + (PartEntry->DriveLetter == 0) ? '-' : ':', PartType, PartSize, Unit); } + DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; #if 0 - if (DiskEntry->DiskSize >= 0x280000000ULL) /* 10 GB */ + if (DiskSize >= 10737418240) /* 10 GB */ { - DiskSize = (DiskEntry->DiskSize + (1 << 29)) >> 30; + DiskSize = DiskSize / 1073741824; Unit = MUIGetString(STRING_GB); } else #endif { - DiskSize = (DiskEntry->DiskSize + (1 << 19)) >> 20; - + DiskSize = DiskSize / 1048576; if (DiskSize == 0) DiskSize = 1; @@ -2085,7 +2089,6 @@ SelectFileSystemPage(PINPUT_RECORD Ir) { PDISKENTRY DiskEntry; PPARTENTRY PartEntry; - UCHAR PartNumber; ULONGLONG DiskSize; ULONGLONG PartSize; PCHAR DiskUnit; @@ -2102,54 +2105,55 @@ SelectFileSystemPage(PINPUT_RECORD Ir) DiskEntry = PartitionList->CurrentDisk; PartEntry = PartitionList->CurrentPartition; - PartNumber = PartitionList->CurrentPartitionNumber; /* adjust disk size */ - if (DiskEntry->DiskSize >= 0x280000000ULL) /* 10 GB */ + DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; + if (DiskSize >= 10737418240) /* 10 GB */ { - DiskSize = (DiskEntry->DiskSize + (1 << 29)) >> 30; + DiskSize = DiskSize / 1073741824; DiskUnit = MUIGetString(STRING_GB); } else { - DiskSize = (DiskEntry->DiskSize + (1 << 19)) >> 20; + DiskSize = DiskSize / 1048576; DiskUnit = MUIGetString(STRING_MB); } /* adjust partition size */ - if (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart >= 0x280000000LL) /* 10 GB */ + PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; + if (PartSize >= 10737418240) /* 10 GB */ { - PartSize = (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart + (1 << 29)) >> 30; + PartSize = PartSize / 1073741824; PartUnit = MUIGetString(STRING_GB); } else { - PartSize = (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart + (1 << 19)) >> 20; + PartSize = PartSize / 1048576; PartUnit = MUIGetString(STRING_MB); } /* adjust partition type */ - if ((PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT_12) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT_16) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_HUGE) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_XINT13)) + if ((PartEntry->PartitionType == PARTITION_FAT_12) || + (PartEntry->PartitionType == PARTITION_FAT_16) || + (PartEntry->PartitionType == PARTITION_HUGE) || + (PartEntry->PartitionType == PARTITION_XINT13)) { PartType = "FAT"; } - else if ((PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT32) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT32_XINT13)) + else if ((PartEntry->PartitionType == PARTITION_FAT32) || + (PartEntry->PartitionType == PARTITION_FAT32_XINT13)) { PartType = "FAT32"; } - else if (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_EXT2) + else if (PartEntry->PartitionType == PARTITION_EXT2) { PartType = "EXT2"; } - else if (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_IFS) + else if (PartEntry->PartitionType == PARTITION_IFS) { PartType = "NTFS"; /* FIXME: Not quite correct! */ } - else if (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_ENTRY_UNUSED) + else if (PartEntry->PartitionType == PARTITION_ENTRY_UNUSED) { PartType = MUIGetString(STRING_FORMATUNUSED); } @@ -2164,7 +2168,7 @@ SelectFileSystemPage(PINPUT_RECORD Ir) #if 0 CONSOLE_PrintTextXY(8, 10, "Partition %lu (%I64u %s) %s of", - PartEntry->PartInfo[PartNumber].PartitionNumber, + PartEntry->PartitionNumber, PartSize, PartUnit, PartType); @@ -2197,9 +2201,9 @@ SelectFileSystemPage(PINPUT_RECORD Ir) { CONSOLE_PrintTextXY(8, 10, MUIGetString(STRING_HDDINFOUNK4), - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : PartEntry->DriveLetter[PartNumber], - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : ':', - PartEntry->PartInfo[PartNumber].PartitionType, + (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, + (PartEntry->DriveLetter == 0) ? '-' : ':', + PartEntry->PartitionType, PartSize, PartUnit); } @@ -2207,8 +2211,8 @@ SelectFileSystemPage(PINPUT_RECORD Ir) { CONSOLE_PrintTextXY(8, 10, "%c%c %s %I64u %s", - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : PartEntry->DriveLetter[PartNumber], - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : ':', + (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, + (PartEntry->DriveLetter == 0) ? '-' : ':', PartType, PartSize, PartUnit); @@ -2237,6 +2241,7 @@ SelectFileSystemPage(PINPUT_RECORD Ir) /* FIXME: Add file systems to list */ } + DrawFileSystemList(FileSystemList); if (RepairUpdateFlag) @@ -2305,12 +2310,11 @@ static ULONG FormatPartitionPage(PINPUT_RECORD Ir) { WCHAR PathBuffer[MAX_PATH]; + PDISKENTRY DiskEntry; PPARTENTRY PartEntry; - UCHAR PartNum; NTSTATUS Status; #ifndef NDEBUG - PDISKENTRY DiskEntry; ULONG Line; ULONG i; PLIST_ENTRY Entry; @@ -2326,11 +2330,8 @@ FormatPartitionPage(PINPUT_RECORD Ir) return QUIT_PAGE; } -#ifndef NDEBUG DiskEntry = PartitionList->CurrentDisk; -#endif PartEntry = PartitionList->CurrentPartition; - PartNum = PartitionList->CurrentPartitionNumber; while (TRUE) { @@ -2355,50 +2356,55 @@ FormatPartitionPage(PINPUT_RECORD Ir) if (wcscmp(FileSystemList->Selected->FileSystem, L"FAT") == 0) { - if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (4200LL * 1024LL)) + if (PartEntry->SectorCount.QuadPart < 8192) { /* FAT12 CHS partition (disk is smaller than 4.1MB) */ - PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT_12; + PartEntry->PartitionType = PARTITION_FAT_12; } - else if (PartEntry->PartInfo[PartNum].StartingOffset.QuadPart < (1024LL * 255LL * 63LL * 512LL)) + else if (PartEntry->StartSector.QuadPart < 1450560) { /* Partition starts below the 8.4GB boundary ==> CHS partition */ - if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (32LL * 1024LL * 1024LL)) + if (PartEntry->SectorCount.QuadPart < 65536) { /* FAT16 CHS partition (partiton size < 32MB) */ - PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT_16; + PartEntry->PartitionType = PARTITION_FAT_16; } - else if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (512LL * 1024LL * 1024LL)) + else if (PartEntry->SectorCount.QuadPart < 1048576) { /* FAT16 CHS partition (partition size < 512MB) */ - PartEntry->PartInfo[PartNum].PartitionType = PARTITION_HUGE; + PartEntry->PartitionType = PARTITION_HUGE; } else { /* FAT32 CHS partition (partition size >= 512MB) */ - PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT32; + PartEntry->PartitionType = PARTITION_FAT32; } } else { /* Partition starts above the 8.4GB boundary ==> LBA partition */ - if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (512LL * 1024LL * 1024LL)) + if (PartEntry->SectorCount.QuadPart < 1048576) { /* FAT16 LBA partition (partition size < 512MB) */ - PartEntry->PartInfo[PartNum].PartitionType = PARTITION_XINT13; + PartEntry->PartitionType = PARTITION_XINT13; } else { /* FAT32 LBA partition (partition size >= 512MB) */ - PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT32_XINT13; + PartEntry->PartitionType = PARTITION_FAT32_XINT13; } } + + DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].PartitionType = PartEntry->PartitionType; } #if 0 else if (wcscmp(FileSystemList->Selected->FileSystem, L"EXT2") == 0) + { PartEntry->PartInfo[PartNum].PartitionType = PARTITION_EXT2; + DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].PartitionType = PartEntry->PartitionType; + } #endif else if (!FileSystemList->Selected->FormatFunc) return QUIT_PAGE; @@ -2414,27 +2420,21 @@ FormatPartitionPage(PINPUT_RECORD Ir) DiskEntry = PartitionList->CurrentDisk; Entry = DiskEntry->PartListHead.Flink; - while (Entry != &DiskEntry->PartListHead) + while (Entry != &DiskEntry->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); - if (PartEntry->Unpartitioned == FALSE) + if (PartEntry->IsPartitioned == TRUE) { - for (i = 0; i < 4; i++) - { - CONSOLE_PrintTextXY(6, Line, - "%2u: %2u %c %12I64u %12I64u %2u %c", - i, - PartEntry->PartInfo[i].PartitionNumber, - PartEntry->PartInfo[i].BootIndicator ? 'A' : '-', - PartEntry->PartInfo[i].StartingOffset.QuadPart, - PartEntry->PartInfo[i].PartitionLength.QuadPart, - PartEntry->PartInfo[i].PartitionType, - PartEntry->PartInfo[i].RewritePartition ? '*' : ' '); - - Line++; - } - + CONSOLE_PrintTextXY(6, Line, + "%2u: %2u %c %12I64u %12I64u %2u %c", + i, + PartEntry->PartitionNumber, + PartEntry->BootIndicator ? 'A' : '-', + PartEntry->StartSector.QuadPart, + PartEntry->SectorCount.QuadPart, + PartEntry->PartitionType, + PartEntry->Dirty ? '*' : ' '); Line++; } @@ -2445,6 +2445,8 @@ FormatPartitionPage(PINPUT_RECORD Ir) PartEntry = PartitionList->CurrentPartition; #endif + CheckActiveBootPartition(PartitionList); + if (WritePartitionsToDisk(PartitionList) == FALSE) { DPRINT("WritePartitionsToDisk() failed\n"); @@ -2457,7 +2459,7 @@ FormatPartitionPage(PINPUT_RECORD Ir) swprintf(PathBuffer, L"\\Device\\Harddisk%lu\\Partition%lu", PartitionList->CurrentDisk->DiskNumber, - PartitionList->CurrentPartition->PartInfo[PartNum].PartitionNumber); + PartitionList->CurrentPartition->PartitionNumber); RtlCreateUnicodeString(&DestinationRootPath, PathBuffer); DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath); @@ -2475,7 +2477,6 @@ FormatPartitionPage(PINPUT_RECORD Ir) PartEntry->New = FALSE; - CheckActiveBootPartition(PartitionList); } #ifndef NDEBUG @@ -2500,7 +2501,6 @@ CheckFileSystemPage(PINPUT_RECORD Ir) WCHAR PathBuffer[MAX_PATH]; CHAR Buffer[MAX_PATH]; NTSTATUS Status; - UCHAR PartNum = PartitionList->CurrentPartitionNumber; /* FIXME: code duplicated in FormatPartitionPage */ /* Set DestinationRootPath */ @@ -2508,7 +2508,7 @@ CheckFileSystemPage(PINPUT_RECORD Ir) swprintf(PathBuffer, L"\\Device\\Harddisk%lu\\Partition%lu", PartitionList->CurrentDisk->DiskNumber, - PartitionList->CurrentPartition->PartInfo[PartNum].PartitionNumber); + PartitionList->CurrentPartition->PartitionNumber); RtlCreateUnicodeString(&DestinationRootPath, PathBuffer); DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath); @@ -2574,8 +2574,7 @@ CheckFileSystemPage(PINPUT_RECORD Ir) static PAGE_NUMBER InstallDirectoryPage1(PWCHAR InstallDir, PDISKENTRY DiskEntry, - PPARTENTRY PartEntry, - UCHAR PartNum) + PPARTENTRY PartEntry) { WCHAR PathBuffer[MAX_PATH]; @@ -2599,7 +2598,7 @@ InstallDirectoryPage1(PWCHAR InstallDir, swprintf(PathBuffer, L"multi(0)disk(0)rdisk(%lu)partition(%lu)", DiskEntry->BiosDiskNumber, - PartEntry->PartInfo[PartNum].PartitionNumber); + PartEntry->PartitionNumber); if (InstallDir[0] != L'\\') wcscat(PathBuffer, L"\\"); @@ -2643,8 +2642,7 @@ InstallDirectoryPage(PINPUT_RECORD Ir) { return InstallDirectoryPage1(InstallDir, DiskEntry, - PartEntry, - PartitionList->CurrentPartitionNumber); + PartEntry); } while (TRUE) @@ -2663,8 +2661,7 @@ InstallDirectoryPage(PINPUT_RECORD Ir) { return InstallDirectoryPage1(InstallDir, DiskEntry, - PartEntry, - PartitionList->CurrentPartitionNumber); + PartEntry); } else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x08) /* BACKSPACE */ { @@ -3382,14 +3379,12 @@ BootLoaderPage(PINPUT_RECORD Ir) swprintf(PathBuffer, L"\\Device\\Harddisk%lu\\Partition%lu", PartitionList->ActiveBootDisk->DiskNumber, - PartitionList->ActiveBootPartition-> - PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionNumber); + PartitionList->ActiveBootPartition->PartitionNumber); RtlCreateUnicodeString(&SystemRootPath, PathBuffer); DPRINT("SystemRootPath: %wZ\n", &SystemRootPath); - PartitionType = PartitionList->ActiveBootPartition-> - PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType; + PartitionType = PartitionList->ActiveBootPartition->PartitionType; if (IsUnattendedSetup) { @@ -3573,8 +3568,7 @@ BootLoaderHarddiskVbrPage(PINPUT_RECORD Ir) UCHAR PartitionType; NTSTATUS Status; - PartitionType = PartitionList->ActiveBootPartition-> - PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType; + PartitionType = PartitionList->ActiveBootPartition->PartitionType; Status = InstallVBRToPartition(&SystemRootPath, &SourceRootPath, @@ -3598,8 +3592,7 @@ BootLoaderHarddiskMbrPage(PINPUT_RECORD Ir) WCHAR SourceMbrPathBuffer[MAX_PATH]; /* Step 1: Write the VBR */ - PartitionType = PartitionList->ActiveBootPartition-> - PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType; + PartitionType = PartitionList->ActiveBootPartition->PartitionType; Status = InstallVBRToPartition(&SystemRootPath, &SourceRootPath, diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index c81ce910581..3312e217c76 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -31,8 +31,58 @@ #define NDEBUG #include +#define DUMP_PARTITION_TABLE + /* FUNCTIONS ****************************************************************/ +#ifdef DUMP_PARTITION_TABLE +static +VOID +DumpPartitionTable( + PDISKENTRY DiskEntry) +{ + PPARTITION_INFORMATION PartitionInfo; + ULONG i; + + for (i = 0; i < DiskEntry->LayoutBuffer->PartitionCount; i++) + { + PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[i]; + DbgPrint("%lu: %12I64u %12I64u %10lu %2lu %2x %c %c\n", + i, + PartitionInfo->StartingOffset.QuadPart, + PartitionInfo->PartitionLength.QuadPart, + PartitionInfo->HiddenSectors, + PartitionInfo->PartitionNumber, + PartitionInfo->PartitionType, + PartitionInfo->BootIndicator ? '*': ' ', + PartitionInfo->RewritePartition ? 'Y': 'N'); + } +} +#endif + + +ULONGLONG +Align( + IN ULONGLONG Value, + IN ULONG Alignment) +{ + ULONGLONG Temp; + + Temp = Value / Alignment; + + return Temp * Alignment; +} + + +ULONGLONG +RoundingDivide( + IN ULONGLONG Dividend, + IN ULONGLONG Divisor) +{ + return (Dividend + Divisor / 2) / Divisor; +} + + static VOID GetDriverName( @@ -70,15 +120,14 @@ GetDriverName( static VOID -AssignDriverLetters( +AssignDriveLetters( PPARTLIST List) { PDISKENTRY DiskEntry; PPARTENTRY PartEntry; PLIST_ENTRY Entry1; - //PLIST_ENTRY Entry2; + PLIST_ENTRY Entry2; CHAR Letter; - UCHAR i; Letter = 'C'; @@ -88,34 +137,29 @@ AssignDriverLetters( { DiskEntry = CONTAINING_RECORD(Entry1, DISKENTRY, ListEntry); - if (!IsListEmpty(&DiskEntry->PartListHead)) + Entry2 = DiskEntry->PrimaryPartListHead.Flink; + while (Entry2 != &DiskEntry->PrimaryPartListHead) { - PartEntry = CONTAINING_RECORD(DiskEntry->PartListHead.Flink, - PARTENTRY, - ListEntry); + PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); - for (i = 0; i < 4; i++) - PartEntry->DriveLetter[i] = 0; + PartEntry->DriveLetter = 0; - if (PartEntry->Unpartitioned == FALSE) + if (PartEntry->IsPartitioned && + !IsContainerPartition(PartEntry->PartitionType)) { - for (i = 0; i < 4; i++) + if (IsRecognizedPartition(PartEntry->PartitionType) || + (PartEntry->PartitionType == PARTITION_ENTRY_UNUSED && + PartEntry->SectorCount.QuadPart != 0LL)) { - if (IsContainerPartition(PartEntry->PartInfo[i].PartitionType)) - continue; - - if (IsRecognizedPartition(PartEntry->PartInfo[i].PartitionType) || - (PartEntry->PartInfo[i].PartitionType == PARTITION_ENTRY_UNUSED && - PartEntry->PartInfo[i].PartitionLength.QuadPart != 0LL)) + if (Letter <= 'Z') { - if (Letter <= 'Z') - { - PartEntry->DriveLetter[i] = Letter; - Letter++; - } + PartEntry->DriveLetter = Letter; + Letter++; } } } + + Entry2 = Entry2->Flink; } Entry1 = Entry1->Flink; @@ -172,43 +216,38 @@ UpdatePartitionNumbers( { PPARTENTRY PartEntry; PLIST_ENTRY Entry; - ULONG PartNumber; - ULONG i; +// ULONG PartitionNumber = 1; + ULONG PartitionIndex = 0; - PartNumber = 1; - Entry = DiskEntry->PartListHead.Flink; - while (Entry != &DiskEntry->PartListHead) + Entry = DiskEntry->PrimaryPartListHead.Flink; + while (Entry != &DiskEntry->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); - if (PartEntry->Unpartitioned == TRUE) + if (PartEntry->IsPartitioned == FALSE) { - for (i = 0; i < 4; i++) - { - PartEntry->PartInfo[i].PartitionNumber = 0; - } +// PartEntry->PartitionNumber = 0; + PartEntry->PartitionIndex = (ULONG)-1; } else { - for (i = 0; i < 4; i++) + if (IsContainerPartition(PartEntry->PartitionType)) { - if (IsContainerPartition(PartEntry->PartInfo[i].PartitionType)) - { - PartEntry->PartInfo[i].PartitionNumber = 0; - } - else if (PartEntry->PartInfo[i].PartitionType == PARTITION_ENTRY_UNUSED && - PartEntry->PartInfo[i].PartitionLength.QuadPart == 0ULL) - { - PartEntry->PartInfo[i].PartitionNumber = 0; - } - else - { - PartEntry->PartInfo[i].PartitionNumber = PartNumber; - PartNumber++; - } +// PartEntry->PartitionNumber = 0; } + else if (PartEntry->PartitionType == PARTITION_ENTRY_UNUSED && + PartEntry->SectorCount.QuadPart == 0ULL) + { +// PartEntry->PartitionNumber = 0; + } + else + { +// PartEntry->PartitionNumber = PartitionNumber++; + } + + PartEntry->PartitionIndex = PartitionIndex++; } Entry = Entry->Flink; @@ -216,247 +255,6 @@ UpdatePartitionNumbers( } -static -VOID -AddPartitionToList( - ULONG DiskNumber, - PDISKENTRY DiskEntry, - DRIVE_LAYOUT_INFORMATION *LayoutBuffer) -{ - PPARTENTRY PartEntry; - ULONG i; - ULONG j; - - for (i = 0; i < LayoutBuffer->PartitionCount; i += 4) - { - for (j = 0; j < 4; j++) - { - if (LayoutBuffer->PartitionEntry[i+j].PartitionType != PARTITION_ENTRY_UNUSED || - LayoutBuffer->PartitionEntry[i+j].PartitionLength.QuadPart != 0ULL) - { - break; - } - } - - if (j >= 4) - { - continue; - } - - PartEntry = (PPARTENTRY)RtlAllocateHeap(ProcessHeap, - 0, - sizeof(PARTENTRY)); - if (PartEntry == NULL) - { - return; - } - - RtlZeroMemory(PartEntry, - sizeof(PARTENTRY)); - - PartEntry->Unpartitioned = FALSE; - - for (j = 0; j < 4; j++) - { - RtlCopyMemory(&PartEntry->PartInfo[j], - &LayoutBuffer->PartitionEntry[i+j], - sizeof(PARTITION_INFORMATION)); - } - - if (IsContainerPartition(PartEntry->PartInfo[0].PartitionType)) - { - PartEntry->FormatState = Unformatted; - } - else if ((PartEntry->PartInfo[0].PartitionType == PARTITION_FAT_12) || - (PartEntry->PartInfo[0].PartitionType == PARTITION_FAT_16) || - (PartEntry->PartInfo[0].PartitionType == PARTITION_HUGE) || - (PartEntry->PartInfo[0].PartitionType == PARTITION_XINT13) || - (PartEntry->PartInfo[0].PartitionType == PARTITION_FAT32) || - (PartEntry->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13)) - { -#if 0 - if (CheckFatFormat()) - { - PartEntry->FormatState = Preformatted; - } - else - { - PartEntry->FormatState = Unformatted; - } -#endif - PartEntry->FormatState = Preformatted; - } - else if (PartEntry->PartInfo[0].PartitionType == PARTITION_EXT2) - { -#if 0 - if (CheckExt2Format()) - { - PartEntry->FormatState = Preformatted; - } - else - { - PartEntry->FormatState = Unformatted; - } -#endif - PartEntry->FormatState = Preformatted; - } - else if (PartEntry->PartInfo[0].PartitionType == PARTITION_IFS) - { -#if 0 - if (CheckNtfsFormat()) - { - PartEntry->FormatState = Preformatted; - } - else if (CheckHpfsFormat()) - { - PartEntry->FormatState = Preformatted; - } - else - { - PartEntry->FormatState = Unformatted; - } -#endif - PartEntry->FormatState = Preformatted; - } - else - { - PartEntry->FormatState = UnknownFormat; - } - - InsertTailList(&DiskEntry->PartListHead, - &PartEntry->ListEntry); - } -} - - -static -VOID -ScanForUnpartitionedDiskSpace( - PDISKENTRY DiskEntry) -{ - ULONGLONG LastStartingOffset; - ULONGLONG LastPartitionLength; - ULONGLONG LastUnusedPartitionLength; - PPARTENTRY PartEntry; - PPARTENTRY NewPartEntry; - PLIST_ENTRY Entry; - ULONG i; - ULONG j; - - if (IsListEmpty (&DiskEntry->PartListHead)) - { - /* Create a partition table that represents the empty disk */ - PartEntry = (PPARTENTRY)RtlAllocateHeap(ProcessHeap, - 0, - sizeof(PARTENTRY)); - if (PartEntry == NULL) - return; - - RtlZeroMemory(PartEntry, - sizeof(PARTENTRY)); - - PartEntry->Unpartitioned = TRUE; - PartEntry->UnpartitionedOffset = 0ULL; - PartEntry->UnpartitionedLength = DiskEntry->DiskSize; - - PartEntry->FormatState = Unformatted; - - InsertTailList(&DiskEntry->PartListHead, - &PartEntry->ListEntry); - } - else - { - /* Start partition at head 1, cylinder 0 */ - LastStartingOffset = DiskEntry->TrackSize; - LastPartitionLength = 0ULL; - LastUnusedPartitionLength = 0ULL; - - i = 0; - Entry = DiskEntry->PartListHead.Flink; - while (Entry != &DiskEntry->PartListHead) - { - PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); - - for (j = 0; j < 4; j++) - { - if ((!IsContainerPartition (PartEntry->PartInfo[j].PartitionType)) && - (PartEntry->PartInfo[j].PartitionType != PARTITION_ENTRY_UNUSED || - PartEntry->PartInfo[j].PartitionLength.QuadPart != 0LL)) - { - LastUnusedPartitionLength = - PartEntry->PartInfo[j].StartingOffset.QuadPart - - (LastStartingOffset + LastPartitionLength); - - if (PartEntry->PartInfo[j].StartingOffset.QuadPart > (LastStartingOffset + LastPartitionLength) && - LastUnusedPartitionLength >= DiskEntry->CylinderSize) - { - DPRINT("Unpartitioned disk space %I64u\n", LastUnusedPartitionLength); - - NewPartEntry = (PPARTENTRY)RtlAllocateHeap(ProcessHeap, - 0, - sizeof(PARTENTRY)); - if (NewPartEntry == NULL) - return; - - RtlZeroMemory(NewPartEntry, - sizeof(PARTENTRY)); - - NewPartEntry->Unpartitioned = TRUE; - NewPartEntry->UnpartitionedOffset = LastStartingOffset + LastPartitionLength; - NewPartEntry->UnpartitionedLength = LastUnusedPartitionLength; - if (j == 0) - NewPartEntry->UnpartitionedLength -= DiskEntry->TrackSize; - - NewPartEntry->FormatState = Unformatted; - - /* Insert the table into the list */ - InsertTailList(&PartEntry->ListEntry, - &NewPartEntry->ListEntry); - } - - LastStartingOffset = PartEntry->PartInfo[j].StartingOffset.QuadPart; - LastPartitionLength = PartEntry->PartInfo[j].PartitionLength.QuadPart; - } - } - - i += 4; - Entry = Entry->Flink; - } - - /* Check for trailing unpartitioned disk space */ - if (DiskEntry->DiskSize > (LastStartingOffset + LastPartitionLength)) - { - /* Round-down to cylinder size */ - LastUnusedPartitionLength = - (DiskEntry->DiskSize - (LastStartingOffset + LastPartitionLength)) - & ~(DiskEntry->CylinderSize - 1); - - if (LastUnusedPartitionLength >= DiskEntry->CylinderSize) - { - DPRINT("Unpartitioned disk space %I64u\n", LastUnusedPartitionLength); - - NewPartEntry = (PPARTENTRY)RtlAllocateHeap(ProcessHeap, - 0, - sizeof(PARTENTRY)); - if (NewPartEntry == NULL) - return; - - RtlZeroMemory(NewPartEntry, - sizeof(PARTENTRY)); - - NewPartEntry->Unpartitioned = TRUE; - NewPartEntry->UnpartitionedOffset = LastStartingOffset + LastPartitionLength; - NewPartEntry->UnpartitionedLength = LastUnusedPartitionLength; - - /* Append the table to the list */ - InsertTailList(&DiskEntry->PartListHead, - &NewPartEntry->ListEntry); - } - } - } -} - - NTSTATUS NTAPI DiskIdentifierQueryRoutine( @@ -720,6 +518,311 @@ EnumerateBiosDiskEntries( } +static +VOID +AddPrimaryPartitionToDisk( + ULONG DiskNumber, + PDISKENTRY DiskEntry, + ULONG PartitionIndex) +{ + PPARTITION_INFORMATION PartitionInfo; + PPARTENTRY PartEntry; + + PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[PartitionIndex]; + + PartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (PartEntry == NULL) + { + return; + } + + PartEntry->StartSector.QuadPart = (ULONGLONG)PartitionInfo->StartingOffset.QuadPart / DiskEntry->BytesPerSector; + PartEntry->SectorCount.QuadPart = (ULONGLONG)PartitionInfo->PartitionLength.QuadPart / DiskEntry->BytesPerSector; + + PartEntry->BootIndicator = PartitionInfo->BootIndicator; + PartEntry->PartitionType = PartitionInfo->PartitionType; + PartEntry->HiddenSectors = PartitionInfo->HiddenSectors; + + PartEntry->IsPartitioned = TRUE; + PartEntry->PartitionNumber = PartitionInfo->PartitionNumber; + PartEntry->PartitionIndex = PartitionIndex; + + if (IsContainerPartition(PartEntry->PartitionType)) + { + PartEntry->FormatState = Unformatted; + } + else if ((PartEntry->PartitionType == PARTITION_FAT_12) || + (PartEntry->PartitionType == PARTITION_FAT_16) || + (PartEntry->PartitionType == PARTITION_HUGE) || + (PartEntry->PartitionType == PARTITION_XINT13) || + (PartEntry->PartitionType == PARTITION_FAT32) || + (PartEntry->PartitionType == PARTITION_FAT32_XINT13)) + { +#if 0 + if (CheckFatFormat()) + { + PartEntry->FormatState = Preformatted; + } + else + { + PartEntry->FormatState = Unformatted; + } +#endif + PartEntry->FormatState = Preformatted; + } + else if (PartEntry->PartitionType == PARTITION_EXT2) + { +#if 0 + if (CheckExt2Format()) + { + PartEntry->FormatState = Preformatted; + } + else + { + PartEntry->FormatState = Unformatted; + } +#endif + PartEntry->FormatState = Preformatted; + } + else if (PartEntry->PartitionType == PARTITION_IFS) + { +#if 0 + if (CheckNtfsFormat()) + { + PartEntry->FormatState = Preformatted; + } + else if (CheckHpfsFormat()) + { + PartEntry->FormatState = Preformatted; + } + else + { + PartEntry->FormatState = Unformatted; + } +#endif + PartEntry->FormatState = Preformatted; + } + else + { + PartEntry->FormatState = UnknownFormat; + } + + InsertTailList(&DiskEntry->PrimaryPartListHead, + &PartEntry->ListEntry); +} + + +static +VOID +ScanForUnpartitionedDiskSpace( + PDISKENTRY DiskEntry) +{ + ULONGLONG LastStartSector; + ULONGLONG LastSectorCount; + ULONGLONG LastUnusedSectorCount; + PPARTENTRY PartEntry; + PPARTENTRY NewPartEntry; + PLIST_ENTRY Entry; + + DPRINT1("ScanForUnpartitionedDiskSpace()\n"); + + if (IsListEmpty(&DiskEntry->PrimaryPartListHead)) + { + DPRINT1("No primary partition!\n"); + + /* Create a partition table that represents the empty disk */ + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = (ULONGLONG)DiskEntry->SectorsPerTrack; + NewPartEntry->SectorCount.QuadPart = Align(DiskEntry->SectorCount.QuadPart, DiskEntry->SectorAlignment) - + DiskEntry->SectorsPerTrack; +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + InsertTailList(&DiskEntry->PrimaryPartListHead, + &NewPartEntry->ListEntry); + + return; + } + + /* Start partition at head 1, cylinder 0 */ + LastStartSector = DiskEntry->SectorsPerTrack; + LastSectorCount = 0ULL; + LastUnusedSectorCount = 0ULL; + + Entry = DiskEntry->PrimaryPartListHead.Flink; + while (Entry != &DiskEntry->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + + if (PartEntry->PartitionType != PARTITION_ENTRY_UNUSED || + PartEntry->SectorCount.QuadPart != 0ULL) + { + LastUnusedSectorCount = + PartEntry->StartSector.QuadPart - (LastStartSector + LastSectorCount); + + if (PartEntry->StartSector.QuadPart > (LastStartSector + LastSectorCount) && + LastUnusedSectorCount >= (ULONGLONG)DiskEntry->SectorAlignment) + { + DPRINT("Unpartitioned disk space %I64u sectors\n", LastUnusedSectorCount); + + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = LastStartSector + LastSectorCount; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + LastUnusedSectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + /* Insert the table into the list */ + InsertTailList(&PartEntry->ListEntry, + &NewPartEntry->ListEntry); + } + + LastStartSector = PartEntry->StartSector.QuadPart; + LastSectorCount = PartEntry->SectorCount.QuadPart; + } + + Entry = Entry->Flink; + } + + /* Check for trailing unpartitioned disk space */ + if ((LastStartSector + LastSectorCount) < DiskEntry->SectorCount.QuadPart) + { + LastUnusedSectorCount = Align(DiskEntry->SectorCount.QuadPart - (LastStartSector + LastSectorCount), DiskEntry->SectorAlignment); + + if (LastUnusedSectorCount >= (ULONGLONG)DiskEntry->SectorAlignment) + { + DPRINT("Unpartitioned disk space: %I64u sectors\n", LastUnusedSectorCount); + + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = LastStartSector + LastSectorCount; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + LastUnusedSectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + /* Append the table to the list */ + InsertTailList(&DiskEntry->PrimaryPartListHead, + &NewPartEntry->ListEntry); + } + } + + DPRINT1("ScanForUnpartitionedDiskSpace() done\n"); +} + + +static +VOID +SetDiskSignature( + IN PPARTLIST List, + IN PDISKENTRY DiskEntry) +{ + LARGE_INTEGER SystemTime; + TIME_FIELDS TimeFields; + PLIST_ENTRY Entry2; + PDISKENTRY DiskEntry2; + PUCHAR Buffer; + + Buffer = (PUCHAR)&DiskEntry->LayoutBuffer->Signature; + + while (1) + { + NtQuerySystemTime(&SystemTime); + RtlTimeToTimeFields(&SystemTime, &TimeFields); + + Buffer[0] = (UCHAR)(TimeFields.Year & 0xFF) + (UCHAR)(TimeFields.Hour & 0xFF); + Buffer[1] = (UCHAR)(TimeFields.Year >> 8) + (UCHAR)(TimeFields.Minute & 0xFF); + Buffer[2] = (UCHAR)(TimeFields.Month & 0xFF) + (UCHAR)(TimeFields.Second & 0xFF); + Buffer[3] = (UCHAR)(TimeFields.Day & 0xFF) + (UCHAR)(TimeFields.Milliseconds & 0xFF); + + if (DiskEntry->LayoutBuffer->Signature == 0) + { + continue; + } + + /* check if the signature already exist */ + /* FIXME: + * Check also signatures from disks, which are + * not visible (bootable) by the bios. + */ + Entry2 = List->DiskListHead.Flink; + while (Entry2 != &List->DiskListHead) + { + DiskEntry2 = CONTAINING_RECORD(Entry2, DISKENTRY, ListEntry); + + if (DiskEntry != DiskEntry2 && + DiskEntry->LayoutBuffer->Signature == DiskEntry2->LayoutBuffer->Signature) + break; + + Entry2 = Entry2->Flink; + } + + if (Entry2 == &List->DiskListHead) + break; + } +} + + +static +VOID +UpdateDiskSignatures( + PPARTLIST List) +{ + PLIST_ENTRY Entry; + PDISKENTRY DiskEntry; + + /* Print partition lines*/ + Entry = List->DiskListHead.Flink; + while (Entry != &List->DiskListHead) + { + DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry); + + if (DiskEntry->LayoutBuffer && + DiskEntry->LayoutBuffer->Signature == 0) + { + SetDiskSignature(List, DiskEntry); + DiskEntry->LayoutBuffer->PartitionEntry[0].RewritePartition = TRUE; + } + + Entry = Entry->Flink; + } +} + + static VOID AddDiskToList( @@ -727,7 +830,6 @@ AddDiskToList( ULONG DiskNumber, PPARTLIST List) { - DRIVE_LAYOUT_INFORMATION *LayoutBuffer; DISK_GEOMETRY DiskGeometry; SCSI_ADDRESS ScsiAddress; PDISKENTRY DiskEntry; @@ -820,21 +922,16 @@ AddDiskToList( swprintf(Identifier, L"%08x-%08x-A", Checksum, Signature); DPRINT("Identifier: %S\n", Identifier); - DiskEntry = (PDISKENTRY)RtlAllocateHeap(ProcessHeap, - 0, - sizeof(DISKENTRY)); + DiskEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(DISKENTRY)); if (DiskEntry == NULL) { return; } - DiskEntry->Checksum = Checksum; - DiskEntry->Signature = Signature; - if (Signature == 0) - { - /* If we have no signature, set the disk to dirty. WritePartitionsToDisk creates a new signature */ - DiskEntry->Modified = TRUE; - } +// DiskEntry->Checksum = Checksum; +// DiskEntry->Signature = Signature; DiskEntry->BiosFound = FALSE; /* Check if this disk has a valid MBR */ @@ -885,27 +982,27 @@ AddDiskToList( #endif } - InitializeListHead(&DiskEntry->PartListHead); + InitializeListHead(&DiskEntry->PrimaryPartListHead); + InitializeListHead(&DiskEntry->ExtendedPartListHead); DiskEntry->Cylinders = DiskGeometry.Cylinders.QuadPart; DiskEntry->TracksPerCylinder = DiskGeometry.TracksPerCylinder; DiskEntry->SectorsPerTrack = DiskGeometry.SectorsPerTrack; DiskEntry->BytesPerSector = DiskGeometry.BytesPerSector; - DPRINT ("Cylinders %I64u\n", DiskEntry->Cylinders); - DPRINT ("TracksPerCylinder %I64u\n", DiskEntry->TracksPerCylinder); - DPRINT ("SectorsPerTrack %I64u\n", DiskEntry->SectorsPerTrack); - DPRINT ("BytesPerSector %I64u\n", DiskEntry->BytesPerSector); + DPRINT("Cylinders %I64u\n", DiskEntry->Cylinders); + DPRINT("TracksPerCylinder %I64u\n", DiskEntry->TracksPerCylinder); + DPRINT("SectorsPerTrack %I64u\n", DiskEntry->SectorsPerTrack); + DPRINT("BytesPerSector %I64u\n", DiskEntry->BytesPerSector); - DiskEntry->TrackSize = - (ULONGLONG)DiskGeometry.SectorsPerTrack * - (ULONGLONG)DiskGeometry.BytesPerSector; - DiskEntry->CylinderSize = - (ULONGLONG)DiskGeometry.TracksPerCylinder * - DiskEntry->TrackSize; - DiskEntry->DiskSize = - DiskGeometry.Cylinders.QuadPart * - DiskEntry->CylinderSize; + DiskEntry->SectorCount.QuadPart = DiskGeometry.Cylinders.QuadPart * + (ULONGLONG)DiskGeometry.TracksPerCylinder * + (ULONGLONG)DiskGeometry.SectorsPerTrack; + + DiskEntry->SectorAlignment = DiskGeometry.SectorsPerTrack; + + DPRINT("SectorCount %I64u\n", DiskEntry->SectorCount); + DPRINT("SectorAlignment %lu\n", DiskEntry->SectorAlignment); DiskEntry->DiskNumber = DiskNumber; DiskEntry->Port = ScsiAddress.PortNumber; @@ -922,10 +1019,10 @@ AddDiskToList( */ LayoutBufferSize = sizeof(DRIVE_LAYOUT_INFORMATION) + ((56 - ANYSIZE_ARRAY) * sizeof(PARTITION_INFORMATION)); - LayoutBuffer = (DRIVE_LAYOUT_INFORMATION*)RtlAllocateHeap(ProcessHeap, - 0, - LayoutBufferSize); - if (LayoutBuffer == NULL) + DiskEntry->LayoutBuffer = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + LayoutBufferSize); + if (DiskEntry->LayoutBuffer == NULL) { return; } @@ -938,25 +1035,49 @@ AddDiskToList( IOCTL_DISK_GET_DRIVE_LAYOUT, NULL, 0, - LayoutBuffer, + DiskEntry->LayoutBuffer, LayoutBufferSize); if (NT_SUCCESS(Status)) { - if (LayoutBuffer->PartitionCount == 0) +#ifdef DUMP_PARTITION_TABLE + DumpPartitionTable(DiskEntry); +#endif + + if (DiskEntry->LayoutBuffer->PartitionCount == 0) { DiskEntry->NewDisk = TRUE; + DiskEntry->LayoutBuffer->PartitionCount = 4; + + for (i = 0; i < 4; i++) + DiskEntry->LayoutBuffer->PartitionEntry[i].RewritePartition = TRUE; } + else + { + for (i = 0; i < 4; i++) + { + if (DiskEntry->LayoutBuffer->PartitionEntry[i].PartitionType != 0) + { + AddPrimaryPartitionToDisk(DiskNumber, + DiskEntry, + i); + } + } - AddPartitionToList(DiskNumber, - DiskEntry, - LayoutBuffer); - - ScanForUnpartitionedDiskSpace(DiskEntry); + for (i = 4; i < DiskEntry->LayoutBuffer->PartitionCount; i++) + { + if (DiskEntry->LayoutBuffer->PartitionEntry[i].PartitionType != 0) + { +#if 0 + AddExtendedPartitionToDisk(DiskNumber, + DiskEntry, + i); +#endif + } + } + } } - RtlFreeHeap(ProcessHeap, - 0, - LayoutBuffer); + ScanForUnpartitionedDiskSpace(DiskEntry); } @@ -997,7 +1118,6 @@ CreatePartitionList( List->CurrentDisk = NULL; List->CurrentPartition = NULL; - List->CurrentPartitionNumber = 0; InitializeListHead(&List->DiskListHead); InitializeListHead(&List->BiosDiskListHead); @@ -1044,7 +1164,9 @@ CreatePartitionList( } } - AssignDriverLetters(List); + UpdateDiskSignatures(List); + + AssignDriveLetters(List); List->TopDisk = 0; List->TopPartition = 0; @@ -1054,7 +1176,6 @@ CreatePartitionList( { List->CurrentDisk = NULL; List->CurrentPartition = NULL; - List->CurrentPartitionNumber = 0; } else { @@ -1062,17 +1183,15 @@ CreatePartitionList( DISKENTRY, ListEntry); - if (IsListEmpty(&List->CurrentDisk->PartListHead)) + if (IsListEmpty(&List->CurrentDisk->PrimaryPartListHead)) { List->CurrentPartition = 0; - List->CurrentPartitionNumber = 0; } else { - List->CurrentPartition = CONTAINING_RECORD(List->CurrentDisk->PartListHead.Flink, + List->CurrentPartition = CONTAINING_RECORD(List->CurrentDisk->PrimaryPartListHead.Flink, PARTENTRY, ListEntry); - List->CurrentPartitionNumber = 0; } } @@ -1098,17 +1217,29 @@ DestroyPartitionList( /* Release driver name */ RtlFreeUnicodeString(&DiskEntry->DriverName); - /* Release partition array */ - while (!IsListEmpty(&DiskEntry->PartListHead)) + /* Release primary partition list */ + while (!IsListEmpty(&DiskEntry->PrimaryPartListHead)) { - Entry = RemoveHeadList(&DiskEntry->PartListHead); + Entry = RemoveHeadList(&DiskEntry->PrimaryPartListHead); PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); - RtlFreeHeap(ProcessHeap, - 0, - PartEntry); + RtlFreeHeap(ProcessHeap, 0, PartEntry); } + /* Release extended partition list */ + while (!IsListEmpty(&DiskEntry->ExtendedPartListHead)) + { + Entry = RemoveHeadList(&DiskEntry->ExtendedPartListHead); + PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + + RtlFreeHeap(ProcessHeap, 0, PartEntry); + } + + /* Release layout buffer */ + if (DiskEntry->LayoutBuffer != NULL) + RtlFreeHeap(ProcessHeap, 0, DiskEntry->LayoutBuffer); + + /* Release disk entry */ RtlFreeHeap(ProcessHeap, 0, DiskEntry); } @@ -1167,8 +1298,7 @@ VOID PrintPartitionData( PPARTLIST List, PDISKENTRY DiskEntry, - PPARTENTRY PartEntry, - ULONG PartNumber) + PPARTENTRY PartEntry) { CHAR LineBuffer[128]; COORD coPos; @@ -1186,24 +1316,25 @@ PrintPartitionData( coPos.X = List->Left + 1; coPos.Y = List->Top + 1 + List->Line; - if (PartEntry->Unpartitioned == TRUE) + if (PartEntry->IsPartitioned == FALSE) { + PartSize.QuadPart = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; #if 0 - if (PartEntry->UnpartitionledLength >= 0x280000000ULL) /* 10 GB */ + if (PartSize.QuadPart >= 10737418240) /* 10 GB */ { - PartSize.QuadPart = (PartEntry->UnpartitionedLength + (1 << 29)) >> 30; + PartSize.QuadPart = RoundingDivide(PartSize.QuadPart, 1073741824); Unit = MUIGetString(STRING_GB); } else #endif - if (PartEntry->UnpartitionedLength >= 0xA00000ULL) /* 10 MB */ + if (PartSize.QuadPart >= 10485760) /* 10 MB */ { - PartSize.QuadPart = (PartEntry->UnpartitionedLength + (1 << 19)) >> 20; + PartSize.QuadPart = RoundingDivide(PartSize.QuadPart, 1048576); Unit = MUIGetString(STRING_MB); } else { - PartSize.QuadPart = (PartEntry->UnpartitionedLength + (1 << 9)) >> 10; + PartSize.QuadPart = RoundingDivide(PartSize.QuadPart, 1024); Unit = MUIGetString(STRING_KB); } @@ -1220,46 +1351,47 @@ PrintPartitionData( { PartType = MUIGetString(STRING_UNFORMATTED); } - else if (PartEntry->Unpartitioned == FALSE) + else if (PartEntry->IsPartitioned == TRUE) { - if ((PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT_12) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT_16) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_HUGE) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_XINT13)) + if ((PartEntry->PartitionType == PARTITION_FAT_12) || + (PartEntry->PartitionType == PARTITION_FAT_16) || + (PartEntry->PartitionType == PARTITION_HUGE) || + (PartEntry->PartitionType == PARTITION_XINT13)) { PartType = "FAT"; } - else if ((PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT32) || - (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_FAT32_XINT13)) + else if ((PartEntry->PartitionType == PARTITION_FAT32) || + (PartEntry->PartitionType == PARTITION_FAT32_XINT13)) { PartType = "FAT32"; } - else if (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_EXT2) + else if (PartEntry->PartitionType == PARTITION_EXT2) { PartType = "EXT2"; } - else if (PartEntry->PartInfo[PartNumber].PartitionType == PARTITION_IFS) + else if (PartEntry->PartitionType == PARTITION_IFS) { PartType = "NTFS"; /* FIXME: Not quite correct! */ } } + PartSize.QuadPart = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; #if 0 - if (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart >= 0x280000000LL) /* 10 GB */ + if (PartSize.QuadPart >= 10737418240) /* 10 GB */ { - PartSize.QuadPart = (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart + (1 << 29)) >> 30; + PartSize.QuadPart = RoundingDivide(PartSize.QuadPart, 1073741824); Unit = MUIGetString(STRING_GB); } else #endif - if (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart >= 0xA00000LL) /* 10 MB */ + if (PartSize.QuadPart >= 10485760) /* 10 MB */ { - PartSize.QuadPart = (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart + (1 << 19)) >> 20; + PartSize.QuadPart = RoundingDivide(PartSize.QuadPart, 1048576); Unit = MUIGetString(STRING_MB); } else { - PartSize.QuadPart = (PartEntry->PartInfo[PartNumber].PartitionLength.QuadPart + (1 << 9)) >> 10; + PartSize.QuadPart = RoundingDivide(PartSize.QuadPart, 1024); Unit = MUIGetString(STRING_KB); } @@ -1267,9 +1399,9 @@ PrintPartitionData( { sprintf(LineBuffer, MUIGetString(STRING_HDDINFOUNK5), - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : PartEntry->DriveLetter[PartNumber], - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : ':', - PartEntry->PartInfo[PartNumber].PartitionType, + (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, + (PartEntry->DriveLetter == 0) ? '-' : ':', + PartEntry->PartitionType, PartSize.u.LowPart, Unit); } @@ -1277,8 +1409,8 @@ PrintPartitionData( { sprintf(LineBuffer, "%c%c %-24s %6lu %s", - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : PartEntry->DriveLetter[PartNumber], - (PartEntry->DriveLetter[PartNumber] == 0) ? '-' : ':', + (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, + (PartEntry->DriveLetter == 0) ? '-' : ':', PartType, PartSize.u.LowPart, Unit); @@ -1286,8 +1418,7 @@ PrintPartitionData( } Attribute = (List->CurrentDisk == DiskEntry && - List->CurrentPartition == PartEntry && - List->CurrentPartitionNumber == PartNumber) ? + List->CurrentPartition == PartEntry) ? FOREGROUND_BLUE | BACKGROUND_WHITE : FOREGROUND_WHITE | BACKGROUND_BLUE; @@ -1339,7 +1470,6 @@ PrintDiskData( USHORT Height; ULARGE_INTEGER DiskSize; PCHAR Unit; - ULONG i; Width = List->Right - List->Left - 1; Height = List->Bottom - List->Top - 2; @@ -1347,16 +1477,15 @@ PrintDiskData( coPos.X = List->Left + 1; coPos.Y = List->Top + 1 + List->Line; -#if 0 - if (DiskEntry->DiskSize >= 0x280000000ULL) /* 10 GB */ + DiskSize.QuadPart = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; + if (DiskSize.QuadPart >= 10737418240) /* 10 GB */ { - DiskSize.QuadPart = (DiskEntry->DiskSize + (1 << 29)) >> 30; + DiskSize.QuadPart = RoundingDivide(DiskSize.QuadPart, 1073741824); Unit = MUIGetString(STRING_GB); } else -#endif { - DiskSize.QuadPart = (DiskEntry->DiskSize + (1 << 19)) >> 20; + DiskSize.QuadPart = RoundingDivide(DiskSize.QuadPart, 1048576); if (DiskSize.QuadPart == 0) DiskSize.QuadPart = 1; Unit = MUIGetString(STRING_MB); @@ -1417,32 +1546,14 @@ PrintDiskData( PrintEmptyLine(List); /* Print partition lines*/ - Entry = DiskEntry->PartListHead.Flink; - while (Entry != &DiskEntry->PartListHead) + Entry = DiskEntry->PrimaryPartListHead.Flink; + while (Entry != &DiskEntry->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); - /* Print disk entry */ - for (i = 0; i < 4; i++) - { - if (PartEntry->PartInfo[i].PartitionType != PARTITION_ENTRY_UNUSED || - PartEntry->PartInfo[i].PartitionLength.QuadPart != 0ULL) - { - PrintPartitionData(List, - DiskEntry, - PartEntry, - i); - } - } - - /* Print unpartitioned entry */ - if (PartEntry->Unpartitioned) - { - PrintPartitionData(List, - DiskEntry, - PartEntry, - 0); - } + PrintPartitionData(List, + DiskEntry, + PartEntry); Entry = Entry->Flink; } @@ -1484,8 +1595,8 @@ DrawPartitionList( CurrentPartLine += 2; } - Entry2 = DiskEntry->PartListHead.Flink; - while (Entry2 != &DiskEntry->PartListHead) + Entry2 = DiskEntry->PrimaryPartListHead.Flink; + while (Entry2 != &DiskEntry->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); if (PartEntry == List->CurrentPartition) @@ -1685,7 +1796,6 @@ SelectPartition( PPARTENTRY PartEntry; PLIST_ENTRY Entry1; PLIST_ENTRY Entry2; - UCHAR i; /* Check for empty disks */ if (IsListEmpty(&List->DiskListHead)) @@ -1699,21 +1809,17 @@ SelectPartition( if (DiskEntry->DiskNumber == DiskNumber) { - Entry2 = DiskEntry->PartListHead.Flink; - while (Entry2 != &DiskEntry->PartListHead) + Entry2 = DiskEntry->PrimaryPartListHead.Flink; + while (Entry2 != &DiskEntry->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); - for (i = 0; i < 4; i++) + if (PartEntry->PartitionNumber == PartitionNumber) { - if (PartEntry->PartInfo[i].PartitionNumber == PartitionNumber) - { - List->CurrentDisk = DiskEntry; - List->CurrentPartition = PartEntry; - List->CurrentPartitionNumber = i; - DrawPartitionList(List); - return TRUE; - } + List->CurrentDisk = DiskEntry; + List->CurrentPartition = PartEntry; + DrawPartitionList(List); + return TRUE; } Entry2 = Entry2->Flink; @@ -1733,11 +1839,10 @@ VOID ScrollDownPartitionList( PPARTLIST List) { - PDISKENTRY DiskEntry; +// PDISKENTRY DiskEntry; PPARTENTRY PartEntry; - PLIST_ENTRY Entry1; +// PLIST_ENTRY Entry1; PLIST_ENTRY Entry2; - UCHAR i; /* Check for empty disks */ if (IsListEmpty(&List->DiskListHead)) @@ -1746,46 +1851,18 @@ ScrollDownPartitionList( /* Check for next usable entry on current disk */ if (List->CurrentPartition != NULL) { - Entry2 = &List->CurrentPartition->ListEntry; - PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); - - /* Check if we can move inside primary partitions */ - for (i = List->CurrentPartitionNumber + 1; i < 4; i++) - { - if (PartEntry->PartInfo[i].PartitionType != PARTITION_ENTRY_UNUSED) - break; - } - - if (i == 4) - { - /* We're out of partitions in the current partition table. - Try to move to the next one if possible. */ - Entry2 = Entry2->Flink; - } - else - { - /* Just advance to the next partition */ - List->CurrentPartitionNumber = i; - DrawPartitionList(List); - return; - } - - while (Entry2 != &List->CurrentDisk->PartListHead) + Entry2 = List->CurrentPartition->ListEntry.Flink; + if (Entry2 != &List->CurrentDisk->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); -// if (PartEntry->HidePartEntry == FALSE) - { - List->CurrentPartition = PartEntry; - List->CurrentPartitionNumber = 0; - DrawPartitionList(List); - return; - } - - Entry2 = Entry2->Flink; + List->CurrentPartition = PartEntry; + DrawPartitionList(List); + return; } } +#if 0 /* Check for first usable entry on next disk */ if (List->CurrentDisk != NULL) { @@ -1795,25 +1872,20 @@ ScrollDownPartitionList( DiskEntry = CONTAINING_RECORD(Entry1, DISKENTRY, ListEntry); Entry2 = DiskEntry->PartListHead.Flink; - while (Entry2 != &DiskEntry->PartListHead) + if (Entry2 != &DiskEntry->PartListHead) { PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); -// if (PartEntry->HidePartEntry == FALSE) - { - List->CurrentDisk = DiskEntry; - List->CurrentPartition = PartEntry; - List->CurrentPartitionNumber = 0; - DrawPartitionList(List); - return; - } - - Entry2 = Entry2->Flink; + List->CurrentDisk = DiskEntry; + List->CurrentPartition = PartEntry; + DrawPartitionList(List); + return; } Entry1 = Entry1->Flink; } } +#endif } @@ -1821,11 +1893,10 @@ VOID ScrollUpPartitionList( PPARTLIST List) { - PDISKENTRY DiskEntry; +// PDISKENTRY DiskEntry; PPARTENTRY PartEntry; - PLIST_ENTRY Entry1; +// PLIST_ENTRY Entry1; PLIST_ENTRY Entry2; - UCHAR i; /* Check for empty disks */ if (IsListEmpty(&List->DiskListHead)) @@ -1834,56 +1905,20 @@ ScrollUpPartitionList( /* check for previous usable entry on current disk */ if (List->CurrentPartition != NULL) { - Entry2 = &List->CurrentPartition->ListEntry; - PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); - - /* Check if we can move inside primary partitions */ - if (List->CurrentPartitionNumber > 0) - { - /* Find a previous partition */ - for (i = List->CurrentPartitionNumber - 1; i > 0; i--) - { - if (PartEntry->PartInfo[i].PartitionType != PARTITION_ENTRY_UNUSED) - break; - } - - /* Move to it and return */ - List->CurrentPartitionNumber = i; - DrawPartitionList(List); - return; - } - - /* Move to the previous entry */ - Entry2 = Entry2->Blink; - - while (Entry2 != &List->CurrentDisk->PartListHead) + Entry2 = List->CurrentPartition->ListEntry.Blink; + if (Entry2 != &List->CurrentDisk->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); -// if (PartEntry->HidePartEntry == FALSE) - { - List->CurrentPartition = PartEntry; + List->CurrentPartition = PartEntry; - /* Find last existing partition in the table */ - for (i = 3; i > 0; i--) - { - if (PartEntry->PartInfo[i].PartitionType != PARTITION_ENTRY_UNUSED) - break; - } - - /* Move to it */ - List->CurrentPartitionNumber = i; - - /* Draw partition list and return */ - DrawPartitionList(List); - return; - } - - Entry2 = Entry2->Blink; + /* Draw partition list and return */ + DrawPartitionList(List); + return; } } - +#if 0 /* check for last usable entry on previous disk */ if (List->CurrentDisk != NULL) { @@ -1892,93 +1927,128 @@ ScrollUpPartitionList( { DiskEntry = CONTAINING_RECORD(Entry1, DISKENTRY, ListEntry); - Entry2 = DiskEntry->PartListHead.Blink; - while (Entry2 != &DiskEntry->PartListHead) + Entry2 = DiskEntry->PrimaryPartListHead.Blink; + if (Entry2 != &DiskEntry->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); -// if (PartEntry->HidePartEntry == FALSE) - { - List->CurrentDisk = DiskEntry; - List->CurrentPartition = PartEntry; + List->CurrentDisk = DiskEntry; + List->CurrentPartition = PartEntry; - /* Find last existing partition in the table */ - for (i = 3; i > 0; i--) - { - if (PartEntry->PartInfo[i].PartitionType != PARTITION_ENTRY_UNUSED) - break; - } - - /* Move to it */ - List->CurrentPartitionNumber = i; - - /* Draw partition list and return */ - DrawPartitionList(List); - return; - } - - Entry2 = Entry2->Blink; + /* Draw partition list and return */ + DrawPartitionList(List); + return; } Entry1 = Entry1->Blink; } } +#endif } static -PPARTENTRY -GetPrevPartitionedEntry( - PDISKENTRY DiskEntry, - PPARTENTRY CurrentEntry) +BOOLEAN +IsEmptyLayoutEntry( + PPARTITION_INFORMATION PartitionInfo) { - PPARTENTRY PrevEntry; - PLIST_ENTRY Entry; + if (PartitionInfo->StartingOffset.QuadPart == 0 && + PartitionInfo->PartitionLength.QuadPart == 0) +// PartitionInfo->PartitionType == 0) + return TRUE; - if (CurrentEntry->ListEntry.Blink == &DiskEntry->PartListHead) - return NULL; - - Entry = CurrentEntry->ListEntry.Blink; - while (Entry != &DiskEntry->PartListHead) - { - PrevEntry = CONTAINING_RECORD(Entry, - PARTENTRY, - ListEntry); - if (PrevEntry->Unpartitioned == FALSE) - return PrevEntry; - - Entry = Entry->Blink; - } - - return NULL; + return FALSE; } static -PPARTENTRY -GetNextPartitionedEntry( - PDISKENTRY DiskEntry, - PPARTENTRY CurrentEntry) +BOOLEAN +IsSamePrimaryLayoutEntry( + IN PPARTITION_INFORMATION PartitionInfo, + IN PDISKENTRY DiskEntry, + IN PPARTENTRY PartEntry) { - PPARTENTRY NextEntry; - PLIST_ENTRY Entry; + if (PartitionInfo->StartingOffset.QuadPart == PartEntry->StartSector.QuadPart * DiskEntry->BytesPerSector && + PartitionInfo->PartitionLength.QuadPart == PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector) +// PartitionInfo->PartitionNumber = PartEntry->PartitionNumber && +// PartitionInfo->PartitionType == PartEntry->PartitionType + return TRUE; - if (CurrentEntry->ListEntry.Flink == &DiskEntry->PartListHead) - return NULL; + return FALSE; +} - Entry = CurrentEntry->ListEntry.Flink; - while (Entry != &DiskEntry->PartListHead) + +static +VOID +UpdateDiskLayout( + IN PDISKENTRY DiskEntry) +{ + PPARTITION_INFORMATION PartitionInfo; + PLIST_ENTRY ListEntry; + PPARTENTRY PartEntry; + ULONG Index = 0; + ULONG PartitionNumber = 1; + +DPRINT1("UpdateDiskLayout()\n"); + + ListEntry = DiskEntry->PrimaryPartListHead.Flink; + while (ListEntry != &DiskEntry->PrimaryPartListHead) { - NextEntry = CONTAINING_RECORD(Entry, - PARTENTRY, - ListEntry); - if (NextEntry->Unpartitioned == FALSE) - return NextEntry; + PartEntry = CONTAINING_RECORD(ListEntry, PARTENTRY, ListEntry); - Entry = Entry->Flink; + if (PartEntry->IsPartitioned == TRUE) + { + PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[Index]; + + if (!IsSamePrimaryLayoutEntry(PartitionInfo, DiskEntry, PartEntry)) + { +DPRINT1("Updating partition entry %lu\n", Index); + PartitionInfo->StartingOffset.QuadPart = PartEntry->StartSector.QuadPart * DiskEntry->BytesPerSector; + PartitionInfo->PartitionLength.QuadPart = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; + PartitionInfo->HiddenSectors = 0; + PartitionInfo->PartitionNumber = (!IsContainerPartition(PartEntry->PartitionType)) ? PartitionNumber : 0; + PartitionInfo->PartitionType = PartEntry->PartitionType; + PartitionInfo->BootIndicator = PartEntry->BootIndicator; + PartitionInfo->RecognizedPartition = FALSE; + PartitionInfo->RewritePartition = TRUE; + + PartEntry->PartitionNumber = PartitionNumber; + PartEntry->PartitionIndex = Index; + + PartitionNumber++; + } + else if (!IsEmptyLayoutEntry(PartitionInfo)) + { + PartitionNumber++; + } + + Index++; + } + + ListEntry = ListEntry->Flink; } - return NULL; + for (;Index < 4; Index++) + { + PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[Index]; + + if (!IsEmptyLayoutEntry(PartitionInfo)) + { +DPRINT1("Wiping partition entry %lu\n", Index); + PartitionInfo->StartingOffset.QuadPart = 0; + PartitionInfo->PartitionLength.QuadPart = 0; + PartitionInfo->HiddenSectors = 0; + PartitionInfo->PartitionNumber = 0; + PartitionInfo->PartitionType = 0; + PartitionInfo->BootIndicator = FALSE; + PartitionInfo->RecognizedPartition = FALSE; + PartitionInfo->RewritePartition = TRUE; + } + } + +#ifdef DUMP_PARTITION_TABLE + DumpPartitionTable(DiskEntry); +#endif } @@ -1990,12 +2060,12 @@ GetPrevUnpartitionedEntry( { PPARTENTRY PrevPartEntry; - if (PartEntry->ListEntry.Blink != &DiskEntry->PartListHead) + if (PartEntry->ListEntry.Blink != &DiskEntry->PrimaryPartListHead) { PrevPartEntry = CONTAINING_RECORD(PartEntry->ListEntry.Blink, PARTENTRY, ListEntry); - if (PrevPartEntry->Unpartitioned == TRUE) + if (PrevPartEntry->IsPartitioned == FALSE) return PrevPartEntry; } @@ -2011,12 +2081,12 @@ GetNextUnpartitionedEntry( { PPARTENTRY NextPartEntry; - if (PartEntry->ListEntry.Flink != &DiskEntry->PartListHead) + if (PartEntry->ListEntry.Flink != &DiskEntry->PrimaryPartListHead) { NextPartEntry = CONTAINING_RECORD(PartEntry->ListEntry.Flink, PARTENTRY, ListEntry); - if (NextPartEntry->Unpartitioned == TRUE) + if (NextPartEntry->IsPartitioned == FALSE) return NextPartEntry; } @@ -2027,19 +2097,19 @@ GetNextUnpartitionedEntry( VOID CreateNewPartition( PPARTLIST List, - ULONGLONG PartitionSize, + ULONGLONG SectorCount, BOOLEAN AutoCreate) { PDISKENTRY DiskEntry; PPARTENTRY PartEntry; - PPARTENTRY PrevPartEntry; - PPARTENTRY NextPartEntry; PPARTENTRY NewPartEntry; + DPRINT1("CreateNewPartition(%I64u)\n", SectorCount); + if (List == NULL || List->CurrentDisk == NULL || List->CurrentPartition == NULL || - List->CurrentPartition->Unpartitioned == FALSE) + List->CurrentPartition->IsPartitioned == TRUE) { return; } @@ -2047,227 +2117,66 @@ CreateNewPartition( DiskEntry = List->CurrentDisk; PartEntry = List->CurrentPartition; +DPRINT1("Current partition sector count: %I64u\n", PartEntry->SectorCount.QuadPart); + if (AutoCreate == TRUE || - PartitionSize == PartEntry->UnpartitionedLength) + Align(PartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - PartEntry->StartSector.QuadPart == PartEntry->SectorCount.QuadPart) { +DPRINT1("Convert existing partition entry\n"); /* Convert current entry to 'new (unformatted)' */ + PartEntry->IsPartitioned = TRUE; + PartEntry->PartitionType = PARTITION_ENTRY_UNUSED; PartEntry->FormatState = Unformatted; - PartEntry->PartInfo[0].StartingOffset.QuadPart = - PartEntry->UnpartitionedOffset + DiskEntry->TrackSize; - PartEntry->PartInfo[0].HiddenSectors = - (ULONG)(PartEntry->PartInfo[0].StartingOffset.QuadPart / DiskEntry->BytesPerSector); - PartEntry->PartInfo[0].PartitionLength.QuadPart = - PartEntry->UnpartitionedLength - DiskEntry->TrackSize; - PartEntry->PartInfo[0].PartitionType = PARTITION_ENTRY_UNUSED; - PartEntry->PartInfo[0].BootIndicator = FALSE; /* FIXME */ - PartEntry->PartInfo[0].RewritePartition = TRUE; - PartEntry->PartInfo[1].RewritePartition = TRUE; - PartEntry->PartInfo[2].RewritePartition = TRUE; - PartEntry->PartInfo[3].RewritePartition = TRUE; - - /* Get previous and next partition entries */ - PrevPartEntry = GetPrevPartitionedEntry(DiskEntry, - PartEntry); - NextPartEntry = GetNextPartitionedEntry(DiskEntry, - PartEntry); - - if (PrevPartEntry != NULL && NextPartEntry != NULL) - { - /* Current entry is in the middle of the list */ - - /* Copy previous container partition data to current entry */ - RtlCopyMemory(&PartEntry->PartInfo[1], - &PrevPartEntry->PartInfo[1], - sizeof(PARTITION_INFORMATION)); - PartEntry->PartInfo[1].RewritePartition = TRUE; - - /* Update previous container partition data */ - - PrevPartEntry->PartInfo[1].StartingOffset.QuadPart = - PartEntry->PartInfo[0].StartingOffset.QuadPart - DiskEntry->TrackSize; - PrevPartEntry->PartInfo[1].HiddenSectors = - (ULONG)(PrevPartEntry->PartInfo[1].StartingOffset.QuadPart / DiskEntry->BytesPerSector); - - if (DiskEntry->PartListHead.Flink == &PrevPartEntry->ListEntry) - { - /* Special case - previous partition is first partition */ - PrevPartEntry->PartInfo[1].PartitionLength.QuadPart = - DiskEntry->DiskSize - PrevPartEntry->PartInfo[1].StartingOffset.QuadPart; - } - else - { - PrevPartEntry->PartInfo[1].PartitionLength.QuadPart = - PartEntry->PartInfo[0].PartitionLength.QuadPart + DiskEntry->TrackSize; - } - - PrevPartEntry->PartInfo[1].RewritePartition = TRUE; - } - else if (PrevPartEntry == NULL && NextPartEntry != NULL) - { - /* Current entry is the first entry */ - return; - } - else if (PrevPartEntry != NULL && NextPartEntry == NULL) - { - /* Current entry is the last entry */ - - PrevPartEntry->PartInfo[1].StartingOffset.QuadPart = - PartEntry->PartInfo[0].StartingOffset.QuadPart - DiskEntry->TrackSize; - PrevPartEntry->PartInfo[1].HiddenSectors = - (ULONG)(PrevPartEntry->PartInfo[1].StartingOffset.QuadPart / DiskEntry->BytesPerSector); - - if (DiskEntry->PartListHead.Flink == &PrevPartEntry->ListEntry) - { - /* Special case - previous partition is first partition */ - PrevPartEntry->PartInfo[1].PartitionLength.QuadPart = - DiskEntry->DiskSize - PrevPartEntry->PartInfo[1].StartingOffset.QuadPart; - } - else - { - PrevPartEntry->PartInfo[1].PartitionLength.QuadPart = - PartEntry->PartInfo[0].PartitionLength.QuadPart + DiskEntry->TrackSize; - } - - if ((PartEntry->PartInfo[1].StartingOffset.QuadPart + - PartEntry->PartInfo[1].PartitionLength.QuadPart) < - (1024LL * 255LL * 63LL * 512LL)) - { - PrevPartEntry->PartInfo[1].PartitionType = PARTITION_EXTENDED; - } - else - { - PrevPartEntry->PartInfo[1].PartitionType = PARTITION_XINT13_EXTENDED; - } - - PrevPartEntry->PartInfo[1].BootIndicator = FALSE; - PrevPartEntry->PartInfo[1].RewritePartition = TRUE; - } - PartEntry->AutoCreate = AutoCreate; PartEntry->New = TRUE; - PartEntry->Unpartitioned = FALSE; - PartEntry->UnpartitionedOffset = 0ULL; - PartEntry->UnpartitionedLength = 0ULL; + PartEntry->BootIndicator = FALSE; /* FIXME */ + +DPRINT1("First Sector: %I64u\n", PartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", PartEntry->StartSector.QuadPart + PartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", PartEntry->SectorCount.QuadPart); } else { - /* Insert an initialize a new partition entry */ - NewPartEntry = (PPARTENTRY)RtlAllocateHeap(ProcessHeap, - 0, - sizeof(PARTENTRY)); +DPRINT1("Add new partition entry\n"); + + /* Insert and initialize a new partition entry */ + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); if (NewPartEntry == NULL) return; - RtlZeroMemory(NewPartEntry, - sizeof(PARTENTRY)); - /* Insert the new entry into the list */ InsertTailList(&PartEntry->ListEntry, &NewPartEntry->ListEntry); + NewPartEntry->DiskEntry = DiskEntry; + + NewPartEntry->IsPartitioned = TRUE; + NewPartEntry->StartSector.QuadPart = PartEntry->StartSector.QuadPart; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; + NewPartEntry->PartitionType = PARTITION_ENTRY_UNUSED; + +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + NewPartEntry->New = TRUE; - NewPartEntry->FormatState = Unformatted; - NewPartEntry->PartInfo[0].StartingOffset.QuadPart = - PartEntry->UnpartitionedOffset + DiskEntry->TrackSize; - NewPartEntry->PartInfo[0].HiddenSectors = - (ULONG)(NewPartEntry->PartInfo[0].StartingOffset.QuadPart / DiskEntry->BytesPerSector); - NewPartEntry->PartInfo[0].PartitionLength.QuadPart = - PartitionSize - DiskEntry->TrackSize; - NewPartEntry->PartInfo[0].PartitionType = PARTITION_ENTRY_UNUSED; - NewPartEntry->PartInfo[0].BootIndicator = FALSE; /* FIXME */ - NewPartEntry->PartInfo[0].RewritePartition = TRUE; - NewPartEntry->PartInfo[1].RewritePartition = TRUE; - NewPartEntry->PartInfo[2].RewritePartition = TRUE; - NewPartEntry->PartInfo[3].RewritePartition = TRUE; + NewPartEntry->BootIndicator = FALSE; /* FIXME */ - /* Get previous and next partition entries */ - PrevPartEntry = GetPrevPartitionedEntry(DiskEntry, - NewPartEntry); - NextPartEntry = GetNextPartitionedEntry(DiskEntry, - NewPartEntry); - - if (PrevPartEntry != NULL && NextPartEntry != NULL) - { - /* Current entry is in the middle of the list */ - - /* Copy previous container partition data to current entry */ - RtlCopyMemory(&NewPartEntry->PartInfo[1], - &PrevPartEntry->PartInfo[1], - sizeof(PARTITION_INFORMATION)); - NewPartEntry->PartInfo[1].RewritePartition = TRUE; - - /* Update previous container partition data */ - PrevPartEntry->PartInfo[1].StartingOffset.QuadPart = - NewPartEntry->PartInfo[0].StartingOffset.QuadPart - DiskEntry->TrackSize; - PrevPartEntry->PartInfo[1].HiddenSectors = - (ULONG)(PrevPartEntry->PartInfo[1].StartingOffset.QuadPart / DiskEntry->BytesPerSector); - - if (DiskEntry->PartListHead.Flink == &PrevPartEntry->ListEntry) - { - /* Special case - previous partition is first partition */ - PrevPartEntry->PartInfo[1].PartitionLength.QuadPart = - DiskEntry->DiskSize - PrevPartEntry->PartInfo[1].StartingOffset.QuadPart; - } - else - { - PrevPartEntry->PartInfo[1].PartitionLength.QuadPart = - NewPartEntry->PartInfo[0].PartitionLength.QuadPart + DiskEntry->TrackSize; - } - - PrevPartEntry->PartInfo[1].RewritePartition = TRUE; - } - else if (PrevPartEntry == NULL && NextPartEntry != NULL) - { - /* Current entry is the first entry */ - return; - } - else if (PrevPartEntry != NULL && NextPartEntry == NULL) - { - /* Current entry is the last entry */ - - PrevPartEntry->PartInfo[1].StartingOffset.QuadPart = - NewPartEntry->PartInfo[0].StartingOffset.QuadPart - DiskEntry->TrackSize; - PrevPartEntry->PartInfo[1].HiddenSectors = - (ULONG)(PrevPartEntry->PartInfo[1].StartingOffset.QuadPart / DiskEntry->BytesPerSector); - - if (DiskEntry->PartListHead.Flink == &PrevPartEntry->ListEntry) - { - /* Special case - previous partition is first partition */ - PrevPartEntry->PartInfo[1].PartitionLength.QuadPart = - DiskEntry->DiskSize - PrevPartEntry->PartInfo[1].StartingOffset.QuadPart; - } - else - { - PrevPartEntry->PartInfo[1].PartitionLength.QuadPart = - NewPartEntry->PartInfo[0].PartitionLength.QuadPart + DiskEntry->TrackSize; - } - - if ((PartEntry->PartInfo[1].StartingOffset.QuadPart + - PartEntry->PartInfo[1].PartitionLength.QuadPart) < - (1024LL * 255LL * 63LL * 512LL)) - { - PrevPartEntry->PartInfo[1].PartitionType = PARTITION_EXTENDED; - } - else - { - PrevPartEntry->PartInfo[1].PartitionType = PARTITION_XINT13_EXTENDED; - } - - PrevPartEntry->PartInfo[1].BootIndicator = FALSE; - PrevPartEntry->PartInfo[1].RewritePartition = TRUE; - } - - /* Update offset and size of the remaining unpartitioned disk space */ - PartEntry->UnpartitionedOffset += PartitionSize; - PartEntry->UnpartitionedLength -= PartitionSize; + PartEntry->StartSector.QuadPart = NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart; + PartEntry->SectorCount.QuadPart -= (PartEntry->StartSector.QuadPart - NewPartEntry->StartSector.QuadPart); } - DiskEntry->Modified = TRUE; + UpdateDiskLayout(DiskEntry); + + DiskEntry->Dirty = TRUE; UpdatePartitionNumbers(DiskEntry); - AssignDriverLetters(List); + AssignDriveLetters(List); } @@ -2283,7 +2192,7 @@ DeleteCurrentPartition( if (List == NULL || List->CurrentDisk == NULL || List->CurrentPartition == NULL || - List->CurrentPartition->Unpartitioned == TRUE) + List->CurrentPartition->IsPartitioned == FALSE) { return; } @@ -2291,48 +2200,6 @@ DeleteCurrentPartition( DiskEntry = List->CurrentDisk; PartEntry = List->CurrentPartition; - /* Adjust container partition entries */ - - /* Get previous and next partition entries */ - PrevPartEntry = GetPrevPartitionedEntry(DiskEntry, - PartEntry); - NextPartEntry = GetNextPartitionedEntry(DiskEntry, - PartEntry); - - if (PrevPartEntry != NULL && NextPartEntry != NULL) - { - /* Current entry is in the middle of the list */ - - /* - * The first extended partition can not be deleted - * as long as other extended partitions are present. - */ - if (PrevPartEntry->ListEntry.Blink == &DiskEntry->PartListHead) - return; - - /* Copy previous container partition data to current entry */ - RtlCopyMemory(&PrevPartEntry->PartInfo[1], - &PartEntry->PartInfo[1], - sizeof(PARTITION_INFORMATION)); - PrevPartEntry->PartInfo[1].RewritePartition = TRUE; - } - else if (PrevPartEntry == NULL && NextPartEntry != NULL) - { - /* - * A primary partition can not be deleted as long as - * extended partitions are present. - */ - return; - } - else if (PrevPartEntry != NULL && NextPartEntry == NULL) - { - /* Current entry is the last entry */ - RtlZeroMemory(&PrevPartEntry->PartInfo[1], - sizeof(PARTITION_INFORMATION)); - PrevPartEntry->PartInfo[1].RewritePartition = TRUE; - } - - /* Adjust unpartitioned disk space entries */ /* Get pointer to previous and next unpartitioned entries */ @@ -2347,21 +2214,15 @@ DeleteCurrentPartition( /* Merge previous, current and next unpartitioned entry */ /* Adjust the previous entries length */ - PrevPartEntry->UnpartitionedLength += - (PartEntry->PartInfo[0].PartitionLength.QuadPart + DiskEntry->TrackSize + - NextPartEntry->UnpartitionedLength); + PrevPartEntry->SectorCount.QuadPart += (PartEntry->SectorCount.QuadPart + NextPartEntry->SectorCount.QuadPart); /* Remove the current entry */ RemoveEntryList(&PartEntry->ListEntry); - RtlFreeHeap(ProcessHeap, - 0, - PartEntry); + RtlFreeHeap(ProcessHeap, 0, PartEntry); /* Remove the next entry */ RemoveEntryList (&NextPartEntry->ListEntry); - RtlFreeHeap(ProcessHeap, - 0, - NextPartEntry); + RtlFreeHeap(ProcessHeap, 0, NextPartEntry); /* Update current partition */ List->CurrentPartition = PrevPartEntry; @@ -2371,14 +2232,11 @@ DeleteCurrentPartition( /* Merge current and previous unpartitioned entry */ /* Adjust the previous entries length */ - PrevPartEntry->UnpartitionedLength += - (PartEntry->PartInfo[0].PartitionLength.QuadPart + DiskEntry->TrackSize); + PrevPartEntry->SectorCount.QuadPart += PartEntry->SectorCount.QuadPart; /* Remove the current entry */ RemoveEntryList(&PartEntry->ListEntry); - RtlFreeHeap(ProcessHeap, - 0, - PartEntry); + RtlFreeHeap(ProcessHeap, 0, PartEntry); /* Update current partition */ List->CurrentPartition = PrevPartEntry; @@ -2388,16 +2246,12 @@ DeleteCurrentPartition( /* Merge current and next unpartitioned entry */ /* Adjust the next entries offset and length */ - NextPartEntry->UnpartitionedOffset = - PartEntry->PartInfo[0].StartingOffset.QuadPart - DiskEntry->TrackSize; - NextPartEntry->UnpartitionedLength += - (PartEntry->PartInfo[0].PartitionLength.QuadPart + DiskEntry->TrackSize); + NextPartEntry->StartSector.QuadPart = PartEntry->StartSector.QuadPart; + NextPartEntry->SectorCount.QuadPart += PartEntry->SectorCount.QuadPart; /* Remove the current entry */ RemoveEntryList(&PartEntry->ListEntry); - RtlFreeHeap(ProcessHeap, - 0, - PartEntry); + RtlFreeHeap(ProcessHeap, 0, PartEntry); /* Update current partition */ List->CurrentPartition = NextPartEntry; @@ -2405,23 +2259,18 @@ DeleteCurrentPartition( else { /* Nothing to merge but change current entry */ - PartEntry->New = FALSE; - PartEntry->Unpartitioned = TRUE; - PartEntry->UnpartitionedOffset = - PartEntry->PartInfo[0].StartingOffset.QuadPart - DiskEntry->TrackSize; - PartEntry->UnpartitionedLength = - PartEntry->PartInfo[0].PartitionLength.QuadPart + DiskEntry->TrackSize; - - /* Wipe the partition table */ - RtlZeroMemory(&PartEntry->PartInfo, - sizeof(PartEntry->PartInfo)); + PartEntry->IsPartitioned = FALSE; + PartEntry->FormatState = Unformatted; + PartEntry->DriveLetter = 0; } - DiskEntry->Modified = TRUE; + UpdateDiskLayout(DiskEntry); + + DiskEntry->Dirty = TRUE; UpdatePartitionNumbers(DiskEntry); - AssignDriverLetters(List); + AssignDriveLetters(List); } @@ -2432,14 +2281,12 @@ CheckActiveBootPartition( PDISKENTRY DiskEntry; PPARTENTRY PartEntry; PLIST_ENTRY ListEntry; - UCHAR i; /* Check for empty disk list */ if (IsListEmpty (&List->DiskListHead)) { List->ActiveBootDisk = NULL; List->ActiveBootPartition = NULL; - List->ActiveBootPartitionNumber = 0; return; } @@ -2456,33 +2303,29 @@ CheckActiveBootPartition( DiskEntry = List->CurrentDisk; /* Check for empty partition list */ - if (IsListEmpty (&DiskEntry->PartListHead)) + if (IsListEmpty (&DiskEntry->PrimaryPartListHead)) { List->ActiveBootDisk = NULL; List->ActiveBootPartition = NULL; - List->ActiveBootPartitionNumber = 0; return; } - PartEntry = CONTAINING_RECORD(DiskEntry->PartListHead.Flink, + PartEntry = CONTAINING_RECORD(DiskEntry->PrimaryPartListHead.Flink, PARTENTRY, ListEntry); /* Set active boot partition */ if ((DiskEntry->NewDisk == TRUE) || - (PartEntry->PartInfo[0].BootIndicator == FALSE && - PartEntry->PartInfo[1].BootIndicator == FALSE && - PartEntry->PartInfo[2].BootIndicator == FALSE && - PartEntry->PartInfo[3].BootIndicator == FALSE)) + (PartEntry->BootIndicator == FALSE)) { - PartEntry->PartInfo[0].BootIndicator = TRUE; - PartEntry->PartInfo[0].RewritePartition = TRUE; - DiskEntry->Modified = TRUE; + PartEntry->BootIndicator = TRUE; + DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].BootIndicator = TRUE; + DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].RewritePartition = TRUE; + DiskEntry->Dirty = TRUE; /* FIXME: Might be incorrect if partitions were created by Linux FDISK */ List->ActiveBootDisk = DiskEntry; List->ActiveBootPartition = PartEntry; - List->ActiveBootPartitionNumber = 0; return; } @@ -2490,34 +2333,27 @@ CheckActiveBootPartition( /* Disk is not new, scan all partitions to find a bootable one */ List->ActiveBootDisk = NULL; List->ActiveBootPartition = NULL; - List->ActiveBootPartitionNumber = 0; - ListEntry = DiskEntry->PartListHead.Flink; - while (ListEntry != &DiskEntry->PartListHead) + ListEntry = DiskEntry->PrimaryPartListHead.Flink; + while (ListEntry != &DiskEntry->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(ListEntry, PARTENTRY, ListEntry); - /* Check if it's partitioned */ - if (!PartEntry->Unpartitioned) + /* Check if it is partitioned */ + if (PartEntry->IsPartitioned) { - /* Go through all of its 4 partitions */ - for (i = 0; i < 4; i++) + if (PartEntry->PartitionType != PARTITION_ENTRY_UNUSED && + PartEntry->BootIndicator) { - if (PartEntry->PartInfo[i].PartitionType != PARTITION_ENTRY_UNUSED && - PartEntry->PartInfo[i].BootIndicator) - { - /* Yes, we found it */ - List->ActiveBootDisk = DiskEntry; - List->ActiveBootPartition = PartEntry; - List->ActiveBootPartitionNumber = i; + /* Yes, we found it */ + List->ActiveBootDisk = DiskEntry; + List->ActiveBootPartition = PartEntry; - DPRINT("Found bootable partition disk %d, drive letter %c\n", - DiskEntry->DiskNumber, PartEntry->DriveLetter[i]); - - break; - } + DPRINT("Found bootable partition disk %d, drive letter %c\n", + DiskEntry->DiskNumber, PartEntry->DriveLetter); + break; } } @@ -2531,6 +2367,7 @@ BOOLEAN CheckForLinuxFdiskPartitions( PPARTLIST List) { +#if 0 PDISKENTRY DiskEntry; PPARTENTRY PartEntry; PLIST_ENTRY Entry1; @@ -2576,217 +2413,100 @@ CheckForLinuxFdiskPartitions( Entry1 = Entry1->Flink; } +#endif return FALSE; } +static +NTSTATUS +WritePartitons( + IN PPARTLIST List, + IN PDISKENTRY DiskEntry) +{ + WCHAR DstPath[MAX_PATH]; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK Iosb; + UNICODE_STRING Name; + ULONG BufferSize; + HANDLE FileHandle = NULL; + NTSTATUS Status; + + DPRINT("WritePartitions() Disk: %lu\n", DiskEntry->DiskNumber); + + swprintf(DstPath, + L"\\Device\\Harddisk%d\\Partition0", + DiskEntry->DiskNumber); + RtlInitUnicodeString(&Name, + DstPath); + InitializeObjectAttributes(&ObjectAttributes, + &Name, + 0, + NULL, + NULL); + + Status = NtOpenFile(&FileHandle, + GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, + &ObjectAttributes, + &Iosb, + 0, + FILE_SYNCHRONOUS_IO_NONALERT); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenFile() failed (Status %lx)\n", Status); + return Status; + } + +#ifdef DUMP_PARTITION_TABLE + DumpPartitionTable(DiskEntry); +#endif + + BufferSize = sizeof(DRIVE_LAYOUT_INFORMATION) + + ((DiskEntry->LayoutBuffer->PartitionCount - 1) * sizeof(PARTITION_INFORMATION)); + Status = NtDeviceIoControlFile(FileHandle, + NULL, + NULL, + NULL, + &Iosb, + IOCTL_DISK_SET_DRIVE_LAYOUT, + DiskEntry->LayoutBuffer, + BufferSize, + NULL, + 0); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IOCTL_DISK_SET_DRIVE_LAYOUT failed (Status 0x%08lx)\n", Status); + } + + if (FileHandle != NULL) + NtClose(FileHandle); + + return Status; +} + + BOOLEAN WritePartitionsToDisk( PPARTLIST List) { - PDRIVE_LAYOUT_INFORMATION DriveLayout; - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK Iosb; - WCHAR DstPath[MAX_PATH]; - UNICODE_STRING Name; - HANDLE FileHandle; - PDISKENTRY DiskEntry1; - PDISKENTRY DiskEntry2; - PPARTENTRY PartEntry; - PLIST_ENTRY Entry1; - PLIST_ENTRY Entry2; - ULONG PartitionCount; - ULONG DriveLayoutSize; - ULONG Index; - NTSTATUS Status; + PLIST_ENTRY Entry; + PDISKENTRY DiskEntry; if (List == NULL) - { return TRUE; - } - Entry1 = List->DiskListHead.Flink; - while (Entry1 != &List->DiskListHead) + Entry = List->DiskListHead.Flink; + while (Entry != &List->DiskListHead) { - DiskEntry1 = CONTAINING_RECORD(Entry1, - DISKENTRY, - ListEntry); + DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry); - if (DiskEntry1->Modified == TRUE) + if (DiskEntry->Dirty == TRUE) { - /* Count partitioned entries */ - PartitionCount = 0; - - Entry2 = DiskEntry1->PartListHead.Flink; - while (Entry2 != &DiskEntry1->PartListHead) - { - PartEntry = CONTAINING_RECORD(Entry2, - PARTENTRY, - ListEntry); - if (PartEntry->Unpartitioned == FALSE) - { - PartitionCount += 4; - } - - Entry2 = Entry2->Flink; - } - - if (PartitionCount == 0) - { - DriveLayoutSize = sizeof (DRIVE_LAYOUT_INFORMATION) + - ((4 - 1) * sizeof (PARTITION_INFORMATION)); - } - else - { - DriveLayoutSize = sizeof (DRIVE_LAYOUT_INFORMATION) + - ((PartitionCount - 1) * sizeof (PARTITION_INFORMATION)); - } - - DriveLayout = (PDRIVE_LAYOUT_INFORMATION)RtlAllocateHeap(ProcessHeap, - 0, - DriveLayoutSize); - if (DriveLayout == NULL) - { - DPRINT1("RtlAllocateHeap() failed\n"); - return FALSE; - } - - RtlZeroMemory(DriveLayout, - DriveLayoutSize); - - if (PartitionCount == 0) - { - /* delete all partitions in the mbr */ - DriveLayout->PartitionCount = 4; - for (Index = 0; Index < 4; Index++) - { - DriveLayout->PartitionEntry[Index].RewritePartition = TRUE; - } - } - else - { - DriveLayout->PartitionCount = PartitionCount; - Index = 0; - - Entry2 = DiskEntry1->PartListHead.Flink; - while (Entry2 != &DiskEntry1->PartListHead) - { - PartEntry = CONTAINING_RECORD(Entry2, - PARTENTRY, - ListEntry); - if (PartEntry->Unpartitioned == FALSE) - { - RtlCopyMemory(&DriveLayout->PartitionEntry[Index], - &PartEntry->PartInfo[0], - 4 * sizeof (PARTITION_INFORMATION)); - Index += 4; - } - - Entry2 = Entry2->Flink; - } - } - - if (DiskEntry1->Signature == 0) - { - LARGE_INTEGER SystemTime; - TIME_FIELDS TimeFields; - PUCHAR Buffer; - Buffer = (PUCHAR)&DiskEntry1->Signature; - - while (1) - { - NtQuerySystemTime(&SystemTime); - RtlTimeToTimeFields(&SystemTime, &TimeFields); - - Buffer[0] = (UCHAR)(TimeFields.Year & 0xFF) + (UCHAR)(TimeFields.Hour & 0xFF); - Buffer[1] = (UCHAR)(TimeFields.Year >> 8) + (UCHAR)(TimeFields.Minute & 0xFF); - Buffer[2] = (UCHAR)(TimeFields.Month & 0xFF) + (UCHAR)(TimeFields.Second & 0xFF); - Buffer[3] = (UCHAR)(TimeFields.Day & 0xFF) + (UCHAR)(TimeFields.Milliseconds & 0xFF); - - if (DiskEntry1->Signature == 0) - { - continue; - } - - /* check if the signature already exist */ - /* FIXME: - * Check also signatures from disks, which are - * not visible (bootable) by the bios. - */ - Entry2 = List->DiskListHead.Flink; - while (Entry2 != &List->DiskListHead) - { - DiskEntry2 = CONTAINING_RECORD(Entry2, DISKENTRY, ListEntry); - if (DiskEntry1 != DiskEntry2 && - DiskEntry1->Signature == DiskEntry2->Signature) - { - break; - } - - Entry2 = Entry2->Flink; - } - - if (Entry2 == &List->DiskListHead) - { - break; - } - } - - /* set one partition entry to dirty, this will update the signature */ - DriveLayout->PartitionEntry[0].RewritePartition = TRUE; - } - - DriveLayout->Signature = DiskEntry1->Signature; - - swprintf(DstPath, - L"\\Device\\Harddisk%d\\Partition0", - DiskEntry1->DiskNumber); - RtlInitUnicodeString(&Name, - DstPath); - InitializeObjectAttributes(&ObjectAttributes, - &Name, - 0, - NULL, - NULL); - - Status = NtOpenFile(&FileHandle, - FILE_ALL_ACCESS, - &ObjectAttributes, - &Iosb, - 0, - FILE_SYNCHRONOUS_IO_NONALERT); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenFile() failed (Status %lx)\n", Status); - return FALSE; - } - - Status = NtDeviceIoControlFile(FileHandle, - NULL, - NULL, - NULL, - &Iosb, - IOCTL_DISK_SET_DRIVE_LAYOUT, - DriveLayout, - DriveLayoutSize, - NULL, - 0); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtDeviceIoControlFile() failed (Status %lx)\n", Status); - NtClose(FileHandle); - return FALSE; - } - - RtlFreeHeap(ProcessHeap, - 0, - DriveLayout); - - NtClose(FileHandle); + WritePartitons(List, DiskEntry); } - Entry1 = Entry1->Flink; + Entry = Entry->Flink; } return TRUE; @@ -2800,7 +2520,7 @@ SetMountedDeviceValues( PLIST_ENTRY Entry1, Entry2; PDISKENTRY DiskEntry; PPARTENTRY PartEntry; - UCHAR i; + LARGE_INTEGER StartingOffset; if (List == NULL) { @@ -2814,22 +2534,20 @@ SetMountedDeviceValues( DISKENTRY, ListEntry); - Entry2 = DiskEntry->PartListHead.Flink; - while (Entry2 != &DiskEntry->PartListHead) + Entry2 = DiskEntry->PrimaryPartListHead.Flink; + while (Entry2 != &DiskEntry->PrimaryPartListHead) { PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); - if (!PartEntry->Unpartitioned) + if (PartEntry->IsPartitioned) { - for (i = 0; i < 4; i++) + if (PartEntry->DriveLetter) { - if (PartEntry->DriveLetter[i]) + StartingOffset.QuadPart = PartEntry->StartSector.QuadPart * DiskEntry->BytesPerSector; + if (!SetMountedDeviceValue(PartEntry->DriveLetter, + DiskEntry->LayoutBuffer->Signature, + StartingOffset)) { - if (!SetMountedDeviceValue(PartEntry->DriveLetter[i], - DiskEntry->Signature, - PartEntry->PartInfo[i].StartingOffset)) - { - return FALSE; - } + return FALSE; } } } diff --git a/reactos/base/setup/usetup/partlist.h b/reactos/base/setup/usetup/partlist.h index 81282f022fc..5cf1841602d 100644 --- a/reactos/base/setup/usetup/partlist.h +++ b/reactos/base/setup/usetup/partlist.h @@ -42,12 +42,23 @@ typedef struct _PARTENTRY { LIST_ENTRY ListEntry; - CHAR DriveLetter[4]; + struct _DISKENTRY *DiskEntry; + + ULARGE_INTEGER StartSector; + ULARGE_INTEGER SectorCount; + + BOOLEAN BootIndicator; + UCHAR PartitionType; + ULONG HiddenSectors; + ULONG PartitionNumber; + ULONG PartitionIndex; + + CHAR DriveLetter; CHAR VolumeLabel[17]; CHAR FileSystemName[9]; - /* Partition is unused disk space */ - BOOLEAN Unpartitioned; + /* Partition is partitioned disk space */ + BOOLEAN IsPartitioned; /* Partition is new. Table does not exist on disk yet */ BOOLEAN New; @@ -57,15 +68,6 @@ typedef struct _PARTENTRY FORMATSTATE FormatState; - /* - * Raw offset and length of the unpartitioned disk space. - * Includes the leading, not yet existing, partition table. - */ - ULONGLONG UnpartitionedOffset; - ULONGLONG UnpartitionedLength; - - PARTITION_INFORMATION PartInfo[4]; - } PARTENTRY, *PPARTENTRY; @@ -86,18 +88,17 @@ typedef struct _DISKENTRY LIST_ENTRY ListEntry; ULONGLONG Cylinders; - ULONGLONG TracksPerCylinder; - ULONGLONG SectorsPerTrack; - ULONGLONG BytesPerSector; + ULONG TracksPerCylinder; + ULONG SectorsPerTrack; + ULONG BytesPerSector; - ULONGLONG DiskSize; - ULONGLONG CylinderSize; - ULONGLONG TrackSize; + ULARGE_INTEGER SectorCount; + ULONG SectorAlignment; BOOLEAN BiosFound; ULONG BiosDiskNumber; - ULONG Signature; - ULONG Checksum; +// ULONG Signature; +// ULONG Checksum; ULONG DiskNumber; USHORT Port; @@ -105,14 +106,17 @@ typedef struct _DISKENTRY USHORT Id; /* Has the partition list been modified? */ - BOOLEAN Modified; + BOOLEAN Dirty; BOOLEAN NewDisk; BOOLEAN NoMbr; /* MBR is absent */ UNICODE_STRING DriverName; - LIST_ENTRY PartListHead; + PDRIVE_LAYOUT_INFORMATION LayoutBuffer; + + LIST_ENTRY PrimaryPartListHead; + LIST_ENTRY ExtendedPartListHead; } DISKENTRY, *PDISKENTRY; @@ -132,11 +136,9 @@ typedef struct _PARTLIST PDISKENTRY CurrentDisk; PPARTENTRY CurrentPartition; - UCHAR CurrentPartitionNumber; PDISKENTRY ActiveBootDisk; PPARTENTRY ActiveBootPartition; - UCHAR ActiveBootPartitionNumber; LIST_ENTRY DiskListHead; LIST_ENTRY BiosDiskListHead; From 8d02368e52d8188939939431512cc7cc7008a01e Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 18 May 2014 16:25:40 +0000 Subject: [PATCH 10/69] [NTOSKRNL] - Fix a bug in MiQueryAddressState that prevented it from returning a valid protection - Add support for PAE and x64 to MiQueryAddressState - Acquire the working set lock in MiQueryMemoryBasicInformation before MiQueryAddressState - Fix RegionSize calculation in MiQueryMemoryBasicInformation - Handle ZeroBits and Process->VmTopDown in NtAllocateVirtualMemory - Fix a bug in calculating the ending address of a virtual allocation - Gracefully handle Vad allocation failure - Free Vad allocation on failure - Write values back to usermode only in case of success svn path=/trunk/; revision=63356 --- reactos/ntoskrnl/include/internal/amd64/mm.h | 5 +- reactos/ntoskrnl/mm/ARM3/miarm.h | 1 + reactos/ntoskrnl/mm/ARM3/virtual.c | 230 +++++++++++++------ 3 files changed, 170 insertions(+), 66 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/amd64/mm.h b/reactos/ntoskrnl/include/internal/amd64/mm.h index 09049141e51..661955c4e08 100644 --- a/reactos/ntoskrnl/include/internal/amd64/mm.h +++ b/reactos/ntoskrnl/include/internal/amd64/mm.h @@ -78,6 +78,7 @@ #define MI_ZERO_PTES (32) /* FIXME - different architectures have different cache line sizes... */ #define MM_CACHE_LINE_SIZE 32 +#define MI_MAX_ZERO_BITS 53 /* Helper macros */ #define PAGE_MASK(x) ((x)&(~0xfff)) @@ -143,11 +144,13 @@ //#define TEB_BASE 0x7FFDE000 -/* On x86, these two are the same */ +/* On x64, these are the same */ #define MMPDE MMPTE #define PMMPDE PMMPTE #define MMPPE MMPTE #define PMMPPE PMMPTE +#define MMPXE MMPTE +#define PMMPXE PMMPTE #define MI_WRITE_VALID_PPE MI_WRITE_VALID_PTE #define ValidKernelPpe ValidKernelPde diff --git a/reactos/ntoskrnl/mm/ARM3/miarm.h b/reactos/ntoskrnl/mm/ARM3/miarm.h index 1a86f7e40fc..d1cfbb4a24d 100644 --- a/reactos/ntoskrnl/mm/ARM3/miarm.h +++ b/reactos/ntoskrnl/mm/ARM3/miarm.h @@ -52,6 +52,7 @@ #define MI_LOWEST_VAD_ADDRESS (PVOID)MM_LOWEST_USER_ADDRESS #define MI_DEFAULT_SYSTEM_PTE_COUNT 50000 +#define MI_MAX_ZERO_BITS 21 #endif /* !_M_AMD64 */ diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index ea2f09405a4..935fc971dda 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -57,7 +57,7 @@ MiCalculatePageCommitment(IN ULONG_PTR StartingAddress, if (Vad->u.VadFlags.MemCommit == 1) { /* This is a committed VAD, so Assume the whole range is committed */ - CommittedPages = BYTES_TO_PAGES(EndingAddress - StartingAddress); + CommittedPages = (ULONG)BYTES_TO_PAGES(EndingAddress - StartingAddress); /* Is the PDE demand-zero? */ PointerPde = MiAddressToPte(PointerPte); @@ -1309,6 +1309,12 @@ MiQueryAddressState(IN PVOID Va, PMMPTE PointerPte, ProtoPte; PMMPDE PointerPde; +#if (_MI_PAGING_LEVELS >= 3) + PMMPPE PointerPpe; +#endif +#if (_MI_PAGING_LEVELS >= 4) + PMMPXE PointerPxe; +#endif MMPTE TempPte, TempProtoPte; BOOLEAN DemandZeroPte = TRUE, ValidPte = FALSE; ULONG State = MEM_RESERVE, Protect = 0; @@ -1321,27 +1327,70 @@ MiQueryAddressState(IN PVOID Va, /* Get the PDE and PTE for the address */ PointerPde = MiAddressToPde(Va); PointerPte = MiAddressToPte(Va); +#if (_MI_PAGING_LEVELS >= 3) + PointerPpe = MiAddressToPpe(Va); +#endif +#if (_MI_PAGING_LEVELS >= 4) + PointerPxe = MiAddressToPxe(Va); +#endif /* Return the next range */ *NextVa = (PVOID)((ULONG_PTR)Va + PAGE_SIZE); - /* Is the PDE demand-zero? */ - if (PointerPde->u.Long != 0) + do { - /* It is not. Is it valid? */ +#if (_MI_PAGING_LEVELS >= 4) + /* Does the PXE exist? */ + if (PointerPxe->u.Long == 0) + { + /* It does not, next range starts at the next PXE */ + *NextVa = MiPxeToAddress(PointerPxe + 1); + break; + } + + /* Is the PXE valid? */ + if (PointerPxe->u.Hard.Valid == 0) + { + /* Is isn't, fault it in (make the PPE accessible) */ + MiMakeSystemAddressValid(PointerPpe, TargetProcess); + } +#endif +#if (_MI_PAGING_LEVELS >= 3) + /* Does the PPE exist? */ + if (PointerPpe->u.Long == 0) + { + /* It does not, next range starts at the next PPE */ + *NextVa = MiPpeToAddress(PointerPpe + 1); + break; + } + + /* Is the PPE valid? */ + if (PointerPpe->u.Hard.Valid == 0) + { + /* Is isn't, fault it in (make the PDE accessible) */ + MiMakeSystemAddressValid(PointerPde, TargetProcess); + } +#endif + + /* Does the PDE exist? */ + if (PointerPde->u.Long == 0) + { + /* It does not, next range starts at the next PDE */ + *NextVa = MiPdeToAddress(PointerPde + 1); + break; + } + + /* Is the PDE valid? */ if (PointerPde->u.Hard.Valid == 0) { - /* Is isn't, fault it in */ - PointerPte = MiPteToAddress(PointerPde); + /* Is isn't, fault it in (make the PTE accessible) */ MiMakeSystemAddressValid(PointerPte, TargetProcess); - ValidPte = TRUE; } - } - else - { - /* It is, skip it and move to the next PDE */ - *NextVa = MiPdeToAddress(PointerPde + 1); - } + + /* We have a PTE that we can access now! */ + ValidPte = TRUE; + + } while (FALSE); /* Is it safe to try reading the PTE? */ if (ValidPte) @@ -1708,6 +1757,9 @@ MiQueryMemoryBasicInformation(IN HANDLE ProcessHandle, MemoryInfo.AllocationProtect = MmProtectToValue[Vad->u.VadFlags.Protection]; MemoryInfo.Type = MEM_PRIVATE; + /* Acquire the working set lock (shared is enough) */ + MiLockProcessWorkingSetShared(TargetProcess, PsGetCurrentThread()); + /* Find the largest chunk of memory which has the same state and protection mask */ MemoryInfo.State = MiQueryAddressState(Address, Vad, @@ -1723,6 +1775,16 @@ MiQueryMemoryBasicInformation(IN HANDLE ProcessHandle, Address = NextAddress; } + /* Release the working set lock */ + MiUnlockProcessWorkingSetShared(TargetProcess, PsGetCurrentThread()); + + /* Check if we went outside of the VAD */ + if (((ULONG_PTR)Address >> PAGE_SHIFT) > Vad->EndingVpn) + { + /* Set the end of the VAD as the end address */ + Address = (PVOID)((Vad->EndingVpn + 1) << PAGE_SHIFT); + } + /* Now that we know the last VA address, calculate the region size */ MemoryInfo.RegionSize = ((ULONG_PTR)Address - (ULONG_PTR)MemoryInfo.BaseAddress); } @@ -4088,11 +4150,11 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, PEPROCESS Process; PMEMORY_AREA MemoryArea; PFN_NUMBER PageCount; - PMMVAD Vad, FoundVad; + PMMVAD Vad = NULL, FoundVad; NTSTATUS Status; PMMSUPPORT AddressSpace; PVOID PBaseAddress; - ULONG_PTR PRegionSize, StartingAddress, EndingAddress; + ULONG_PTR PRegionSize, StartingAddress, EndingAddress, HighestAddress; PEPROCESS CurrentProcess = PsGetCurrentProcess(); KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); PETHREAD CurrentThread = PsGetCurrentThread(); @@ -4106,7 +4168,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, PAGED_CODE(); /* Check for valid Zero bits */ - if (ZeroBits > 21) + if (ZeroBits > MI_MAX_ZERO_BITS) { DPRINT1("Too many zero bits\n"); return STATUS_INVALID_PARAMETER_3; @@ -4114,7 +4176,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, /* Check for valid Allocation Types */ if ((AllocationType & ~(MEM_COMMIT | MEM_RESERVE | MEM_RESET | MEM_PHYSICAL | - MEM_TOP_DOWN | MEM_WRITE_WATCH))) + MEM_TOP_DOWN | MEM_WRITE_WATCH | MEM_LARGE_PAGES))) { DPRINT1("Invalid Allocation Type\n"); return STATUS_INVALID_PARAMETER_5; @@ -4159,16 +4221,16 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, return STATUS_INVALID_PARAMETER_5; } - /* MEM_PHYSICAL can only be used if MEM_RESERVE is also used */ - if ((AllocationType & MEM_PHYSICAL) && !(AllocationType & MEM_RESERVE)) - { - DPRINT1("MEM_WRITE_WATCH used without MEM_RESERVE\n"); - return STATUS_INVALID_PARAMETER_5; - } - /* Check for valid MEM_PHYSICAL usage */ if (AllocationType & MEM_PHYSICAL) { + /* MEM_PHYSICAL can only be used if MEM_RESERVE is also used */ + if (!(AllocationType & MEM_RESERVE)) + { + DPRINT1("MEM_PHYSICAL used without MEM_RESERVE\n"); + return STATUS_INVALID_PARAMETER_5; + } + /* Only these flags are allowed with MEM_PHYSIAL */ if (AllocationType & ~(MEM_RESERVE | MEM_TOP_DOWN | MEM_PHYSICAL)) { @@ -4200,7 +4262,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, { /* Make sure they are writable */ ProbeForWritePointer(UBaseAddress); - ProbeForWriteUlong(URegionSize); + ProbeForWriteSize_t(URegionSize); } /* Capture their values */ @@ -4215,7 +4277,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, _SEH2_END; /* Make sure the allocation isn't past the VAD area */ - if (PBaseAddress >= MM_HIGHEST_VAD_ADDRESS) + if (PBaseAddress > MM_HIGHEST_VAD_ADDRESS) { DPRINT1("Virtual allocation base above User Space\n"); return STATUS_INVALID_PARAMETER_2; @@ -4280,12 +4342,6 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // // Fail on the things we don't yet support // - if (ZeroBits != 0) - { - DPRINT1("Zero bits not supported\n"); - Status = STATUS_INVALID_PARAMETER; - goto FailPathNoLock; - } if ((AllocationType & MEM_LARGE_PAGES) == MEM_LARGE_PAGES) { DPRINT1("MEM_LARGE_PAGES not supported\n"); @@ -4304,18 +4360,6 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, Status = STATUS_INVALID_PARAMETER; goto FailPathNoLock; } - if ((AllocationType & MEM_TOP_DOWN) == MEM_TOP_DOWN) - { - DPRINT1("MEM_TOP_DOWN not supported\n"); - AllocationType &= ~MEM_TOP_DOWN; - } - - if (Process->VmTopDown == 1) - { - DPRINT1("VmTopDown not supported\n"); - Status = STATUS_INVALID_PARAMETER; - goto FailPathNoLock; - } // // Check if the caller is reserving memory, or committing memory and letting @@ -4326,7 +4370,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // // Do not allow COPY_ON_WRITE through this API // - if ((Protect & PAGE_WRITECOPY) || (Protect & PAGE_EXECUTE_WRITECOPY)) + if (Protect & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY)) { DPRINT1("Copy on write not allowed through this path\n"); Status = STATUS_INVALID_PAGE_PROTECTION; @@ -4345,6 +4389,29 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, PageCount = BYTES_TO_PAGES(PRegionSize); EndingAddress = 0; StartingAddress = 0; + + // + // Check if ZeroBits were specified + // + if (ZeroBits != 0) + { + // + // Calculate the highest address and check if it's valid + // + HighestAddress = MAXULONG_PTR >> ZeroBits; + if (HighestAddress > (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS) + { + Status = STATUS_INVALID_PARAMETER_3; + goto FailPathNoLock; + } + } + else + { + // + // Use the highest VAD address as maximum + // + HighestAddress = (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS; + } } else { @@ -4353,8 +4420,8 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // expected 64KB granularity, and see where the ending address will // fall based on the aligned address and the passed in region size // - StartingAddress = ROUND_DOWN((ULONG_PTR)PBaseAddress, _64K); EndingAddress = ((ULONG_PTR)PBaseAddress + PRegionSize - 1) | (PAGE_SIZE - 1); + StartingAddress = ROUND_DOWN((ULONG_PTR)PBaseAddress, _64K); PageCount = BYTES_TO_PAGES(EndingAddress - StartingAddress); } @@ -4362,7 +4429,13 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // Allocate and initialize the VAD // Vad = ExAllocatePoolWithTag(NonPagedPool, sizeof(MMVAD_LONG), 'SdaV'); - ASSERT(Vad != NULL); + if (Vad == NULL) + { + DPRINT1("Failed to allocate a VAD!\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + goto FailPathNoLock; + } + Vad->u.LongFlags = 0; if (AllocationType & MEM_COMMIT) Vad->u.VadFlags.MemCommit = 1; Vad->u.VadFlags.Protection = ProtectionMask; @@ -4389,11 +4462,11 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, if (!PBaseAddress) { /* Which way should we search? */ - if (AllocationType & MEM_TOP_DOWN) + if ((AllocationType & MEM_TOP_DOWN) || Process->VmTopDown) { /* Find an address top-down */ Result = MiFindEmptyAddressRangeDownTree(PRegionSize, - (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS, + HighestAddress, _64K, &Process->VadRoot, &StartingAddress, @@ -4419,9 +4492,11 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // Now we know where the allocation ends. Make sure it doesn't end up // somewhere in kernel mode. // - NT_ASSERT(StartingAddress != 0); + ASSERT(StartingAddress != 0); + ASSERT(StartingAddress < (ULONG_PTR)MM_HIGHEST_USER_ADDRESS); EndingAddress = (StartingAddress + PRegionSize - 1) | (PAGE_SIZE - 1); - if ((PVOID)EndingAddress > MM_HIGHEST_VAD_ADDRESS) + ASSERT(EndingAddress > StartingAddress); + if (EndingAddress > HighestAddress) { Status = STATUS_NO_MEMORY; goto FailPath; @@ -4447,8 +4522,8 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // // Write out the VAD fields for this allocation // - Vad->StartingVpn = (ULONG_PTR)StartingAddress >> PAGE_SHIFT; - Vad->EndingVpn = (ULONG_PTR)EndingAddress >> PAGE_SHIFT; + Vad->StartingVpn = StartingAddress >> PAGE_SHIFT; + Vad->EndingVpn = EndingAddress >> PAGE_SHIFT; // // FIXME: Should setup VAD bitmap @@ -4464,6 +4539,13 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, MiInsertNode(&Process->VadRoot, (PVOID)Vad, Parent, Result); MiUnlockProcessWorkingSetUnsafe(Process, CurrentThread); + // + // Make sure the actual region size is at least as big as the + // requested region size and update the value + // + ASSERT(PRegionSize <= (EndingAddress + 1 - StartingAddress)); + PRegionSize = (EndingAddress + 1 - StartingAddress); + // // Update the virtual size of the process, and if this is now the highest // virtual size we have ever seen, update the peak virtual size to reflect @@ -4497,6 +4579,9 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + // + // Ignore exception! + // } _SEH2_END; return STATUS_SUCCESS; @@ -4814,6 +4899,14 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, FailPath: MmUnlockAddressSpace(AddressSpace); + if (!NT_SUCCESS(Status)) + { + if (Vad != NULL) + { + ExFreePoolWithTag(Vad, 'SdaV'); + } + } + // // Check if we need to update the protection // @@ -4838,21 +4931,28 @@ FailPathNoLock: if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process); // - // Use SEH to write back the base address and the region size. In the case - // of an exception, we strangely do return back the exception code, even - // though the memory *has* been allocated. This mimics Windows behavior and - // there is not much we can do about it. + // Only write back results on success // - _SEH2_TRY + if (NT_SUCCESS(Status)) { - *URegionSize = PRegionSize; - *UBaseAddress = (PVOID)StartingAddress; + // + // Use SEH to write back the base address and the region size. In the case + // of an exception, we strangely do return back the exception code, even + // though the memory *has* been allocated. This mimics Windows behavior and + // there is not much we can do about it. + // + _SEH2_TRY + { + *URegionSize = PRegionSize; + *UBaseAddress = (PVOID)StartingAddress; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; + return Status; } From 8926b7a72ebeb5ef5efcb6b35990228de531a00f Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 18 May 2014 18:35:45 +0000 Subject: [PATCH 11/69] [CRT] * Import _isleadbyte_l(). * Import _mbtowc_l(). * Import mbtowc() instead of our own. * Fixes some msvcrt tests. CORE-8080 svn path=/trunk/; revision=63358 --- reactos/lib/sdk/crt/stdlib/mbtowc.c | 59 +++++++++++++++-------------- reactos/lib/sdk/crt/string/ctype.c | 9 +++++ 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/reactos/lib/sdk/crt/stdlib/mbtowc.c b/reactos/lib/sdk/crt/stdlib/mbtowc.c index 6830367dfc8..13366a0e567 100644 --- a/reactos/lib/sdk/crt/stdlib/mbtowc.c +++ b/reactos/lib/sdk/crt/stdlib/mbtowc.c @@ -10,36 +10,39 @@ #include - -/* - * @implemented +/********************************************************************* + * _mbtowc_l(MSVCRT.@) */ - -int mbtowc (wchar_t *charptr, const char *address, size_t number) +int CDECL _mbtowc_l(wchar_t *dst, const char* str, size_t n, _locale_t locale) { - int bytes; + MSVCRT_pthreadlocinfo locinfo; + wchar_t tmpdst = '\0'; - if (address == 0) - return 0; + if(!locale) + locinfo = get_locinfo(); + else + locinfo = (MSVCRT_pthreadlocinfo)(locale->locinfo); - if ((bytes = mblen (address, number)) < 0) - return bytes; - - if (charptr) { - switch (bytes) { - case 0: - if (number > 0) - *charptr = (wchar_t) '\0'; - break; - case 1: - *charptr = (wchar_t) ((unsigned char) address[0]); - break; - case 2: - *charptr = (wchar_t) (((unsigned char) address[0] << 8) - | (unsigned char) address[1]); - break; - } - } - - return bytes; + if(n <= 0 || !str) + return 0; + if(!locinfo->lc_codepage) + tmpdst = (unsigned char)*str; + else if(!MultiByteToWideChar(locinfo->lc_codepage, 0, str, n, &tmpdst, 1)) + return -1; + if(dst) + *dst = tmpdst; + /* return the number of bytes from src that have been used */ + if(!*str) + return 0; + if(n >= 2 && _isleadbyte_l((unsigned char)*str, locale) && str[1]) + return 2; + return 1; +} + +/********************************************************************* + * mbtowc(MSVCRT.@) + */ +int CDECL mbtowc(wchar_t *dst, const char* str, size_t n) +{ + return _mbtowc_l(dst, str, n, NULL); } diff --git a/reactos/lib/sdk/crt/string/ctype.c b/reactos/lib/sdk/crt/string/ctype.c index 1dbbee453ac..bf5d1cda76f 100644 --- a/reactos/lib/sdk/crt/string/ctype.c +++ b/reactos/lib/sdk/crt/string/ctype.c @@ -614,6 +614,15 @@ int __cdecl _isctype (int c, int ctypeFlags) { return _isctype_l(c, ctypeFlags, NULL); } + +/********************************************************************* + * _isleadbyte_l (MSVCRT.@) + */ +int __cdecl _isleadbyte_l(int c, _locale_t locale) +{ + return _isctype_l( c, _LEADBYTE, locale ); +} + #endif /* _LIBCNT_ */ /* From 05f75e278b8618d3675c902c76a2d2cd9605858c Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sun, 18 May 2014 18:40:02 +0000 Subject: [PATCH 12/69] [bootdata] add entries for optional broadcom 57xx drivers (used by the official ReactOS test laptop) svn path=/trunk/; revision=63359 --- reactos/boot/bootdata/packages/reactos.dff.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/boot/bootdata/packages/reactos.dff.in b/reactos/boot/bootdata/packages/reactos.dff.in index 0986c54c8bb..78e13f332b8 100644 --- a/reactos/boot/bootdata/packages/reactos.dff.in +++ b/reactos/boot/bootdata/packages/reactos.dff.in @@ -46,6 +46,9 @@ Signature = "$ReactOS$" "modules/optional/netkvm2k.inf" 6 optional "modules/optional/netkvm2k.cat" 6 optional "modules/optional/netkvm.sys" 2 optional +"modules/optional/b57win32.inf" 6 optional +"modules/optional/b57win32.cat" 6 optional +"modules/optional/b57xp32.sys" 2 optional "modules/optional/alcxwdm.inf" 6 optional "modules/optional/alcxwdm.sys" 2 optional "modules/optional/mfc42.dll" 1 optional From 0e26222a74d18f915bb4dc6490e8ce971f12ebe3 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 18 May 2014 20:39:54 +0000 Subject: [PATCH 13/69] [NTOSKRNL] - Fail device initialization if a filter fails to load so the PnP manager can try again later - Fix some handle leaks - Reset device node flags after a remove IRP is sent [I8042PRT|MOUCLASS|KBDCLASS] - Implement proper support for PnP remove IRPs See issue #8238 for more details. svn path=/trunk/; revision=63360 --- reactos/drivers/input/i8042prt/pnp.c | 37 ++++++++++++++++++++ reactos/drivers/input/kbdclass/kbdclass.c | 14 ++++++-- reactos/drivers/input/mouclass/mouclass.c | 14 ++++++-- reactos/ntoskrnl/io/iomgr/driver.c | 41 +++++++++++++++++++---- reactos/ntoskrnl/io/pnpmgr/pnpinit.c | 22 ++++++++++-- reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 6 ++-- 6 files changed, 118 insertions(+), 16 deletions(-) diff --git a/reactos/drivers/input/i8042prt/pnp.c b/reactos/drivers/input/i8042prt/pnp.c index b0c67eccbed..fbc1753cbe0 100644 --- a/reactos/drivers/input/i8042prt/pnp.c +++ b/reactos/drivers/input/i8042prt/pnp.c @@ -644,6 +644,26 @@ i8042PnpStartDevice( return Status; } +static VOID +i8042RemoveDevice( + IN PDEVICE_OBJECT DeviceObject) +{ + PI8042_DRIVER_EXTENSION DriverExtension; + KIRQL OldIrql; + PFDO_DEVICE_EXTENSION DeviceExtension; + + DriverExtension = (PI8042_DRIVER_EXTENSION)IoGetDriverObjectExtension(DeviceObject->DriverObject, DeviceObject->DriverObject); + DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + KeAcquireSpinLock(&DriverExtension->DeviceListLock, &OldIrql); + RemoveEntryList(&DeviceExtension->ListEntry); + KeReleaseSpinLock(&DriverExtension->DeviceListLock, OldIrql); + + IoDetachDevice(DeviceExtension->LowerDevice); + + IoDeleteDevice(DeviceObject); +} + NTSTATUS NTAPI i8042Pnp( IN PDEVICE_OBJECT DeviceObject, @@ -710,6 +730,23 @@ i8042Pnp( TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_PNP_DEVICE_STATE\n"); return ForwardIrpAndForget(DeviceObject, Irp); } + case IRP_MN_QUERY_REMOVE_DEVICE: + { + TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_REMOVE_DEVICE\n"); + return ForwardIrpAndForget(DeviceObject, Irp); + } + case IRP_MN_CANCEL_REMOVE_DEVICE: + { + TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_CANCEL_REMOVE_DEVICE\n"); + return ForwardIrpAndForget(DeviceObject, Irp); + } + case IRP_MN_REMOVE_DEVICE: + { + TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n"); + Status = ForwardIrpAndForget(DeviceObject, Irp); + i8042RemoveDevice(DeviceObject); + return Status; + } default: { ERR_(I8042PRT, "IRP_MJ_PNP / unknown minor function 0x%x\n", MinorFunction); diff --git a/reactos/drivers/input/kbdclass/kbdclass.c b/reactos/drivers/input/kbdclass/kbdclass.c index 12ff89e3fec..09967b9f749 100644 --- a/reactos/drivers/input/kbdclass/kbdclass.c +++ b/reactos/drivers/input/kbdclass/kbdclass.c @@ -606,7 +606,7 @@ DestroyPortDriver( /* Remove from ClassDeviceExtension->ListHead list */ KeAcquireSpinLock(&ClassDeviceExtension->ListSpinLock, &OldIrql); - RemoveHeadList(DeviceExtension->ListEntry.Blink); + RemoveEntryList(&DeviceExtension->ListEntry); KeReleaseSpinLock(&ClassDeviceExtension->ListSpinLock, OldIrql); /* Remove entry from HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\[DeviceBaseName] */ @@ -865,7 +865,6 @@ ClassPnp( IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; - case IRP_MN_REMOVE_DEVICE: case IRP_MN_STOP_DEVICE: if (DeviceExtension->FileHandle) { @@ -874,6 +873,17 @@ ClassPnp( } Status = STATUS_SUCCESS; break; + + case IRP_MN_REMOVE_DEVICE: + if (DeviceExtension->FileHandle) + { + ZwClose(DeviceExtension->FileHandle); + DeviceExtension->FileHandle = NULL; + } + IoSkipCurrentIrpStackLocation(Irp); + Status = IoCallDriver(DeviceExtension->LowerDevice, Irp); + DestroyPortDriver(DeviceObject); + return Status; default: Status = Irp->IoStatus.Status; diff --git a/reactos/drivers/input/mouclass/mouclass.c b/reactos/drivers/input/mouclass/mouclass.c index 070dc5096e4..6fb47b38db6 100644 --- a/reactos/drivers/input/mouclass/mouclass.c +++ b/reactos/drivers/input/mouclass/mouclass.c @@ -582,7 +582,7 @@ DestroyPortDriver( /* Remove from ClassDeviceExtension->ListHead list */ KeAcquireSpinLock(&ClassDeviceExtension->ListSpinLock, &OldIrql); - RemoveHeadList(DeviceExtension->ListEntry.Blink); + RemoveEntryList(&DeviceExtension->ListEntry); KeReleaseSpinLock(&ClassDeviceExtension->ListSpinLock, OldIrql); /* Remove entry from HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\[DeviceBaseName] */ @@ -841,7 +841,6 @@ ClassPnp( IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; - case IRP_MN_REMOVE_DEVICE: case IRP_MN_STOP_DEVICE: if (DeviceExtension->FileHandle) { @@ -850,6 +849,17 @@ ClassPnp( } Status = STATUS_SUCCESS; break; + + case IRP_MN_REMOVE_DEVICE: + if (DeviceExtension->FileHandle) + { + ZwClose(DeviceExtension->FileHandle); + DeviceExtension->FileHandle = NULL; + } + IoSkipCurrentIrpStackLocation(Irp); + Status = IoCallDriver(DeviceExtension->LowerDevice, Irp); + DestroyPortDriver(DeviceObject); + return Status; default: Status = Irp->IoStatus.Status; diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index 4cdbbb51484..105e8cad767 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -558,6 +558,10 @@ IopAttachFilterDriversCallback( PLDR_DATA_TABLE_ENTRY ModuleObject; PDRIVER_OBJECT DriverObject; NTSTATUS Status; + + /* No filter value present */ + if (ValueType == REG_NONE) + return STATUS_SUCCESS; for (Filters = ValueData; ((ULONG_PTR)Filters - (ULONG_PTR)ValueData) < ValueLength && @@ -578,18 +582,21 @@ IopAttachFilterDriversCallback( /* Load and initialize the filter driver */ Status = IopLoadServiceModule(&ServiceName, &ModuleObject); if (!NT_SUCCESS(Status)) - continue; + return Status; Status = IopInitializeDriverModule(DeviceNode, ModuleObject, &ServiceName, FALSE, &DriverObject); if (!NT_SUCCESS(Status)) - continue; + return Status; } Status = IopInitializeDevice(DeviceNode, DriverObject); /* Remove extra reference */ ObDereferenceObject(DriverObject); + + if (!NT_SUCCESS(Status)) + return Status; } return STATUS_SUCCESS; @@ -645,14 +652,23 @@ IopAttachFilterDrivers( QueryTable[0].Name = L"LowerFilters"; else QueryTable[0].Name = L"UpperFilters"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[0].Flags = 0; + QueryTable[0].DefaultType = REG_NONE; - RtlQueryRegistryValues( + Status = RtlQueryRegistryValues( RTL_REGISTRY_HANDLE, (PWSTR)SubKey, QueryTable, DeviceNode, NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to load device %s filters: %08X\n", + Lower ? "lower" : "upper", Status); + ZwClose(SubKey); + ZwClose(EnumRootKey); + return Status; + } /* * Now get the class GUID @@ -696,9 +712,10 @@ IopAttachFilterDrivers( &Class, KEY_READ); if (!NT_SUCCESS(Status)) { + /* It's okay if there's no class key */ DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); ZwClose(EnumRootKey); - return Status; + return STATUS_SUCCESS; } QueryTable[0].QueryRoutine = IopAttachFilterDriversCallback; @@ -707,9 +724,10 @@ IopAttachFilterDrivers( else QueryTable[0].Name = L"UpperFilters"; QueryTable[0].EntryContext = NULL; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[0].Flags = 0; + QueryTable[0].DefaultType = REG_NONE; - RtlQueryRegistryValues( + Status = RtlQueryRegistryValues( RTL_REGISTRY_HANDLE, (PWSTR)SubKey, QueryTable, @@ -719,6 +737,15 @@ IopAttachFilterDrivers( /* Clean up */ ZwClose(SubKey); ZwClose(EnumRootKey); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to load class %s filters: %08X\n", + Lower ? "lower" : "upper", Status); + ZwClose(SubKey); + ZwClose(EnumRootKey); + return Status; + } } return STATUS_SUCCESS; diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c index 1684f92284c..30e20ca9e62 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c @@ -275,10 +275,10 @@ PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode, EnumRootKey, &DeviceNode->InstancePath, KEY_READ); + ZwClose(EnumRootKey); if (!NT_SUCCESS(Status)) { DPRINT1("IopOpenRegistryKeyEx() failed with Status %08X\n", Status); - ZwClose(EnumRootKey); return Status; } @@ -330,12 +330,17 @@ PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode, ClassKey, &Properties, KEY_READ); + ZwClose(ClassKey); if (!NT_SUCCESS(Status)) { /* No properties */ DPRINT("IopOpenRegistryKeyEx() failed with Status %08X\n", Status); PropertiesKey = NULL; } + else + { + ZwClose(PropertiesKey); + } } /* Free the registry data */ @@ -343,11 +348,22 @@ PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode, } /* Do ReactOS-style setup */ - IopAttachFilterDrivers(DeviceNode, TRUE); + Status = IopAttachFilterDrivers(DeviceNode, TRUE); + if (!NT_SUCCESS(Status)) + { + IopRemoveDevice(DeviceNode); + return Status; + } Status = IopInitializeDevice(DeviceNode, DriverObject); if (NT_SUCCESS(Status)) { - IopAttachFilterDrivers(DeviceNode, FALSE); + Status = IopAttachFilterDrivers(DeviceNode, FALSE); + if (!NT_SUCCESS(Status)) + { + IopRemoveDevice(DeviceNode); + return Status; + } + Status = IopStartDevice(DeviceNode); } diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index 5c18437a6f6..ee036a78770 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -580,7 +580,11 @@ IopSendRemoveDevice(IN PDEVICE_OBJECT DeviceObject) { IO_STACK_LOCATION Stack; PVOID Dummy; + PDEVICE_NODE DeviceNode = IopGetDeviceNode(DeviceObject); + /* Drop all our state for this device in case it isn't really going away */ + DeviceNode->Flags &= DNF_ENUMERATED | DNF_PROCESSED; + RtlZeroMemory(&Stack, sizeof(IO_STACK_LOCATION)); Stack.MajorFunction = IRP_MJ_PNP; Stack.MinorFunction = IRP_MN_REMOVE_DEVICE; @@ -4537,8 +4541,6 @@ IopPrepareDeviceForRemoval(IN PDEVICE_OBJECT DeviceObject, BOOLEAN Force) return Status; } - DeviceNode->Flags |= DNF_WILL_BE_REMOVED; - DeviceNode->Problem = CM_PROB_WILL_BE_REMOVED; if (DeviceRelations) IopSendRemoveDeviceRelations(DeviceRelations); IopSendRemoveChildDevices(DeviceNode); From 6dead6f19cfac456dc0ec0467d04ce35fe7bc048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 18 May 2014 22:10:45 +0000 Subject: [PATCH 14/69] [KERNEL32] Usually the command line is made of the application name and its parameters. When launching a DOS program, BaseCheckVDM builds suitable ApplicationName and CommandLine strings "DOS-compatible". ApplicationName is left-trimmed for whitespace and then converted to short-path format, and CommandLine sees the application name part (its first token) removed. We didn't do it before, we do it now. Care is taken when quotes are present in ApplicationName. Finally DOS command lines usually receive a newline character, so we also add it there. This is how behave Windows: just put our ntvdm in Windows, and observe what it receives... svn path=/trunk/; revision=63361 --- reactos/dll/win32/kernel32/client/vdm.c | 125 ++++++++++++++++++++---- 1 file changed, 104 insertions(+), 21 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/vdm.c b/reactos/dll/win32/kernel32/client/vdm.c index e6fa9c3a04b..ca683838b76 100644 --- a/reactos/dll/win32/kernel32/client/vdm.c +++ b/reactos/dll/win32/kernel32/client/vdm.c @@ -93,26 +93,25 @@ BaseCheckVDM(IN ULONG BinaryType, STARTUPINFOA AnsiStartupInfo; ULONG NumStrings = 5; - if (CurrentDirectory == NULL) + /* Parameters validation */ + if (ApplicationName == NULL || CommandLine == NULL) { - /* Allocate memory for the current directory path */ - Length = GetCurrentDirectoryW(0, NULL); - CurrentDir = (PWCHAR)RtlAllocateHeap(RtlGetProcessHeap(), - HEAP_ZERO_MEMORY, - Length * sizeof(WCHAR)); - if (CurrentDir == NULL) - { - Status = STATUS_NO_MEMORY; - goto Cleanup; - } - - /* Get the current directory */ - GetCurrentDirectoryW(Length, CurrentDir); - CurrentDirectory = CurrentDir; + return STATUS_INVALID_PARAMETER; } + DPRINT1("Before: ApplicationName = '%S' ; CommandLine = '%S'\n", ApplicationName, CommandLine); + + /* Trim leading whitespace from ApplicationName */ + while (*ApplicationName == L' ' || *ApplicationName == L'\t') + ++ApplicationName; + /* Calculate the size of the short application name */ Length = GetShortPathNameW(ApplicationName, NULL, 0); + if (Length == 0) + { + Status = STATUS_OBJECT_PATH_INVALID; + goto Cleanup; + } /* Allocate memory for the short application name */ ShortAppName = (PWCHAR)RtlAllocateHeap(RtlGetProcessHeap(), @@ -125,7 +124,7 @@ BaseCheckVDM(IN ULONG BinaryType, } /* Get the short application name */ - if (!GetShortPathNameW(ApplicationName, ShortAppName, Length)) + if (GetShortPathNameW(ApplicationName, ShortAppName, Length) == 0) { /* Try to determine which error occurred */ switch (GetLastError()) @@ -151,6 +150,83 @@ BaseCheckVDM(IN ULONG BinaryType, goto Cleanup; } + /* Trim leading whitespace from CommandLine */ + while (*CommandLine == L' ' || *CommandLine == L'\t') + ++CommandLine; + + /* + * CommandLine is usually formatted as: 'ApplicationName param0 ...'. + * So we want to strip the first token (ApplicationName) from it. + * Two cases are in fact possible: + * - either the first token is indeed ApplicationName, so we just skip it; + * - or the first token is not exactly ApplicationName, because it happened + * that somebody else already preprocessed CommandLine. Therefore we + * suppose that the first token corresponds to an application name and + * we skip it. Care should be taken when quotes are present in this token. + */ + + if (*CommandLine) + { + /* The first part of CommandLine should be the ApplicationName... */ + Length = wcslen(ApplicationName); + if (Length <= wcslen(CommandLine) && + _wcsnicmp(ApplicationName, CommandLine, Length) == 0) + { + /* Skip it */ + CommandLine += Length; + } + /* + * ... but it is not, however we still have a token. We suppose that + * it corresponds to some sort of application name, so we skip it too. + */ + else + { + /* Get rid of the first token. We stop when we see whitespace. */ + while (*CommandLine && !(*CommandLine == L' ' || *CommandLine == L'\t')) + { + if (*CommandLine == L'\"') + { + /* We enter a quoted part, skip it */ + ++CommandLine; + while (*CommandLine && *CommandLine++ != L'\"') ; + } + else + { + /* Go to the next character */ + ++CommandLine; + } + } + } + } + + /* + * Trim remaining whitespace from CommandLine that may be + * present between the application name and the parameters. + */ + while (*CommandLine == L' ' || *CommandLine == L'\t') + ++CommandLine; + + DPRINT1("After: ApplicationName = '%S' ; CommandLine = '%S'\n", ApplicationName, CommandLine); + + /* Get the current directory */ + if (CurrentDirectory == NULL) + { + /* Allocate memory for the current directory path */ + Length = GetCurrentDirectoryW(0, NULL); + CurrentDir = (PWCHAR)RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + Length * sizeof(WCHAR)); + if (CurrentDir == NULL) + { + Status = STATUS_NO_MEMORY; + goto Cleanup; + } + + /* Get the current directory */ + GetCurrentDirectoryW(Length, CurrentDir); + CurrentDirectory = CurrentDir; + } + /* Calculate the size of the short current directory path */ Length = GetShortPathNameW(CurrentDirectory, NULL, 0); @@ -214,7 +290,9 @@ BaseCheckVDM(IN ULONG BinaryType, } /* Allocate memory for the ANSI strings */ - AnsiCmdLine = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->CmdLen); + + /* For the command line we need to add two characters needed for newline '\r\n' */ + AnsiCmdLine = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->CmdLen + 2); AnsiAppName = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->AppLen); AnsiCurDirectory = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->CurDirectoryLen); if (StartupInfo->lpDesktop) AnsiDesktop = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), @@ -247,6 +325,11 @@ BaseCheckVDM(IN ULONG BinaryType, CheckVdm->CmdLen, NULL, NULL); + /* Add a needed newline '\r\n' */ + CheckVdm->CmdLen--; // FIXME.... + AnsiCmdLine[CheckVdm->CmdLen ] = '\r'; + AnsiCmdLine[CheckVdm->CmdLen + 1] = '\n'; + CheckVdm->CmdLen += 2; /* Convert the short application name into an ANSI string */ WideCharToMultiByte(CP_ACP, @@ -417,13 +500,13 @@ Cleanup: /* Free the capture buffer */ CsrFreeCaptureBuffer(CaptureBuffer); - /* Free the short paths */ - if (ShortAppName) RtlFreeHeap(RtlGetProcessHeap(), 0, ShortAppName); + /* Free the current directory, if it was allocated here, and its short path */ if (ShortCurrentDir) RtlFreeHeap(RtlGetProcessHeap(), 0, ShortCurrentDir); - - /* Free the current directory, if it was allocated here */ if (CurrentDir) RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentDir); + /* Free the short app name */ + if (ShortAppName) RtlFreeHeap(RtlGetProcessHeap(), 0, ShortAppName); + return Status; } From ab209b91b5b68b9535dca5e6948831adcd64e4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 18 May 2014 23:12:24 +0000 Subject: [PATCH 15/69] [KERNEL32] Improve a dprint (needed when studying spaces in command lines). svn path=/trunk/; revision=63362 --- reactos/dll/win32/kernel32/client/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/kernel32/client/proc.c b/reactos/dll/win32/kernel32/client/proc.c index 84bcd6d2509..47bb1404509 100644 --- a/reactos/dll/win32/kernel32/client/proc.c +++ b/reactos/dll/win32/kernel32/client/proc.c @@ -2468,7 +2468,7 @@ CreateProcessInternalW(IN HANDLE hUserToken, PolicyPathPair.Nt = &SxsNtPolicyPath.String; #endif - DPRINT("CreateProcessInternalW: %S %S %lx\n", lpApplicationName, lpCommandLine, dwCreationFlags); + DPRINT("CreateProcessInternalW: '%S' '%S' %lx\n", lpApplicationName, lpCommandLine, dwCreationFlags); /* Finally, set our TEB and PEB */ Teb = NtCurrentTeb(); From 33840923385dcf909548678c0fffa34869263fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 18 May 2014 23:13:12 +0000 Subject: [PATCH 16/69] [KERNEL32]: Fix the newline adding (see r63361). svn path=/trunk/; revision=63363 --- reactos/dll/win32/kernel32/client/vdm.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/vdm.c b/reactos/dll/win32/kernel32/client/vdm.c index ca683838b76..cb2ac243469 100644 --- a/reactos/dll/win32/kernel32/client/vdm.c +++ b/reactos/dll/win32/kernel32/client/vdm.c @@ -284,14 +284,13 @@ BaseCheckVDM(IN ULONG BinaryType, if (StartupInfo->dwFlags & STARTF_USESTDHANDLES) { /* Set the standard handles */ - CheckVdm->StdIn = StartupInfo->hStdInput; + CheckVdm->StdIn = StartupInfo->hStdInput; CheckVdm->StdOut = StartupInfo->hStdOutput; CheckVdm->StdErr = StartupInfo->hStdError; } /* Allocate memory for the ANSI strings */ - - /* For the command line we need to add two characters needed for newline '\r\n' */ + // We need to add the two newline characters '\r\n' to the command line AnsiCmdLine = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->CmdLen + 2); AnsiAppName = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->AppLen); AnsiCurDirectory = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->CurDirectoryLen); @@ -325,11 +324,11 @@ BaseCheckVDM(IN ULONG BinaryType, CheckVdm->CmdLen, NULL, NULL); - /* Add a needed newline '\r\n' */ - CheckVdm->CmdLen--; // FIXME.... - AnsiCmdLine[CheckVdm->CmdLen ] = '\r'; - AnsiCmdLine[CheckVdm->CmdLen + 1] = '\n'; - CheckVdm->CmdLen += 2; + /* Add a needed newline '\r\n' and NULL-terminate */ + CheckVdm->CmdLen--; // Rewind back to the NULL character + AnsiCmdLine[CheckVdm->CmdLen++] = '\r'; + AnsiCmdLine[CheckVdm->CmdLen++] = '\n'; + AnsiCmdLine[CheckVdm->CmdLen++] = 0; /* Convert the short application name into an ANSI string */ WideCharToMultiByte(CP_ACP, From 3e159aa702fb9acdd81538738ba2bde5c7599e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 18 May 2014 23:17:25 +0000 Subject: [PATCH 17/69] [KERNEL32]: Remove temporary DPRINTs and fix comments. svn path=/trunk/; revision=63364 --- reactos/dll/win32/kernel32/client/vdm.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/vdm.c b/reactos/dll/win32/kernel32/client/vdm.c index cb2ac243469..8b50319491f 100644 --- a/reactos/dll/win32/kernel32/client/vdm.c +++ b/reactos/dll/win32/kernel32/client/vdm.c @@ -99,8 +99,6 @@ BaseCheckVDM(IN ULONG BinaryType, return STATUS_INVALID_PARAMETER; } - DPRINT1("Before: ApplicationName = '%S' ; CommandLine = '%S'\n", ApplicationName, CommandLine); - /* Trim leading whitespace from ApplicationName */ while (*ApplicationName == L' ' || *ApplicationName == L'\t') ++ApplicationName; @@ -164,7 +162,6 @@ BaseCheckVDM(IN ULONG BinaryType, * suppose that the first token corresponds to an application name and * we skip it. Care should be taken when quotes are present in this token. */ - if (*CommandLine) { /* The first part of CommandLine should be the ApplicationName... */ @@ -206,8 +203,6 @@ BaseCheckVDM(IN ULONG BinaryType, while (*CommandLine == L' ' || *CommandLine == L'\t') ++CommandLine; - DPRINT1("After: ApplicationName = '%S' ; CommandLine = '%S'\n", ApplicationName, CommandLine); - /* Get the current directory */ if (CurrentDirectory == NULL) { @@ -290,7 +285,7 @@ BaseCheckVDM(IN ULONG BinaryType, } /* Allocate memory for the ANSI strings */ - // We need to add the two newline characters '\r\n' to the command line + // We need to add the newline characters '\r\n' to the command line AnsiCmdLine = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->CmdLen + 2); AnsiAppName = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->AppLen); AnsiCurDirectory = (PCHAR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CheckVdm->CurDirectoryLen); @@ -324,7 +319,7 @@ BaseCheckVDM(IN ULONG BinaryType, CheckVdm->CmdLen, NULL, NULL); - /* Add a needed newline '\r\n' and NULL-terminate */ + /* Add the needed newline and NULL-terminate */ CheckVdm->CmdLen--; // Rewind back to the NULL character AnsiCmdLine[CheckVdm->CmdLen++] = '\r'; AnsiCmdLine[CheckVdm->CmdLen++] = '\n'; From 65a58c440e177edec2777025d9d45c3229897f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 18 May 2014 23:45:43 +0000 Subject: [PATCH 18/69] [NTVDM] Correctly NULL-terminate the command-lines when needed (and avoid buffer overruns). svn path=/trunk/; revision=63365 --- reactos/subsystems/ntvdm/dos/dem.c | 4 ++-- reactos/subsystems/ntvdm/dos/dos32krnl/dos.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/subsystems/ntvdm/dos/dem.c b/reactos/subsystems/ntvdm/dos/dem.c index f0b251d2e03..a0b1a5baac6 100644 --- a/reactos/subsystems/ntvdm/dos/dem.c +++ b/reactos/subsystems/ntvdm/dos/dem.c @@ -119,8 +119,8 @@ static VOID WINAPI DosCmdInterpreterBop(LPWORD Stack) STARTUPINFOA StartupInfo; PROCESS_INFORMATION ProcessInformation; - /* NULL-terminate the command by removing the return carriage character */ - while (*CmdPtr != '\r') CmdPtr++; + /* NULL-terminate the command line by removing the return carriage character */ + while (*CmdPtr && *CmdPtr != '\r') CmdPtr++; *CmdPtr = '\0'; DPRINT1("CMD Run Command '%s'\n", Command); diff --git a/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c b/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c index 6925c268ce8..353fa6d3c22 100644 --- a/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c +++ b/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c @@ -926,6 +926,10 @@ DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType, return ERROR_NOT_SUPPORTED; } + /* NULL-terminate the command line by removing the return carriage character */ + while (*CommandLine && *CommandLine != '\r') CommandLine++; + *(LPSTR)CommandLine = '\0'; + /* Open a handle to the executable */ FileHandle = CreateFileA(ExecutablePath, GENERIC_READ, From de36490031fc50d59ea0c93c10305ad0aa07c850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 19 May 2014 01:12:25 +0000 Subject: [PATCH 19/69] [NTVDM] Since the BIOS registers the whole range of possible interrupts, we register their stubs in an array-form so that the BIOS always registers INT n at the same place. We save 561 bytes of memory. svn path=/trunk/; revision=63366 --- reactos/subsystems/ntvdm/bios/bios32/bios32.c | 8 ++------ reactos/subsystems/ntvdm/bios/bios32/bios32p.h | 9 +++++---- reactos/subsystems/ntvdm/bop.c | 2 +- reactos/subsystems/ntvdm/callback.c | 10 ++++++---- reactos/subsystems/ntvdm/callback.h | 6 ++---- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/reactos/subsystems/ntvdm/bios/bios32/bios32.c b/reactos/subsystems/ntvdm/bios/bios32/bios32.c index fc272826242..045e58c82bb 100644 --- a/reactos/subsystems/ntvdm/bios/bios32/bios32.c +++ b/reactos/subsystems/ntvdm/bios/bios32/bios32.c @@ -301,18 +301,14 @@ static VOID BiosHwSetup(VOID) static VOID InitializeBiosInt32(VOID) { USHORT i; - // USHORT Offset = 0; /* Initialize the callback context */ InitializeContext(&BiosContext, BIOS_SEGMENT, 0x0000); - /* Register the BIOS 32-bit Interrupts */ + /* Register the default BIOS 32-bit Interrupts */ for (i = 0x00; i <= 0xFF; i++) { - // Offset += RegisterInt32(MAKELONG(Offset, BIOS_SEGMENT), i, NULL, NULL); - BiosContext.NextOffset += RegisterInt32(MAKELONG(BiosContext.NextOffset, - BiosContext.Segment), - i, NULL, NULL); + RegisterBiosInt32(i, NULL); } /* Initialize the exception vector interrupts to a default Exception handler */ diff --git a/reactos/subsystems/ntvdm/bios/bios32/bios32p.h b/reactos/subsystems/ntvdm/bios/bios32/bios32p.h index 604fda30cc7..d74e04e7d4d 100644 --- a/reactos/subsystems/ntvdm/bios/bios32/bios32p.h +++ b/reactos/subsystems/ntvdm/bios/bios32/bios32p.h @@ -30,11 +30,12 @@ /* FUNCTIONS ******************************************************************/ extern CALLBACK16 BiosContext; -#define RegisterBiosInt32(IntNumber, IntHandler) \ +#define RegisterBiosInt32(IntNumber, IntHandler) \ do { \ - BiosContext.NextOffset += RegisterInt32(MAKELONG(BiosContext.NextOffset, \ - BiosContext.Segment), \ - (IntNumber), (IntHandler), NULL); \ + RegisterInt32(BiosContext.TrampolineFarPtr + \ + BiosContext.TrampolineSize + \ + (IntNumber) * Int16To32StubSize, \ + (IntNumber), (IntHandler), NULL); \ } while(0); VOID EnableHwIRQ(UCHAR hwirq, EMULATOR_INT32_PROC func); diff --git a/reactos/subsystems/ntvdm/bop.c b/reactos/subsystems/ntvdm/bop.c index 407004290b7..88a41dde9ef 100644 --- a/reactos/subsystems/ntvdm/bop.c +++ b/reactos/subsystems/ntvdm/bop.c @@ -19,7 +19,7 @@ /* * This is the list of registered BOP handlers. */ -EMULATOR_BOP_PROC BopProc[EMULATOR_MAX_BOP_NUM] = { NULL }; +static EMULATOR_BOP_PROC BopProc[EMULATOR_MAX_BOP_NUM] = { NULL }; /* PUBLIC FUNCTIONS ***********************************************************/ diff --git a/reactos/subsystems/ntvdm/callback.c b/reactos/subsystems/ntvdm/callback.c index 7566a9437a7..d1ecaf3f436 100644 --- a/reactos/subsystems/ntvdm/callback.c +++ b/reactos/subsystems/ntvdm/callback.c @@ -22,7 +22,7 @@ /* * This is the list of registered 32-bit Interrupt handlers. */ -EMULATOR_INT32_PROC Int32Proc[EMULATOR_MAX_INT32_NUM] = { NULL }; +static EMULATOR_INT32_PROC Int32Proc[EMULATOR_MAX_INT32_NUM] = { NULL }; /* BOP Identifiers */ #define BOP_CONTROL 0xFF // Control BOP Handler @@ -50,7 +50,7 @@ do { \ // /* 16-bit generic interrupt code for calling a 32-bit interrupt handler */ -BYTE Int16To32[] = +static BYTE Int16To32[] = { 0xFA, // cli @@ -76,6 +76,7 @@ BYTE Int16To32[] = 0x44, 0x44, // inc sp, inc sp 0xCF, // iret }; +const ULONG Int16To32StubSize = sizeof(Int16To32); /* PUBLIC FUNCTIONS ***********************************************************/ @@ -85,9 +86,10 @@ InitializeContext(IN PCALLBACK16 Context, IN USHORT Offset) { Context->TrampolineFarPtr = MAKELONG(Offset, Segment); + Context->TrampolineSize = max(CALL16_TRAMPOLINE_SIZE, + INT16_TRAMPOLINE_SIZE); Context->Segment = Segment; - Context->NextOffset = Offset + max(CALL16_TRAMPOLINE_SIZE, - INT16_TRAMPOLINE_SIZE); + Context->NextOffset = Offset + Context->TrampolineSize; } VOID diff --git a/reactos/subsystems/ntvdm/callback.h b/reactos/subsystems/ntvdm/callback.h index c29ef9cb687..264e67fe6d0 100644 --- a/reactos/subsystems/ntvdm/callback.h +++ b/reactos/subsystems/ntvdm/callback.h @@ -15,17 +15,15 @@ /* 32-bit Interrupt Identifiers */ #define EMULATOR_MAX_INT32_NUM 0xFF + 1 -#define INT_HANDLER_OFFSET 0x1000 -#define COMMON_STUB_OFFSET 0x2000 - - typedef struct _CALLBACK16 { ULONG TrampolineFarPtr; // Where the trampoline zone is placed + ULONG TrampolineSize; // Size of the trampoline zone USHORT Segment; USHORT NextOffset; } CALLBACK16, *PCALLBACK16; +extern const ULONG Int16To32StubSize; /* FUNCTIONS ******************************************************************/ From 02bef19b583fbdc09d284e1a8bc853ff5f91f647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 19 May 2014 02:21:49 +0000 Subject: [PATCH 20/69] [NTVDM] - Initialize the BIOS Configuration Table, see http://www.ctyme.com/intr/rb-1594.htm for more information. - Implement INT 15h, AH=C0h "GET CONFIGURATION". svn path=/trunk/; revision=63367 --- reactos/subsystems/ntvdm/bios/bios.c | 7 +- reactos/subsystems/ntvdm/bios/bios.h | 24 ++++++- reactos/subsystems/ntvdm/bios/bios32/bios32.c | 69 ++++++++++++++----- 3 files changed, 78 insertions(+), 22 deletions(-) diff --git a/reactos/subsystems/ntvdm/bios/bios.c b/reactos/subsystems/ntvdm/bios/bios.c index 12066b53dd3..accd3f1cc5e 100644 --- a/reactos/subsystems/ntvdm/bios/bios.c +++ b/reactos/subsystems/ntvdm/bios/bios.c @@ -37,6 +37,7 @@ static BOOLEAN Bios32Loaded = FALSE; static CALLBACK16 __BiosContext; PBIOS_DATA_AREA Bda; +PBIOS_CONFIG_TABLE Bct; /* PRIVATE FUNCTIONS **********************************************************/ @@ -134,8 +135,10 @@ BiosInitialize(IN LPCSTR BiosFileName) /* Disable interrupts */ setIF(0); - /* Initialize the BDA pointer */ - Bda = (PBIOS_DATA_AREA)SEG_OFF_TO_PTR(BDA_SEGMENT, 0); + /* Initialize the BDA and the BCT pointers */ + Bda = (PBIOS_DATA_AREA)SEG_OFF_TO_PTR(BDA_SEGMENT, 0x0000); + // The BCT is found at F000:E6F5 for 100% compatible BIOSes. + Bct = (PBIOS_CONFIG_TABLE)SEG_OFF_TO_PTR(BIOS_SEGMENT, 0xE6F5); /* Register the BIOS support BOPs */ RegisterBop(BOP_BIOSINIT , BiosInitBop); diff --git a/reactos/subsystems/ntvdm/bios/bios.h b/reactos/subsystems/ntvdm/bios/bios.h index cc1bb94b803..9b47f163a0d 100644 --- a/reactos/subsystems/ntvdm/bios/bios.h +++ b/reactos/subsystems/ntvdm/bios/bios.h @@ -22,6 +22,8 @@ #define BIOS_EQUIPMENT_LIST 0x2C // HACK: Disable FPU for now +#pragma pack(push, 1) + /* * BIOS Data Area at 0040:XXXX * @@ -29,7 +31,6 @@ * and: http://www.bioscentral.com/misc/bda.htm * for more information. */ -#pragma pack(push, 1) typedef struct { WORD SerialPorts[4]; // 0x00 @@ -96,13 +97,30 @@ typedef struct BYTE Reserved17[15]; // 0x121 BYTE Reserved18[3]; // 0x130 } BIOS_DATA_AREA, *PBIOS_DATA_AREA; -#pragma pack(pop) - C_ASSERT(sizeof(BIOS_DATA_AREA) == 0x133); +/* + * BIOS Configuration Table at F000:E6F5 for 100% compatible BIOSes. + * + * See: http://www.ctyme.com/intr/rb-1594.htm + * for more information. + */ +typedef struct _BIOS_CONFIG_TABLE +{ + WORD Length; // 0x00 + BYTE Model; // 0x02 + BYTE SubModel; // 0x03 + BYTE BiosRevision; // 0x04 + BYTE BiosFeature[5]; // 0x05 -- 0x09 + // Other BIOSes may extend this table. We don't. +} BIOS_CONFIG_TABLE, *PBIOS_CONFIG_TABLE; + +#pragma pack(pop) + /* FUNCTIONS ******************************************************************/ extern PBIOS_DATA_AREA Bda; +extern PBIOS_CONFIG_TABLE Bct; VOID WINAPI BiosEquipmentService(LPWORD Stack); VOID WINAPI BiosGetMemorySize(LPWORD Stack); diff --git a/reactos/subsystems/ntvdm/bios/bios32/bios32.c b/reactos/subsystems/ntvdm/bios/bios32/bios32.c index 045e58c82bb..6a4aaba2801 100644 --- a/reactos/subsystems/ntvdm/bios/bios32/bios32.c +++ b/reactos/subsystems/ntvdm/bios/bios32/bios32.c @@ -112,6 +112,20 @@ static VOID WINAPI BiosMiscService(LPWORD Stack) break; } + /* Get Configuration */ + case 0xC0: + { + /* Return the BIOS ROM Configuration Table address in ES:BX */ + setES(HIWORD(Bct)); + setBX(LOWORD(Bct)); + + /* Call successful; clear CF */ + setAH(0x00); + Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + + break; + } + default: { DPRINT1("BIOS Function INT 15h, AH = 0x%02X NOT IMPLEMENTED\n", @@ -336,26 +350,23 @@ static VOID InitializeBiosInt32(VOID) ((PULONG)BaseAddress)[0x49] = (ULONG)NULL; } -/* PUBLIC FUNCTIONS ***********************************************************/ - -/* - * The BIOS POST (Power On-Self Test) - */ -BOOLEAN Bios32Initialize(VOID) +static VOID InitializeBiosInfo(VOID) +{ + Bct->Length = sizeof(*Bct); + Bct->Model = 0xFC; // PC-AT; see http://www.ctyme.com/intr/rb-1594.htm#Table515 + Bct->SubModel = 0x00; + Bct->BiosRevision = 0x01; + Bct->BiosFeature[0] = 0x64; // At the moment we don't support "INT 15/AH=4Fh called upon INT 09h" nor "wait for external event (INT 15/AH=41h) supported"; see http://www.ctyme.com/intr/rb-1594.htm#Table510 + Bct->BiosFeature[1] = 0x00; // We don't support anything from here; see http://www.ctyme.com/intr/rb-1594.htm#Table511 + Bct->BiosFeature[2] = 0x00; + Bct->BiosFeature[3] = 0x00; + Bct->BiosFeature[4] = 0x00; +} + +static VOID InitializeBiosData(VOID) { - BOOLEAN Success; UCHAR Low, High; - /* Initialize the stack */ - // That's what says IBM... (stack at 30:00FF going downwards) - // setSS(0x0000); - // setSP(0x0400); - setSS(0x0050); // Stack at 50:0400, going downwards - setSP(0x0400); - - /* Set data segment */ - setDS(BDA_SEGMENT); - /* Initialize the BDA contents */ Bda->EquipmentList = BIOS_EQUIPMENT_LIST; @@ -368,6 +379,30 @@ BOOLEAN Bios32Initialize(VOID) IOWriteB(CMOS_ADDRESS_PORT, CMOS_REG_BASE_MEMORY_HIGH); High = IOReadB(CMOS_DATA_PORT); Bda->MemorySize = MAKEWORD(Low, High); +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + +/* + * The BIOS POST (Power On-Self Test) + */ +BOOLEAN Bios32Initialize(VOID) +{ + BOOLEAN Success; + + /* Initialize the stack */ + // That's what says IBM... (stack at 30:00FF going downwards) + // setSS(0x0000); + // setSP(0x0400); + setSS(0x0050); // Stack at 50:0400, going downwards + setSP(0x0400); + + /* Set data segment */ + setDS(BDA_SEGMENT); + + /* Initialize the BDA and the BIOS ROM Information */ + InitializeBiosData(); + InitializeBiosInfo(); /* Register the BIOS 32-bit Interrupts */ InitializeBiosInt32(); From ebb1a6ec867c334e99f5059e56dfb95d75dab12a Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Mon, 19 May 2014 09:58:26 +0000 Subject: [PATCH 21/69] [WINED3DCFG] - rewrite the wined3d config cpl to make it work with the current version of wined3d - add a "default" option so it's easier to revert changes done to the configuration - I apologize for the "lost" translations but there were too many changes svn path=/trunk/; revision=63368 --- reactos/dll/cpl/wined3dcfg/general.c | 223 ++++++++++++----------- reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc | 33 ++-- reactos/dll/cpl/wined3dcfg/lang/de-DE.rc | 35 ++-- reactos/dll/cpl/wined3dcfg/lang/en-US.rc | 33 ++-- reactos/dll/cpl/wined3dcfg/lang/he-IL.rc | 33 ++-- reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc | 35 ++-- reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc | 35 ++-- reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc | 35 ++-- reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc | 35 ++-- reactos/dll/cpl/wined3dcfg/resource.h | 19 +- reactos/dll/cpl/wined3dcfg/wined3dcfg.h | 30 +-- 11 files changed, 325 insertions(+), 221 deletions(-) diff --git a/reactos/dll/cpl/wined3dcfg/general.c b/reactos/dll/cpl/wined3dcfg/general.c index 104649487aa..4fef455222c 100644 --- a/reactos/dll/cpl/wined3dcfg/general.c +++ b/reactos/dll/cpl/wined3dcfg/general.c @@ -2,123 +2,142 @@ #include -static LONG ReadSetting(HKEY hKey, PWCHAR szKey, PWCHAR szBuffer, DWORD dwSize) +WINED3D_SETTINGS gwd3dsShaderLvl[] = { - return RegQueryValueExW(hKey, szKey, NULL, NULL, (LPBYTE)szBuffer, &dwSize); -} + {VALUE_DEFAULT, REG_NONE, 0}, + {L"1.4", REG_DWORD, 1}, + {L"2", REG_DWORD, 2}, + {L"3", REG_DWORD, 3}, +}; -static VOID SaveSetting(HKEY hKey, PWCHAR szKey, PWCHAR szState) +WINED3D_SETTINGS gwd3dsDisable[] = { - RegSetValueExW(hKey, szKey, 0, REG_SZ, (LPBYTE)szState, (wcslen(szState) + 1) * sizeof(WCHAR)); + {VALUE_DEFAULT, REG_NONE, 0}, + {VALUE_DISABLED, REG_SZ, 0} +}; + +WINED3D_SETTINGS gwd3dsEnable[] = +{ + {VALUE_DEFAULT, REG_NONE, 0}, + {VALUE_ENABLED, REG_SZ, 0} +}; + +WINED3D_SETTINGS gwd3dsOffscreen[] = +{ + {VALUE_DEFAULT, REG_NONE, 0}, + {VALUE_BACKBUFFER, REG_SZ, 0}, + {VALUE_FBO, REG_SZ, 0} +}; + +WINED3D_SETTINGS gwd3dsVidMem[] = +{ + {VALUE_DEFAULT, REG_NONE, 0}, + {L"8", REG_SZ, 8}, + {L"16", REG_SZ, 16}, + {L"32", REG_SZ, 32}, + {L"64", REG_SZ, 64}, + {L"128", REG_SZ, 128}, + {L"256", REG_SZ, 256}, + {L"512", REG_SZ, 512}, +}; + +WINED3D_SETTINGS gwd3dsDdRender[] = +{ + {VALUE_DEFAULT, REG_NONE, 0}, + {VALUE_GDI, REG_SZ, 0} +}; + + +void InitControl(HWND hWndDlg, HKEY hKey, PWCHAR szKey, PWINED3D_SETTINGS pSettings, INT iControlId, INT iCount) +{ + WCHAR szBuffer[MAX_KEY_LENGTH]; + DWORD dwSize = MAX_KEY_LENGTH; + DWORD dwType = 0; + INT iCurrent; + INT iActive = 0; + + RegQueryValueExW(hKey, szKey, NULL, &dwType, (LPBYTE)szBuffer, &dwSize); + + for(iCurrent = 0; iCurrent < iCount; iCurrent++) + { + SendDlgItemMessageW(hWndDlg, iControlId, CB_ADDSTRING, 0, (LPARAM)pSettings[iCurrent].szValue); + + if(dwSize && ((dwType == REG_DWORD && *szBuffer == pSettings[iCurrent].iValue) || + (dwType == REG_SZ && !wcscmp(szBuffer, pSettings[iCurrent].szValue)))) + { + iActive = iCurrent; + } + } + + SendDlgItemMessageW(hWndDlg, iControlId, CB_SETCURSEL, iActive, 0); + } static VOID InitSettings(HWND hWndDlg) { HKEY hKey; - WCHAR szBuffer[MAX_KEY_LENGTH]; - DWORD dwSize = MAX_KEY_LENGTH; - if (RegOpenKeyExW(HKEY_CURRENT_USER, - KEY_WINE, - 0, - KEY_READ, - &hKey) != ERROR_SUCCESS) - { + if (RegCreateKeyExW(HKEY_CURRENT_USER, KEY_WINE, 0, NULL, 0, MAXIMUM_ALLOWED, NULL, &hKey, NULL) != ERROR_SUCCESS) return; - } - if(ReadSetting(hKey, KEY_GLSL, szBuffer, dwSize) == ERROR_SUCCESS) - CheckDlgButton(hWndDlg, IDC_GLSL, (wcscmp(VALUE_DISABLED, szBuffer) != 0) ? BST_CHECKED : BST_UNCHECKED); - - if(ReadSetting(hKey, KEY_MULTISAMPLING, szBuffer, dwSize) == ERROR_SUCCESS) - CheckDlgButton(hWndDlg, IDC_MULTISAMPLING, (wcscmp(VALUE_ENABLED, szBuffer) == 0) ? BST_CHECKED : BST_UNCHECKED); - - if(ReadSetting(hKey, KEY_PIXELSHADERS, szBuffer, dwSize) == ERROR_SUCCESS) - CheckDlgButton(hWndDlg, IDC_PIXELSHADERS, (wcscmp(VALUE_ENABLED, szBuffer) == 0) ? BST_CHECKED : BST_UNCHECKED); - - if(ReadSetting(hKey, KEY_STRICTDRAWORDERING, szBuffer, dwSize) == ERROR_SUCCESS) - CheckDlgButton(hWndDlg, IDC_STRICTDRAWORDERING, (wcscmp(VALUE_ENABLED, szBuffer) == 0) ? BST_CHECKED : BST_UNCHECKED); - - if(ReadSetting(hKey, KEY_VERTEXSHADERS, szBuffer, dwSize) == ERROR_SUCCESS) - CheckDlgButton(hWndDlg, IDC_VERTEXSHADERS, (wcscmp(VALUE_NONE, szBuffer) != 0) ? BST_CHECKED : BST_UNCHECKED); - - SendDlgItemMessageW(hWndDlg, IDC_OFFSCREEN, CB_ADDSTRING, 0, (LPARAM)VALUE_FBO); - SendDlgItemMessageW(hWndDlg, IDC_OFFSCREEN, CB_ADDSTRING, 0, (LPARAM)VALUE_BACKBUFFER); - - SendDlgItemMessageW(hWndDlg, IDC_OFFSCREEN, CB_SETITEMDATA, ITEM_FBO, (LPARAM)ITEM_FBO); - SendDlgItemMessageW(hWndDlg, IDC_OFFSCREEN, CB_SETITEMDATA, ITEM_BACKBUFFER, (LPARAM)ITEM_BACKBUFFER); - - if(ReadSetting(hKey, KEY_OFFSCREEN, szBuffer, dwSize) == ERROR_SUCCESS && !wcscmp(VALUE_BACKBUFFER, szBuffer)) - SendDlgItemMessageW(hWndDlg, IDC_OFFSCREEN, CB_SETCURSEL, 1, 0); - else - SendDlgItemMessageW(hWndDlg, IDC_OFFSCREEN, CB_SETCURSEL, 0, 0); - - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_ADDSTRING, 0, (LPARAM)VALUE_READTEX); - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_ADDSTRING, 0, (LPARAM)VALUE_READDRAW); - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_ADDSTRING, 0, (LPARAM)VALUE_DISABLED); - - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_SETITEMDATA, (WPARAM)ITEM_READTEX, (LPARAM)ITEM_READTEX); - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_SETITEMDATA, (WPARAM)ITEM_READDRAW, (LPARAM)ITEM_READDRAW); - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_SETITEMDATA, (WPARAM)ITEM_DISABLED, (LPARAM)ITEM_DISABLED); - - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_SETCURSEL, 0, 0); - - if(ReadSetting(hKey, KEY_LOCKING, szBuffer, dwSize) == ERROR_SUCCESS) - { - if(!wcscmp(VALUE_READDRAW, szBuffer)) - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_SETCURSEL, 1, 0); - else if(!wcscmp(VALUE_DISABLED, szBuffer)) - SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_SETCURSEL, 2, 0); - } + INIT_CONTROL(GLSL, gwd3dsDisable); + INIT_CONTROL(OFFSCREEN, gwd3dsOffscreen); + INIT_CONTROL(VIDMEMSIZE, gwd3dsVidMem); + INIT_CONTROL(MULTISAMPLING, gwd3dsDisable); + INIT_CONTROL(STRICTDRAWORDERING, gwd3dsEnable); + INIT_CONTROL(ALWAYSOFFSCREEN, gwd3dsEnable); + INIT_CONTROL(DDRENDERER, gwd3dsDdRender); + INIT_CONTROL(PSLEVEL, gwd3dsShaderLvl); + INIT_CONTROL(VSLEVEL, gwd3dsShaderLvl); + INIT_CONTROL(GSLEVEL, gwd3dsShaderLvl); RegCloseKey(hKey); } -static VOID WriteSettings(HWND hWndDlg) -{ - HKEY hKey; - INT iCurSel; - if (RegOpenKeyExW(HKEY_CURRENT_USER, - KEY_WINE, - 0, - KEY_WRITE, - &hKey) != ERROR_SUCCESS) +static VOID SaveSetting(HWND hWnd, HKEY hKey, PWCHAR szKey, PWINED3D_SETTINGS pCfg, INT iControlId, INT iCount) +{ + INT iSel = 0; + + iSel = (INT)SendDlgItemMessageW(hWnd, iControlId, CB_GETCURSEL, 0, 0); + + if(iSel < 0 || iSel > iCount) + return; + + if(pCfg[iSel].iType == REG_NONE) { + RegDeleteValueW(hKey, szKey); return; } - SaveSetting(hKey, KEY_GLSL, (IsDlgButtonChecked(hWndDlg, IDC_GLSL) == BST_CHECKED) ? VALUE_ENABLED : VALUE_DISABLED); - SaveSetting(hKey, KEY_MULTISAMPLING, (IsDlgButtonChecked(hWndDlg, IDC_MULTISAMPLING) == BST_CHECKED) ? VALUE_ENABLED : VALUE_DISABLED); - SaveSetting(hKey, KEY_PIXELSHADERS, (IsDlgButtonChecked(hWndDlg, IDC_PIXELSHADERS) == BST_CHECKED) ? VALUE_ENABLED : VALUE_DISABLED); - SaveSetting(hKey, KEY_STRICTDRAWORDERING, (IsDlgButtonChecked(hWndDlg, IDC_STRICTDRAWORDERING) == BST_CHECKED) ? VALUE_ENABLED : VALUE_DISABLED); - SaveSetting(hKey, KEY_VERTEXSHADERS, (IsDlgButtonChecked(hWndDlg, IDC_VERTEXSHADERS) == BST_CHECKED) ? VALUE_ENABLED : VALUE_NONE); - - iCurSel = (INT)SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_GETCURSEL, 0, 0); - - if(iCurSel != CB_ERR) + if(pCfg[iSel].iType == REG_DWORD) { - iCurSel = (INT)SendDlgItemMessageW(hWndDlg, IDC_LOCKING, CB_GETITEMDATA, (WPARAM)iCurSel, 0); - - if(iCurSel == ITEM_READDRAW) - SaveSetting(hKey, KEY_LOCKING, VALUE_READDRAW); - else if(iCurSel == ITEM_DISABLED) - SaveSetting(hKey, KEY_LOCKING, VALUE_DISABLED); - else - SaveSetting(hKey, KEY_LOCKING, VALUE_READTEX); - } - - iCurSel = (INT)SendDlgItemMessageW(hWndDlg, IDC_OFFSCREEN, CB_GETCURSEL, 0, 0); - - if(iCurSel != CB_ERR) + RegSetValueExW(hKey, szKey, 0, REG_DWORD, (LPBYTE)&pCfg[iSel].iValue, sizeof(pCfg[iSel].iValue)); + return; + } else if (pCfg[iSel].iType == REG_SZ) { - iCurSel = (INT)SendDlgItemMessageW(hWndDlg, IDC_OFFSCREEN, CB_GETITEMDATA, (WPARAM)iCurSel, 0); - - if(iCurSel == ITEM_BACKBUFFER) - SaveSetting(hKey, KEY_OFFSCREEN, VALUE_BACKBUFFER); - else - SaveSetting(hKey, KEY_OFFSCREEN, VALUE_FBO); + RegSetValueExW(hKey, szKey, 0, pCfg[iSel].iType, (LPBYTE)pCfg[iSel].szValue, (wcslen(pCfg[iSel].szValue) + 1) * sizeof(WCHAR)); } +} + + +static VOID WriteSettings(HWND hWndDlg) +{ + HKEY hKey; + + if (RegOpenKeyExW(HKEY_CURRENT_USER, KEY_WINE, 0, KEY_WRITE, &hKey) != ERROR_SUCCESS) + return; + + SAVE_CONTROL(GLSL, gwd3dsDisable); + SAVE_CONTROL(OFFSCREEN, gwd3dsOffscreen); + SAVE_CONTROL(VIDMEMSIZE, gwd3dsVidMem); + SAVE_CONTROL(MULTISAMPLING, gwd3dsDisable); + SAVE_CONTROL(STRICTDRAWORDERING, gwd3dsEnable); + SAVE_CONTROL(ALWAYSOFFSCREEN, gwd3dsEnable); + SAVE_CONTROL(DDRENDERER, gwd3dsDdRender); + SAVE_CONTROL(PSLEVEL, gwd3dsShaderLvl); + SAVE_CONTROL(VSLEVEL, gwd3dsShaderLvl); + SAVE_CONTROL(GSLEVEL, gwd3dsShaderLvl); RegCloseKey(hKey); } @@ -135,20 +154,8 @@ INT_PTR CALLBACK GeneralPageProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM return TRUE; case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDC_GLSL: - case IDC_LOCKING: - case IDC_MULTISAMPLING: - case IDC_OFFSCREEN: - case IDC_PIXELSHADERS: - case IDC_STRICTDRAWORDERING: - case IDC_VERTEXSHADERS: - PropSheet_Changed(GetParent(hWndDlg), hWndDlg); - break; - default: - break; - } + if (LOWORD(wParam) > IDC_MIN && LOWORD(wParam) < IDC_MAX) + PropSheet_Changed(GetParent(hWndDlg), hWndDlg); break; case WM_NOTIFY: diff --git a/reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc b/reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc index 04f380bed57..5aeef2cac91 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc @@ -10,18 +10,29 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Obecné" FONT 8, "MS Shell Dlg" BEGIN - ICON IDI_CPLICON, IDI_CPLICON, 8, 5, 21, 20 - GROUPBOX "Shadery", -1, 5, 35, 230, 65 - AUTOCHECKBOX "Zapnout &GLSL", IDC_GLSL, 15, 50, 150, 10 - AUTOCHECKBOX "Zapnout &pixel shadery", IDC_PIXELSHADERS, 15, 65, 150, 10 - AUTOCHECKBOX "Zapnout &vertex shadery", IDC_VERTEXSHADERS, 15, 80, 150, 10 - GROUPBOX "Renderování", -1, 5, 110, 230, 85 - AUTOCHECKBOX "Vynutit &multisampling", IDC_MULTISAMPLING, 15, 125, 150, 10 - AUTOCHECKBOX "Vynutit &strict draw ordering", IDC_STRICTDRAWORDERING, 15, 140, 150, 10 + ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 + GROUPBOX "Shaders", -1, 5, 25, 230, 80 + LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + GROUPBOX "Rendering", -1, 5, 110, 230, 110 + LTEXT "Multisampling:", -1, 15, 127, 80, 10 + COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 - COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Render target locking:", -1, 15, 175, 72, 10, SS_LEFT - COMBOBOX IDC_LOCKING, 95, 173, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc b/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc index 30f5741b35b..675f15ffb97 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc @@ -5,18 +5,29 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Allgemein" FONT 8, "MS Shell Dlg" BEGIN - ICON IDI_CPLICON, IDI_CPLICON, 8, 5, 21, 20 - GROUPBOX "Shader", -1, 5, 35, 230, 65 - AUTOCHECKBOX "&GLSL aktivieren", IDC_GLSL, 15, 50, 150, 10 - AUTOCHECKBOX "&Pixel Shader aktivieren", IDC_PIXELSHADERS, 15, 65, 150, 10 - AUTOCHECKBOX "&Vertex Shader aktivieren", IDC_VERTEXSHADERS, 15, 80, 150, 10 - GROUPBOX "Rendering", -1, 5, 110, 230, 85 - AUTOCHECKBOX "&Multisampling erzwingen", IDC_MULTISAMPLING, 15, 125, 150, 10 - AUTOCHECKBOX "&Strikte Zeichenreihenfolge erzwingen", IDC_STRICTDRAWORDERING, 15, 140, 150, 10 - LTEXT "Offscreen Rendering:", -1, 15, 157, 80, 10 - COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Render Ziel festlegen:", -1, 15, 175, 72, 10, SS_LEFT - COMBOBOX IDC_LOCKING, 95, 173, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 + GROUPBOX "Shaders", -1, 5, 25, 230, 80 + LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + GROUPBOX "Rendering", -1, 5, 110, 230, 110 + LTEXT "Multisampling:", -1, 15, 127, 80, 10 + COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 + COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/lang/en-US.rc b/reactos/dll/cpl/wined3dcfg/lang/en-US.rc index 905477f3a68..1575e4d55e4 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/en-US.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/en-US.rc @@ -5,18 +5,29 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg" BEGIN - ICON IDI_CPLICON, IDI_CPLICON, 8, 5, 21, 20 - GROUPBOX "Shaders", -1, 5, 35, 230, 65 - AUTOCHECKBOX "Enable &GLSL", IDC_GLSL, 15, 50, 150, 10 - AUTOCHECKBOX "Enable &pixel shaders", IDC_PIXELSHADERS, 15, 65, 150, 10 - AUTOCHECKBOX "Enable &Vertex shaders", IDC_VERTEXSHADERS, 15, 80, 150, 10 - GROUPBOX "Rendering", -1, 5, 110, 230, 85 - AUTOCHECKBOX "Force &multisampling", IDC_MULTISAMPLING, 15, 125, 150, 10 - AUTOCHECKBOX "Force &strict draw ordering", IDC_STRICTDRAWORDERING, 15, 140, 150, 10 + ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 + GROUPBOX "Shaders", -1, 5, 25, 230, 80 + LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + GROUPBOX "Rendering", -1, 5, 110, 230, 110 + LTEXT "Multisampling:", -1, 15, 127, 80, 10 + COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 - COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Render target locking:", -1, 15, 175, 72, 10, SS_LEFT - COMBOBOX IDC_LOCKING, 95, 173, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/lang/he-IL.rc b/reactos/dll/cpl/wined3dcfg/lang/he-IL.rc index 70e2964e047..ebf6a64194b 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/he-IL.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/he-IL.rc @@ -5,18 +5,29 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "כללי" FONT 8, "MS Shell Dlg" BEGIN - ICON IDI_CPLICON, IDI_CPLICON, 8, 5, 21, 20 - GROUPBOX "Shaders", -1, 5, 35, 230, 65 - AUTOCHECKBOX "Enable &GLSL", IDC_GLSL, 15, 50, 150, 10 - AUTOCHECKBOX "Enable &pixel shaders", IDC_PIXELSHADERS, 15, 65, 150, 10 - AUTOCHECKBOX "Enable &Vertex shaders", IDC_VERTEXSHADERS, 15, 80, 150, 10 - GROUPBOX "Rendering", -1, 5, 110, 230, 85 - AUTOCHECKBOX "Force &multisampling", IDC_MULTISAMPLING, 15, 125, 150, 10 - AUTOCHECKBOX "Force &strict draw ordering", IDC_STRICTDRAWORDERING, 15, 140, 150, 10 + ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 + GROUPBOX "Shaders", -1, 5, 25, 230, 80 + LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + GROUPBOX "Rendering", -1, 5, 110, 230, 110 + LTEXT "Multisampling:", -1, 15, 127, 80, 10 + COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 - COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Render target locking:", -1, 15, 175, 72, 10, SS_LEFT - COMBOBOX IDC_LOCKING, 95, 173, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc b/reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc index a6fde23d1d7..3a6a5f39b1d 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc @@ -11,18 +11,29 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Ogólne" FONT 8, "MS Shell Dlg" BEGIN - ICON IDI_CPLICON, IDI_CPLICON, 8, 5, 21, 20 - GROUPBOX "Cieniowanie", -1, 5, 35, 230, 65 - AUTOCHECKBOX "Włącz &GLSL", IDC_GLSL, 15, 50, 150, 10 - AUTOCHECKBOX "Włącz cieniowanie &pikseli", IDC_PIXELSHADERS, 15, 65, 150, 10 - AUTOCHECKBOX "Włącz cieniowanie &werteksów", IDC_VERTEXSHADERS, 15, 80, 150, 10 - GROUPBOX "Renderowanie", -1, 5, 110, 230, 85 - AUTOCHECKBOX "WymuÅ› &multipróbkowanie", IDC_MULTISAMPLING, 15, 125, 150, 10 - AUTOCHECKBOX "WymuÅ› &strict draw ordering", IDC_STRICTDRAWORDERING, 15, 140, 150, 10 - LTEXT "Renderowanie pozaekranowe:", -1, 15, 157, 80, 10 - COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Blokowanie renderowanego obiektu:", -1, 15, 175, 72, 10, SS_LEFT - COMBOBOX IDC_LOCKING, 95, 173, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 + GROUPBOX "Shaders", -1, 5, 25, 230, 80 + LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + GROUPBOX "Rendering", -1, 5, 110, 230, 110 + LTEXT "Multisampling:", -1, 15, 127, 80, 10 + COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 + COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc b/reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc index 6847099c311..f778b43fdd4 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc @@ -7,18 +7,29 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Generale" FONT 8, "MS Shell Dlg" BEGIN - ICON IDI_CPLICON, IDI_CPLICON, 8, 5, 21, 20 - GROUPBOX "Shader", -1, 5, 35, 230, 65 - AUTOCHECKBOX "Activează &GLSL", IDC_GLSL, 15, 50, 150, 10 - AUTOCHECKBOX "Activează &Pixel shader", IDC_PIXELSHADERS, 15, 65, 150, 10 - AUTOCHECKBOX "Activează &Vertex shader", IDC_VERTEXSHADERS, 15, 80, 150, 10 - GROUPBOX "Redare", -1, 5, 110, 230, 85 - AUTOCHECKBOX "Impune &multisampling", IDC_MULTISAMPLING, 15, 125, 150, 10 - AUTOCHECKBOX "Impune &ordine strictă de desenare", IDC_STRICTDRAWORDERING, 15, 140, 150, 10 - LTEXT "Redă extra-ecran (offscreen):", -1, 15, 157, 100, 10 - COMBOBOX IDC_OFFSCREEN, 120, 155, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Redă fixarea È›intei:", -1, 15, 175, 100, 10, SS_LEFT - COMBOBOX IDC_LOCKING, 120, 173, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 + GROUPBOX "Shaders", -1, 5, 25, 230, 80 + LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + GROUPBOX "Rendering", -1, 5, 110, 230, 110 + LTEXT "Multisampling:", -1, 15, 127, 80, 10 + COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 + COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc b/reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc index e09398b9603..7a91a0a9810 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc @@ -9,18 +9,29 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Përgjithshëm" FONT 8, "MS Shell Dlg" BEGIN - ICON IDI_CPLICON, IDI_CPLICON, 8, 5, 21, 20 - GROUPBOX "Strehë", -1, 5, 35, 230, 65 - AUTOCHECKBOX "Mundëso &GLSL", IDC_GLSL, 15, 50, 150, 10 - AUTOCHECKBOX "Mundëso &pixel Strehë", IDC_PIXELSHADERS, 15, 65, 150, 10 - AUTOCHECKBOX "Mundëso &Vertex Strehë", IDC_VERTEXSHADERS, 15, 80, 150, 10 - GROUPBOX "Përpunim", -1, 5, 110, 230, 85 - AUTOCHECKBOX "Detyro shumëshembuj", IDC_MULTISAMPLING, 15, 125, 150, 10 - AUTOCHECKBOX "Detyro urdhër vizatim i rreptë", IDC_STRICTDRAWORDERING, 15, 140, 150, 10 - LTEXT "Strehë jashekrani:", -1, 15, 157, 80, 10 - COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Streho mbylljen objektivit:", -1, 15, 175, 72, 10, SS_LEFT - COMBOBOX IDC_LOCKING, 95, 173, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 + GROUPBOX "Shaders", -1, 5, 25, 230, 80 + LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + GROUPBOX "Rendering", -1, 5, 110, 230, 110 + LTEXT "Multisampling:", -1, 15, 127, 80, 10 + COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 + COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc b/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc index 8f70b5579c0..b5c4b1c0857 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc @@ -7,18 +7,29 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Umûmî" FONT 8, "MS Shell Dlg" BEGIN - ICON IDI_CPLICON, IDI_CPLICON, 8, 5, 21, 20 - GROUPBOX "Shaderler", -1, 5, 35, 230, 65 - AUTOCHECKBOX "&GLSL'yi EtkinleÅŸtir", IDC_GLSL, 15, 50, 150, 10 - AUTOCHECKBOX "&Nokta Shaderleri EtkinleÅŸtir", IDC_PIXELSHADERS, 15, 65, 150, 10 - AUTOCHECKBOX "&Doruk Shaderleri EtkinleÅŸtir", IDC_VERTEXSHADERS, 15, 80, 150, 10 - GROUPBOX "Renderleme", -1, 5, 110, 230, 85 - AUTOCHECKBOX "&Örtüşme Önlemeyi Zorla", IDC_MULTISAMPLING, 15, 125, 150, 10 - AUTOCHECKBOX "&Strict Draw Orderleme'yi Zorla", IDC_STRICTDRAWORDERING, 15, 140, 150, 10 - LTEXT "&Ekran Dışı Renderleme:", -1, 15, 157, 80, 10 - COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "&Render Hedef Kilitlenmesi:", -1, 15, 175, 72, 10, SS_LEFT - COMBOBOX IDC_LOCKING, 95, 173, 90, 50, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 + GROUPBOX "Shaders", -1, 5, 25, 230, 80 + LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + GROUPBOX "Rendering", -1, 5, 110, 230, 110 + LTEXT "Multisampling:", -1, 15, 127, 80, 10 + COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 + COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST + LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/resource.h b/reactos/dll/cpl/wined3dcfg/resource.h index 60cda8343f8..317db4339e6 100644 --- a/reactos/dll/cpl/wined3dcfg/resource.h +++ b/reactos/dll/cpl/wined3dcfg/resource.h @@ -7,13 +7,18 @@ #define IDD_PROPPAGEGENERAL 100 /* Controls */ -#define IDC_PIXELSHADERS 1001 -#define IDC_GLSL 1002 -#define IDC_VERTEXSHADERS 1003 -#define IDC_MULTISAMPLING 1004 -#define IDC_STRICTDRAWORDERING 1005 -#define IDC_OFFSCREEN 1006 -#define IDC_LOCKING 1007 +#define IDC_MIN 1000 +#define IDC_GLSL 1001 +#define IDC_GSLEVEL 1002 +#define IDC_PSLEVEL 1003 +#define IDC_VSLEVEL 1004 +#define IDC_MULTISAMPLING 1005 +#define IDC_STRICTDRAWORDERING 1006 +#define IDC_OFFSCREEN 1007 +#define IDC_VIDMEMSIZE 1008 +#define IDC_ALWAYSOFFSCREEN 1009 +#define IDC_DDRENDERER 1010 +#define IDC_MAX 1011 /* Strings */ #define IDS_CPLNAME 10000 diff --git a/reactos/dll/cpl/wined3dcfg/wined3dcfg.h b/reactos/dll/cpl/wined3dcfg/wined3dcfg.h index 5293d66ab98..350e34d3081 100644 --- a/reactos/dll/cpl/wined3dcfg/wined3dcfg.h +++ b/reactos/dll/cpl/wined3dcfg/wined3dcfg.h @@ -2,7 +2,6 @@ #define _WINED3DCFG_PCH_ #include - #define WIN32_NO_STATUS #include #include @@ -13,31 +12,36 @@ #define MAX_KEY_LENGTH 256 -#define ITEM_FBO 0 -#define ITEM_BACKBUFFER 1 - -#define ITEM_READTEX 0 -#define ITEM_READDRAW 1 -#define ITEM_DISABLED 2 - -#define VALUE_READTEX L"readtex" -#define VALUE_READDRAW L"readdraw" +#define VALUE_GDI L"gdi" #define VALUE_ENABLED L"enabled" #define VALUE_DISABLED L"disabled" #define VALUE_NONE L"none" #define VALUE_BACKBUFFER L"backbuffer" #define VALUE_FBO L"fbo" +#define VALUE_DEFAULT L"default" #define KEY_WINE L"Software\\Wine\\Direct3D" #define KEY_GLSL L"UseGLSL" -#define KEY_VERTEXSHADERS L"VertexShaderMode" -#define KEY_PIXELSHADERS L"PixelShaderMode" +#define KEY_GSLEVEL L"MaxShaderModelGS" +#define KEY_VSLEVEL L"MaxShaderModelVS" +#define KEY_PSLEVEL L"MaxShaderModelPS" #define KEY_STRICTDRAWORDERING L"StrictDrawOrdering" #define KEY_OFFSCREEN L"OffscreenRenderingMode" #define KEY_MULTISAMPLING L"Multisampling" -#define KEY_LOCKING L"RenderTargetLockMode" +#define KEY_VIDMEMSIZE L"VideoMemorySize" +#define KEY_ALWAYSOFFSCREEN L"AlwaysOffscreen" +#define KEY_DDRENDERER L"DirectDrawRenderer" + +#define INIT_CONTROL(a, b) InitControl(hWndDlg, hKey, KEY_##a, b, IDC_##a, sizeof(b)/sizeof(WINED3D_SETTINGS)) +#define SAVE_CONTROL(a, b) SaveSetting(hWndDlg, hKey, KEY_##a, b, IDC_##a, sizeof(b)/sizeof(WINED3D_SETTINGS)) INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +typedef struct _WINED3D_SETTINGS{ + WCHAR szValue[24]; + INT iType; + INT iValue; +} WINED3D_SETTINGS, *PWINED3D_SETTINGS; + #endif /* _WINED3DCFG_PCH_ */ From db2a4e0e50475cf01fcb9fe440990a2874cf535d Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Mon, 19 May 2014 17:33:24 +0000 Subject: [PATCH 22/69] [WINED3DCFG] German translation by ... me. svn path=/trunk/; revision=63372 --- reactos/dll/cpl/wined3dcfg/lang/de-DE.rc | 20 ++++++++++---------- reactos/dll/cpl/wined3dcfg/lang/en-US.rc | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc b/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc index 675f15ffb97..c69db3f1e34 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc @@ -6,25 +6,25 @@ CAPTION "Allgemein" FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 - GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + GROUPBOX "Shader", -1, 5, 25, 230, 80 + LTEXT "GLSL aktivieren", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + LTEXT "Maximaler GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + LTEXT "Maximaler PS Level:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + LTEXT "Maximaler VS Level:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - GROUPBOX "Rendering", -1, 5, 110, 230, 110 + GROUPBOX "Darstellung", -1, 5, 110, 230, 110 LTEXT "Multisampling:", -1, 15, 127, 80, 10 COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + LTEXT "Strikte Zeichenreihenfolge:", -1, 15, 142, 80, 10 COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 + LTEXT "Offscreen Rendering:", -1, 15, 157, 80, 10 COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + LTEXT "Immer Offscreen:", -1, 15, 172, 72, 10, SS_LEFT COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + LTEXT "Videospeicher-Größe:", -1, 15, 187, 72, 10, SS_LEFT COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST diff --git a/reactos/dll/cpl/wined3dcfg/lang/en-US.rc b/reactos/dll/cpl/wined3dcfg/lang/en-US.rc index 1575e4d55e4..cbeccc3bf90 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/en-US.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/en-US.rc @@ -11,7 +11,7 @@ BEGIN COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + LTEXT "Maximum PS Level:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST From c12f161a1ba7225965825752c69220259dd51f29 Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Mon, 19 May 2014 18:00:47 +0000 Subject: [PATCH 23/69] [TRANSLATION] Small improvement of Russian translation CORE-7994 #resolve #comment Committed, thanks for help. svn path=/trunk/; revision=63373 --- reactos/base/applications/cacls/lang/ru-RU.rc | 8 +- .../base/applications/dxdiag/lang/ru-RU.rc | 14 +- .../base/applications/fontview/lang/ru-RU.rc | 4 +- .../base/applications/mplay32/lang/ru-RU.rc | 10 +- .../base/applications/regedit/lang/ru-RU.rc | 148 +++++++++--------- .../base/applications/shutdown/lang/ru-RU.rc | 148 +++++++++--------- .../base/applications/sndrec32/lang/ru-RU.rc | 79 ++++++++++ reactos/base/applications/sndrec32/rsrc.rc | 3 + .../base/applications/sndvol32/lang/ru-RU.rc | 8 +- reactos/base/setup/reactos/lang/ru-RU.rc | 6 +- reactos/base/shell/explorer-new/lang/ru-RU.rc | 26 +-- reactos/dll/cpl/desk/lang/ru-RU.rc | 14 +- reactos/dll/cpl/mmsys/lang/ru-RU.rc | 2 +- reactos/dll/win32/aclui/lang/ru-RU.rc | 2 +- 14 files changed, 279 insertions(+), 193 deletions(-) create mode 100644 reactos/base/applications/sndrec32/lang/ru-RU.rc diff --git a/reactos/base/applications/cacls/lang/ru-RU.rc b/reactos/base/applications/cacls/lang/ru-RU.rc index 72f0fe7c48a..a52e892ff34 100644 --- a/reactos/base/applications/cacls/lang/ru-RU.rc +++ b/reactos/base/applications/cacls/lang/ru-RU.rc @@ -2,7 +2,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT STRINGTABLE BEGIN - IDS_HELP "Отображает или изменÑет ÑпиÑки доÑтупа (ACLs) к файлам\n\n\ + IDS_HELP "Отображает или изменÑет ÑпиÑки доÑтупа (Access Control Lists, ACLs) к файлам\n\n\ CACLS имÑ_Файла [/T] [/E] [/C] [/G имÑ:право [...]] [/R Ð¸Ð¼Ñ [...]]\n\ [/P имÑ:право[...]] [/D Ð¸Ð¼Ñ [...]]\n\ имÑ_файла Вывод ÑпиÑков ACL.\n\ @@ -27,11 +27,11 @@ CACLS имÑ_Файла [/T] [/E] [/C] [/G имÑ:право [...]] [/R Ð¸Ð¼Ñ [ Ð’ команде можно иÑпользовать шаблоны Ð´Ð»Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸ более одного файла.\n\ Ð’ команде можно указывать более одного пользователÑ.\n\n\ СокращениÑ:\n\ - CI - ÐаÑледование контейнерами.\n\ + CI - ÐаÑледование контейнерами (Container Inherit).\n\ ACE будет унаÑледован папками.\n\ - OI - ÐаÑледование объектами.\n\ + OI - ÐаÑледование объектами (Object Inherit).\n\ ACE будет унаÑледован файлами.\n\ - IO - Только наÑледованное.\n\ + IO - Только наÑледованное (Inherit Only).\n\ ACE не будет применён к данному файлу/папке.\n" IDS_ABBR_CI "(CI)" IDS_ABBR_OI "(OI)" diff --git a/reactos/base/applications/dxdiag/lang/ru-RU.rc b/reactos/base/applications/dxdiag/lang/ru-RU.rc index 0f66564e786..a8aa8236f71 100644 --- a/reactos/base/applications/dxdiag/lang/ru-RU.rc +++ b/reactos/base/applications/dxdiag/lang/ru-RU.rc @@ -207,15 +207,15 @@ BEGIN IDS_REG_FAIL "Ошибка" IDS_DDTEST_ERROR "Сбой в проверке!" IDS_DDTEST_DESCRIPTION "Будет произведена проверка DirecDraw на Ñтом уÑтройÑтве. Продолжить?" - IDS_DDPRIMARY_DESCRIPTION "This test will use DirectDraw to draw on primary surface. Black and white rectangles should be drawn. Продолжить?" + IDS_DDPRIMARY_DESCRIPTION "Ð’ Ñтом теÑте будет проверена возможноÑть риÑÐ¾Ð²Ð°Ð½Ð¸Ñ DirectDraw на оÑновной поверхноÑти Ñкрана. Должны быть видны черные и белые прÑмоугольники. Продолжить?" IDS_DDPRIMARY_RESULT "Ð’Ñ‹ видели черные и белые прÑмоугольники?" - IDS_DDOFFSCREEN_DESCRIPTION "This test will use DirectDraw to draw in an offscreen buffer. Moving white rectangle should be drawn. Продолжить?" - IDS_DDOFFSCREEN_RESULT "Ð’Ñ‹ видели перемещающийÑÑ Ð±ÐµÐ»Ñ‹Ð¹ прÑмоугольник?" - IDS_DDFULLSCREEN_DESCRIPTION "This test will use DirectDraw to draw in a fullscreen mode. Moving white rectangle should be drawn. Продолжить?" - IDS_DDFULLSCREEN_RESULT "Ð’Ñ‹ видели белый перемешающийÑÑ Ð¿Ñ€Ñмоугольник в полноÑкранном режиме?" + IDS_DDOFFSCREEN_DESCRIPTION "Ð’ Ñтом теÑте будет проверена возможноÑть риÑÐ¾Ð²Ð°Ð½Ð¸Ñ DirectDraw на закадровой поверхноÑти Ñкрана. Должен быть виден двигающийÑÑ Ð±ÐµÐ»Ñ‹Ð¹ квадратик. Продолжить?" + IDS_DDOFFSCREEN_RESULT "Ð’Ñ‹ видели двигающийÑÑ Ð±ÐµÐ»Ñ‹Ð¹ квадратик?" + IDS_DDFULLSCREEN_DESCRIPTION "Ð’ Ñтом теÑте будет проверена возможноÑть риÑÐ¾Ð²Ð°Ð½Ð¸Ñ DirectDraw в полноÑкранном режиме. Должен быть виден двигающийÑÑ Ð±ÐµÐ»Ñ‹Ð¹ квадратик. Продолжить?" + IDS_DDFULLSCREEN_RESULT "Ð’Ñ‹ видели белый двигающийÑÑ ÐºÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð¸Ðº в полноÑкранном режиме?" IDS_FORMAT_ADAPTER_MEM "%u Мб" IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u бит)(%uГц)" IDS_OPTION_NO "Ðет" - IDS_D3DTEST_DESCRIPTION "This will start Direct3D interface test. Continue?" - IDS_D3DTEST_D3Dx "This test will use hardware-accelerated Direct3D %u interface." + IDS_D3DTEST_DESCRIPTION "Будет произведена проверка Direct3D на Ñтом уÑтройÑтве. Продолжить?" + IDS_D3DTEST_D3Dx "Этот теÑÑ‚ будет иÑпользовать Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Direct3D %u Ñ Ð°Ð¿Ð¿Ð°Ñ€Ð°Ñ‚Ð½Ñ‹Ð¼ уÑкорением." END diff --git a/reactos/base/applications/fontview/lang/ru-RU.rc b/reactos/base/applications/fontview/lang/ru-RU.rc index 6dd382f71f0..7cda19f3565 100644 --- a/reactos/base/applications/fontview/lang/ru-RU.rc +++ b/reactos/base/applications/fontview/lang/ru-RU.rc @@ -4,10 +4,10 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT STRINGTABLE BEGIN - IDS_INSTALL "Install" + IDS_INSTALL "УÑтановить" IDS_PRINT "Печать" IDS_STRING "Ð’ чащах юга жил бы цитруÑ? Да, но фальшивый ÑкземплÑÑ€! 1234567890" - IDS_OPEN "Open Font..." + IDS_OPEN "Открыть шрифт..." IDS_ERROR "Ошибка" IDS_ERROR_NOMEM "ÐедоÑтаточно памÑти, чтобы завершить операцию." IDS_ERROR_NOFONT "%1 не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ файлом шрифта." diff --git a/reactos/base/applications/mplay32/lang/ru-RU.rc b/reactos/base/applications/mplay32/lang/ru-RU.rc index 260b738898b..b30e8ad8b4a 100644 --- a/reactos/base/applications/mplay32/lang/ru-RU.rc +++ b/reactos/base/applications/mplay32/lang/ru-RU.rc @@ -9,11 +9,11 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Выход", IDM_EXIT END - POPUP "&Device" + POPUP "&УÑтройÑтво" BEGIN - MENUITEM "&Properties", IDM_DEVPROPS + MENUITEM "&СвойÑтва", IDM_DEVPROPS MENUITEM SEPARATOR - MENUITEM "&Volume Control", IDM_VOLUMECTL + MENUITEM "&ГромкоÑть", IDM_VOLUMECTL END POPUP "&Помощь" BEGIN @@ -33,6 +33,6 @@ BEGIN IDS_TOOLTIP_FORWARD "Вперед" IDS_APPTITLE "Проигрыватель ReactOS" IDS_PLAY "ВоÑпроизвеÑти" - IDS_DEFAULTMCIERRMSG "No description is available for this error" - IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." + IDS_DEFAULTMCIERRMSG "ÐеизвеÑÑ‚Ð½Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°." + IDS_UNKNOWNFILEEXT "Ðевозможно определить тип уÑтройÑтва мультимедиа Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð°." END diff --git a/reactos/base/applications/regedit/lang/ru-RU.rc b/reactos/base/applications/regedit/lang/ru-RU.rc index 160d6444bd2..45ef7d80833 100644 --- a/reactos/base/applications/regedit/lang/ru-RU.rc +++ b/reactos/base/applications/regedit/lang/ru-RU.rc @@ -52,7 +52,7 @@ BEGIN MENUITEM "&Строковый параметр", ID_EDIT_NEW_STRINGVALUE MENUITEM "&Двоичный параметр", ID_EDIT_NEW_BINARYVALUE MENUITEM "&Параметр DWORD", ID_EDIT_NEW_DWORDVALUE - MENUITEM "&МультиÑтроковый параметр", ID_EDIT_NEW_MULTISTRINGVALUE + MENUITEM "&МногоÑтрочный параметр", ID_EDIT_NEW_MULTISTRINGVALUE MENUITEM "РаÑ&ширÑемый Ñтроковый параметр", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END MENUITEM SEPARATOR @@ -106,8 +106,8 @@ BEGIN MENUITEM "&Строковый параметр", ID_EDIT_NEW_STRINGVALUE MENUITEM "&Двоичный параметр", ID_EDIT_NEW_BINARYVALUE MENUITEM "&Параметр DWORD", ID_EDIT_NEW_DWORDVALUE - MENUITEM "&Multi-String Value", ID_EDIT_NEW_MULTISTRINGVALUE - MENUITEM "&Expandable String Value", ID_EDIT_NEW_EXPANDABLESTRINGVALUE + MENUITEM "&МногоÑтрочный параметр", ID_EDIT_NEW_MULTISTRINGVALUE + MENUITEM "РаÑ&ширÑемый Ñтроковый параметр", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END END POPUP "" @@ -120,8 +120,8 @@ BEGIN MENUITEM "&Строковый параметр", ID_EDIT_NEW_STRINGVALUE MENUITEM "&Двоичный параметр", ID_EDIT_NEW_BINARYVALUE MENUITEM "&Параметр DWORD", ID_EDIT_NEW_DWORDVALUE - MENUITEM "&Multi-String Value", ID_EDIT_NEW_MULTISTRINGVALUE - MENUITEM "&Expandable String Value", ID_EDIT_NEW_EXPANDABLESTRINGVALUE + MENUITEM "&МногоÑтрочный параметр", ID_EDIT_NEW_MULTISTRINGVALUE + MENUITEM "РаÑ&ширÑемый Ñтроковый параметр", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END MENUITEM "&Ðайти", ID_EDIT_FIND MENUITEM SEPARATOR @@ -135,12 +135,12 @@ BEGIN END POPUP "" BEGIN - MENUITEM "C&ut", ID_HEXEDIT_CUT - MENUITEM "&Copy", ID_HEXEDIT_COPY - MENUITEM "&Paste", ID_HEXEDIT_PASTE - MENUITEM "&Delete", ID_HEXEDIT_DELETE + MENUITEM "&Вырезать", ID_HEXEDIT_CUT + MENUITEM "&Копировать", ID_HEXEDIT_COPY + MENUITEM "Ð’ÑÑ‚&авить", ID_HEXEDIT_PASTE + MENUITEM "&Удалить", ID_HEXEDIT_DELETE MENUITEM SEPARATOR - MENUITEM "Select &All", ID_HEXEDIT_SELECT_ALL + MENUITEM "Ð’Ñ‹&делить вÑе", ID_HEXEDIT_SELECT_ALL END END @@ -204,50 +204,50 @@ END IDD_EDIT_RESOURCE_LIST DIALOGEX 32, 24, 170, 120 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Resource List" +CAPTION "СпиÑки реÑурÑов" FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_RESOURCE_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 10, 150, 75 DEFPUSHBUTTON "OK", IDOK, 27, 100, 50, 14 - PUSHBUTTON "Show...", IDC_SHOW_RESOURCE, 93, 100, 50, 14, WS_DISABLED + PUSHBUTTON "Показать...", IDC_SHOW_RESOURCE, 93, 100, 50, 14, WS_DISABLED END IDD_EDIT_RESOURCE DIALOGEX 6, 18, 281, 283 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Resources" +CAPTION "РеÑурÑÑ‹" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "DMA:", IDC_STATIC, 10, 5, 20, 8 + LTEXT "Канал DMA:", IDC_STATIC, 10, 5, 20, 8 CONTROL "", IDC_DMA_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 15, 261, 31 - LTEXT "Interrupt:", IDC_STATIC, 10, 48, 35, 8 + LTEXT "Прерывание:", IDC_STATIC, 10, 48, 35, 8 CONTROL "", IDC_IRQ_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 58, 261, 31 - LTEXT "Memory:", IDC_STATIC, 10, 91, 32, 8 + LTEXT "ПамÑть:", IDC_STATIC, 10, 91, 32, 8 CONTROL "", IDC_MEMORY_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 101, 261, 31 - LTEXT "Port:", IDC_STATIC, 10, 134, 38, 8 + LTEXT "Порт:", IDC_STATIC, 10, 134, 38, 8 CONTROL "", IDC_PORT_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 144, 261, 31 - LTEXT "Device specific data:", IDC_STATIC, 10, 177, 80, 8 + LTEXT "Даннные уÑтройÑтва:", IDC_STATIC, 10, 177, 80, 8 CONTROL "", IDC_DEVICE_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 188, 261, 31 - GROUPBOX "Usage", IDC_STATIC, 10, 219, 125, 39 - LTEXT "Undetermined", IDC_UNDETERMINED, 18, 230, 46, 8, WS_DISABLED - LTEXT "Shared", IDC_SHARED, 18, 240, 48, 8, WS_DISABLED - LTEXT "Device exclusive", IDC_DEVICE_EXCLUSIVE, 72, 230, 58, 8, WS_DISABLED - LTEXT "Driver exclusive", IDC_DRIVER_EXCLUSIVE, 72, 240, 54, 8, WS_DISABLED - RTEXT "Interface Type:", IDC_STATIC, 144, 220, 58, 8 + GROUPBOX "Ðазначение", IDC_STATIC, 10, 219, 125, 39 + LTEXT "Ðе определено", IDC_UNDETERMINED, 18, 230, 46, 8, WS_DISABLED + LTEXT "Общий реÑурÑ", IDC_SHARED, 18, 240, 48, 8, WS_DISABLED + LTEXT "Ð”Ð»Ñ ÑƒÑтройÑтва", IDC_DEVICE_EXCLUSIVE, 72, 230, 58, 8, WS_DISABLED + LTEXT "Ð”Ð»Ñ Ð´Ñ€Ð°Ð¹Ð²ÐµÑ€Ð°", IDC_DRIVER_EXCLUSIVE, 72, 240, 54, 8, WS_DISABLED + RTEXT "Тип интерфейÑа:", IDC_STATIC, 144, 220, 58, 8 LTEXT "", IDC_INTERFACETYPE, 205, 220, 66, 8 - RTEXT "Bus Nummer:", IDC_STATIC, 151, 230, 51, 8 + RTEXT "Ðомер шины:", IDC_STATIC, 151, 230, 51, 8 LTEXT "", IDC_BUSNUMBER, 205, 230, 66, 8 - RTEXT "Version:", IDC_STATIC, 151, 240, 51, 8 + RTEXT "ВерÑиÑ:", IDC_STATIC, 151, 240, 51, 8 LTEXT "", IDC_VERSION, 205, 240, 66, 8 - RTEXT "Revision:", IDC_STATIC, 151, 250, 51, 8 + RTEXT "РедакциÑ:", IDC_STATIC, 151, 250, 51, 8 LTEXT "", IDC_REVISION, 205, 250, 66, 8 DEFPUSHBUTTON "OK", IDOK, 92, 263, 40, 14 - PUSHBUTTON "&Data...", IDC_SHOW_RESOURCE_DATA, 148, 263, 40, 14, WS_DISABLED + PUSHBUTTON "&Данные...", IDC_SHOW_RESOURCE_DATA, 148, 263, 40, 14, WS_DISABLED END /* String Tables */ @@ -285,11 +285,11 @@ BEGIN ID_EDIT_NEW_DWORDVALUE "ДобавлÑет новое DWORD-значение" ID_REGISTRY_IMPORTREGISTRYFILE "Импортирует текÑтовой файл в рееÑтр" ID_REGISTRY_EXPORTREGISTRYFILE "ЭкÑпортирует веÑÑŒ рееÑтр или его чаÑть в текÑтовой файл" - ID_REGISTRY_LOADHIVE "Loads a hive file into the registry" - ID_REGISTRY_UNLOADHIVE "Unloads a hive from the registry" + ID_REGISTRY_LOADHIVE "Загрузить файл куÑта рееÑтра в рееÑтр" + ID_REGISTRY_UNLOADHIVE "Выгрузить куÑÑ‚ рееÑтра" ID_REGISTRY_CONNECTNETWORKREGISTRY "ПодключаетÑÑ Ðº рееÑтру удалённого компьютера" ID_REGISTRY_DISCONNECTNETWORKREGISTRY "ОтключаетÑÑ Ð¾Ñ‚ рееÑтра удалённого компьютера" - ID_REGISTRY_PRINT "Печатает веÑÑŒ рееÑтр или ого чаÑть" + ID_REGISTRY_PRINT "Печатает веÑÑŒ рееÑтр или его чаÑть" /* ID_HELP_HELPTOPICS "Открывает Ñправку редактора рееÑтра" */ ID_HELP_ABOUT "Отображает информацию о программе, номер верÑии и авторÑкие права" END @@ -328,8 +328,8 @@ BEGIN IDS_ERR_DELETEVALUE "Ðевозможно удалить вÑе указанные значениÑ!" IDS_ERR_RENVAL_CAPTION "Ошибка Ð¿ÐµÑ€ÐµÐ¸Ð¼ÐµÐ½Ð¾Ð²Ð°Ð½Ð¸Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ" IDS_ERR_RENVAL_TOEMPTY "Ðевозможно переименовать %s. Указанное значение не пуÑтое. Введите другое значение и повторите попытку." - IDS_QUERY_IMPORT_HIVE_CAPTION "Confirm Key Restoration" - IDS_QUERY_IMPORT_HIVE_MSG "A key will be restored on top of the currently selected key.\nAll values and subkeys of this key will be deleted.\nDo you want to continue the operation?" + IDS_QUERY_IMPORT_HIVE_CAPTION "Подтвердите воÑÑтановление раздела" + IDS_QUERY_IMPORT_HIVE_MSG "Раздел будет воÑÑтановлен поверх текущего выбранного раздела.\nÐ’Ñе параметры и подразделы будут удалены.\nПродолжить выполнение операции?" IDS_NEW_KEY "Ðовый ключ #%d" IDS_NEW_VALUE "Ðовое значение #%d" END @@ -343,8 +343,8 @@ BEGIN IDS_MY_COMPUTER "Мой компьютер" IDS_IMPORT_REG_FILE "Импортирование файла рееÑтра" IDS_EXPORT_REG_FILE "ЭкÑпортирование файла рееÑтра" - IDS_LOAD_HIVE "Load Hive" - IDS_UNLOAD_HIVE "Unload Hive" + IDS_LOAD_HIVE "Загрузить куÑÑ‚" + IDS_UNLOAD_HIVE "Выгрузить куÑÑ‚" IDS_INVALID_DWORD "(неправильное значение DWORD)" END @@ -353,7 +353,7 @@ BEGIN IDS_FLT_REGFILE "Файл рееÑтра" IDS_FLT_REGFILES "Файлы рееÑтра (*.reg)" IDS_FLT_REGFILES_FLT "*.reg" - IDS_FLT_HIVFILES "Registry Hive Files (*.*)" + IDS_FLT_HIVFILES "Файлы куÑтов рееÑтра (*.*)" IDS_FLT_HIVFILES_FLT "*.*" IDS_FLT_REGEDIT4 "Файлы рееÑтра Win9x/NT4 (REGEDIT4) (*.reg)" IDS_FLT_REGEDIT4_FLT "*.reg" @@ -394,48 +394,48 @@ END STRINGTABLE BEGIN - IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly.\nIf you do not trust the source of this information in '%s', do not add it to registry.\n\nAre you sure you want to continue?" - IDS_IMPORT_OK "The keys and values contained in '%s' have been successfully added to the registry." - IDS_IMPORT_ERROR "Cannot import '%s': Error opening the file. There may be a disk, file system error or file may not exist." - IDS_EXPORT_ERROR "Cannot export '%s': Error creating or writing to the file. There may be a disk or file system error." + IDS_IMPORT_PROMPT "Ð’Ñ‹ уверены, что хотите добавить данные из файла '%s'?\n Добавление информации из непроверенных иÑточников может непреднамеренно изменить или удалить некоторые Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¸ привеÑти к неÑтабильной работе ÑиÑтемы.\n ЕÑли вы не доверÑете иÑточнику Ñтого файла, не добавлÑйте данные в рееÑтр." + IDS_IMPORT_OK "Ð—Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¸Ð· файла '%s' были уÑпешно добавлены в рееÑтр." + IDS_IMPORT_ERROR "Ðе удаетÑÑ Ð¸Ð¼Ð¿Ð¾Ñ€Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ñ‚ÑŒ файл '%s': Ошибка при открытии файла." + IDS_EXPORT_ERROR "Ðе удаетÑÑ ÑкÑпортировать данные в файл '%s': Ошибка при запиÑи в файл." END STRINGTABLE BEGIN - IDS_BUSNUMBER "Bus Number" - IDS_INTERFACE "Interface" - IDS_DMA_CHANNEL "Channel" - IDS_DMA_PORT "Port" - IDS_INTERRUPT_VECTOR "Vector" - IDS_INTERRUPT_LEVEL "Level" - IDS_INTERRUPT_AFFINITY "Affinity" - IDS_INTERRUPT_TYPE "Type" - IDS_MEMORY_ADDRESS "Physical Address" - IDS_MEMORY_LENGTH "Length" - IDS_MEMORY_ACCESS "Access" - IDS_PORT_ADDRESS "Physical Address" - IDS_PORT_LENGTH "Length" - IDS_PORT_ACCESS "Access" - IDS_SPECIFIC_RESERVED1 "Reserved 1" - IDS_SPECIFIC_RESERVED2 "Reserved 2" - IDS_SPECIFIC_DATASIZE "Data Size" + IDS_BUSNUMBER "Ðомер шины" + IDS_INTERFACE "ИнтерфейÑ" + IDS_DMA_CHANNEL "Канал" + IDS_DMA_PORT "Порт" + IDS_INTERRUPT_VECTOR "Вектор" + IDS_INTERRUPT_LEVEL "Уровень" + IDS_INTERRUPT_AFFINITY "РодÑтво" + IDS_INTERRUPT_TYPE "Тип" + IDS_MEMORY_ADDRESS "ФизичеÑкий адреÑ" + IDS_MEMORY_LENGTH "Длина" + IDS_MEMORY_ACCESS "ДоÑтуп" + IDS_PORT_ADDRESS "ФизичеÑкий адреÑ" + IDS_PORT_LENGTH "Длина" + IDS_PORT_ACCESS "ДоÑтуп" + IDS_SPECIFIC_RESERVED1 "Резерв1" + IDS_SPECIFIC_RESERVED2 "Резерв2" + IDS_SPECIFIC_DATASIZE "Объем данных" END STRINGTABLE BEGIN - IDS_PORT_PORT_IO "Port" - IDS_PORT_MEMORY_IO "Memory" - IDS_INTERRUPT_EDGE_SENSITIVE "Edge Sensitive" - IDS_INTERRUPT_LEVEL_SENSITIVE "Level Sensitive" - IDS_MEMORY_READ_ONLY "Read Only" - IDS_MEMORY_WRITE_ONLY "Write Only" - IDS_MEMORY_READ_WRITE "Read / Write" + IDS_PORT_PORT_IO "Порт" + IDS_PORT_MEMORY_IO "ПамÑть" + IDS_INTERRUPT_EDGE_SENSITIVE "С учетом задвижки" + IDS_INTERRUPT_LEVEL_SENSITIVE "С учетом уровнÑ" + IDS_MEMORY_READ_ONLY "Только чтение" + IDS_MEMORY_WRITE_ONLY "Только запиÑÑŒ" + IDS_MEMORY_READ_WRITE "Чтение и запиÑÑŒ" END STRINGTABLE BEGIN - IDS_BUS_UNDEFINED "Undefined" - IDS_BUS_INTERNAL "Internal" + IDS_BUS_UNDEFINED "Ðеправильно" + IDS_BUS_INTERNAL "Внутренний" IDS_BUS_ISA "ISA" IDS_BUS_EISA "EISA" IDS_BUS_MICROCHANNEL "MicroChannel" @@ -447,11 +447,11 @@ BEGIN IDS_BUS_CBUS "C-Bus" IDS_BUS_MPIBUS "MPI-Bus" IDS_BUS_MPSABUS "MPSA-Bus" - IDS_BUS_PROCESSORINTERNAL "Processor Internal" - IDS_BUS_INTERNALPOWERBUS "Internal Power Bus" - IDS_BUS_PNPISABUS "PnP-ISA Bus" - IDS_BUS_PNPBUS "PnP Bus" - IDS_BUS_UNKNOWNTYPE "Unknown Interface Type" + IDS_BUS_PROCESSORINTERNAL "ВнутреннÑÑ ÑˆÐ¸Ð½Ð° процеÑÑора" + IDS_BUS_INTERNALPOWERBUS "ВнутреннÑÑ ÑˆÐ¸Ð½Ð° питаниÑ" + IDS_BUS_PNPISABUS "Шина PnP-ISA" + IDS_BUS_PNPBUS "Шина PnP" + IDS_BUS_UNKNOWNTYPE "ÐеизвеÑтный тип интерфейÑа" END /*****************************************************************/ @@ -470,13 +470,13 @@ END IDD_LOADHIVE DIALOGEX 0, 0, 193, 34 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Load Hive" +CAPTION "Загрузить куÑÑ‚" FONT 8, "Ms Shell Dlg" BEGIN - LTEXT "&Key:", IDC_STATIC, 4, 4, 15, 8, SS_LEFT + LTEXT "&Значение:", IDC_STATIC, 4, 4, 15, 8, SS_LEFT EDITTEXT IDC_EDIT_KEY, 23, 2, 167, 13 DEFPUSHBUTTON "OK", IDOK, 140, 17, 50, 14 - PUSHBUTTON "Cancel", IDCANCEL, 89, 17, 50, 14 + PUSHBUTTON "Отмена", IDCANCEL, 89, 17, 50, 14 END IDD_ADDFAVORITES DIALOGEX 0, 0, 187, 95 diff --git a/reactos/base/applications/shutdown/lang/ru-RU.rc b/reactos/base/applications/shutdown/lang/ru-RU.rc index bb944a716f9..2ec5dbc05e2 100644 --- a/reactos/base/applications/shutdown/lang/ru-RU.rc +++ b/reactos/base/applications/shutdown/lang/ru-RU.rc @@ -3,101 +3,105 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT /* Dialog */ IDD_GUI DIALOGEX 0, 0, 240, 255 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Remote Shutdown" +CAPTION "Удаленное завершение работы" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "&OK", IDC_OK, 125, 232, 50, 14 - PUSHBUTTON "&Cancel", IDC_CANCEL, 178, 232, 50, 14 - LTEXT "Co&mputers:", IDC_STATIC, 9, 9, 35, 36 + DEFPUSHBUTTON "&ОК", IDC_OK, 125, 232, 50, 14 + PUSHBUTTON "О&тмена", IDC_CANCEL, 178, 232, 50, 14 + LTEXT "&Компьютеры:", IDC_STATIC, 9, 9, 50, 8 LISTBOX IDC_COMPUTER_LIST, 8, 19, 162, 55 - PUSHBUTTON "&Add...", IDC_ADD_SYSTEM, 179, 19, 50, 14 - PUSHBUTTON "&Remove", IDC_REMOVE_SYSTEM, 179, 36, 50, 14, WS_DISABLED - PUSHBUTTON "&Browse...", IDC_BROWSE_SYSTEM, 179, 53, 50, 14 - LTEXT "Action", IDC_ACTION, 11, 81, 20, 14 + PUSHBUTTON "&Добавить...", IDC_ADD_SYSTEM, 179, 19, 50, 14 + PUSHBUTTON "&Удалить", IDC_REMOVE_SYSTEM, 179, 36, 50, 14, WS_DISABLED + PUSHBUTTON "&Обзор...", IDC_BROWSE_SYSTEM, 179, 53, 50, 14 + LTEXT "&Желаемое дейÑтвие Ð´Ð»Ñ ÐºÐ¾Ð¼Ð¿ÑŒÑŽÑ‚ÐµÑ€Ð¾Ð²:", IDC_ACTION, 11, 81, 170, 14 COMBOBOX IDC_ACTION_TYPE, 37, 79, 129, 14, WS_TABSTOP | CBS_DROPDOWN - CHECKBOX "Warn users", IDC_WARN_USERS, 175, 79, 55, 14, BS_AUTOCHECKBOX | WS_TABSTOP - LTEXT "Display warning for", IDC_SHOW_WARN_ONE, 11, 99, 65, 14 + CHECKBOX "&Предупредить пользователей", IDC_WARN_USERS, 175, 79, 120, 14, BS_AUTOCHECKBOX | WS_TABSTOP + LTEXT "По&казывать предупреждение в течение: ", IDC_SHOW_WARN_ONE, 11, 99, 146, 14 EDITTEXT IDC_SHOW_WARN, 78, 97, 41, 14 - LTEXT "second(s)", IDC_SHOW_WARN_TWO, 124, 99, 32, 10 - GROUPBOX "Shutdown Event Tracker", IDC_STATIC, 5, 114, 224, 114 - LTEXT "Reason:", IDC_STATIC, 16, 130, 27, 8 - CHECKBOX "Planned", IDC_PLANNED, 175, 130, 40, 12, BS_AUTOCHECKBOX | WS_TABSTOP + LTEXT "Ñек.", IDC_SHOW_WARN_TWO, 124, 99, 32, 10 + GROUPBOX "РегиÑÑ‚Ñ€Ð°Ñ†Ð¸Ñ Ñобытий Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹", IDC_STATIC, 5, 114, 224, 114 + LTEXT "Причина:", IDC_STATIC, 16, 130, 27, 8 + CHECKBOX "Запланировано", IDC_PLANNED, 165, 125, 55, 12, BS_AUTOCHECKBOX | WS_TABSTOP COMBOBOX IDC_REASON_CODE, 17, 142, 198, 13, WS_TABSTOP | CBS_DROPDOWN - LTEXT "Comm&ent:", IDC_COMMENT_CAPTION, 16, 159, 38, 8 + LTEXT "Комме&нтарий:", IDC_COMMENT_CAPTION, 16, 159, 51, 8 EDITTEXT IDC_COMMENT_TEXT, 17, 171, 198, 50, WS_VSCROLL END /* Information and error messages */ STRINGTABLE BEGIN - IDS_USAGE "ReactOS Shutdown Utility\n\ + IDS_USAGE "Утилита Ð²Ñ‹ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ ReactOS\n\ \n\ -Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n\ - [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\ +ИÑпользование: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n\ + [/m \\\\<компьютер>][/t xxx][/d [p|u:]xx:yy [/c ""комментарий""]]\n\ \n\ - No arguments or /? Display this help.\n\ - /i Show the graphical user interface (GUI). This option must be the\n\ - first one.\n\ - /l Log off on the local system only. Cannot be used with /m or /d.\n\ - /s Shutdown the computer.\n\ - /r Restart the computer.\n\ - /g Restart the computer and restart all the registered applications.\n\ - /a Cancel a delayed shutdown. Can only be used during the delay\n\ - period.\n\ - /p Shutdown the local computer without any timeout or warning. Can be\n\ - used with /d or /f.\n\ - /h Hibernate the local computer. Usable with /f.\n\ - /e Document the reason for the unexpected computer shutdown.\n\ - /m \\\\computer Specify the target computer (UNC/IP address).\n\ - /t xxx Set the timeout period to xxx seconds before shutting down.\n\ - The valid range starts from 0 to 315360000 (10 years),\n\ - 30 being the default value.\n\ - /c ""comment"" Comment on the reason for shutdown or restart.\n\ - 512 characters maximum allowed.\n\ - /f Force running applications to close without warning users. If you\n\ - do not specify any other parameter, this option will also log off.\n\ - /d [p|u:]xx:yy Give the reason code for the shutdown or the restart.\n\ - p indicates that the shutdown or the restart is planned.\n\ - u indicates that the reason is defined by the user.\n\ - If neither p nor u are specified, the shutdown or the restart are\n\ - not planned.\n\ - xx is the major reason code (positive integer smaller than 256).\n\ - yy is the minor reason code (positive integer smaller than 65536).\n" + Без аргументов или /? Показывает Ñту Ñправку.\n\ + /i Показать диалог удаленного выключениÑ. Этот параметр должен\n\ + указыватьÑÑ Ð¿ÐµÑ€Ð²Ñ‹Ð¼.\n\ + /l Выход из ÑиÑтемы. (не ÑовмеÑтим Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°Ð¼Ð¸ /m или /d.\n\ + /s Выключить комьпьютер.\n\ + /r Перезагрузить компьютер.\n\ + /g Перезагрузить компьютер и перезапуÑтить вÑе зарегиÑтрированные\n\ + приложениÑ.\ + /a Отменить отложенное выключение. Может иÑпользоватьÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ в\n\ + течение периода Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ð²Ñ‹ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ.\ + /p Выключить локальный компьютер без вÑÑких задержек или \n\ + предупреждений. Может иÑпользоватьÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°Ð¼Ð¸ /d или /f.\n\ + /h ПеревеÑти локальный компьютер в режим гибернации (""ÑпÑщий \n\ + режим""). Может иÑпользоватьÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ /f.\n\ + /e Задокументировать причину неожиданного Ð²Ñ‹ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ ÐºÐ¾Ð¼Ð¿ÑŒÑŽÑ‚ÐµÑ€Ð°.\n\ + /m \\\\<компьютер> Удаленный компьютер, на котором выполнÑетÑÑ Ð´ÐµÐ¹Ñтвие.\n\ + (UNC/IP адреÑ).\n\ + /t xxx УÑтанавливает Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ð´Ð¾ xxx Ñек. до Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹.\n\ + ДопуÑтимые Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð»ÐµÐ¶Ð°Ñ‚ в отрезке от 0 до 315360000 (10 лет),\n\ + По умолчанию значение равно 30.\n\ + /c ""комментарий"" ОпиÑание причины Ð²Ñ‹ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ð¸Ð»Ð¸ перезагрузки.\n\ + Ðе более 512 знаков.\n\ + /f Принудительное завершение открытых приложений без предварительного\n\ + уведомлениÑ. ЕÑли не указаны дополнительные параметры, то Ñтот\n\ + параметр также приведет к выходу из ÑиÑтемы.\n\ + /d [p|u:]xx:yy Задает код причины Ð²Ñ‹ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ð¸Ð»Ð¸ перезагрузки.\n\ + p - показывает, что выключение или перезагрузка запланирована.\n\ + u - показывает, что причина определена пользователем.\n\ + ЕÑли не указаны p или u, то выключение или перезагрузка ÑиÑтемы не\n\ + запланирована.\ + xx - оÑновной код причины (1 - 255).\n\ + yy - дополнительный код причины (1 - 65535).\n" - IDS_ERROR_SHUTDOWN_REBOOT "ERROR: Unable to shutdown and restart at the same time.\n" - IDS_ERROR_TIMEOUT "ERROR: Timeout value of %u is out of bounds (0-315360000).\n" - IDS_ERROR_ABORT "ERROR: Unable to abort the shutdown of the system.\n" - IDS_ERROR_LOGOFF "ERROR: Unable to logoff the system.\n" - IDS_ERROR_SHUTDOWN "ERROR: Unable to shutdown the system.\n" - IDS_ERROR_RESTART "ERROR: Unable to restart the system.\n" - IDS_ERROR_MAX_COMMENT_LENGTH "ERROR: Comment length exceeds maximum character limit set by the system.\n" - IDS_ERROR_HIBERNATE "ERROR: Unable to send system into hibernation mode.\n" - IDS_ERROR_HIBERNATE_LOCAL "ERROR: Hibernation mode cannot be started remotely.\n" - IDS_ERROR_HIBERNATE_ENABLED "ERROR: Hibernation mode is not enabled.\n" - IDS_ERROR_DIALOG_CAPTION "Remote Shutdown" - IDS_ERROR_DIALOG_INIT "Unable to display the graphical user interface." + IDS_ERROR_SHUTDOWN_REBOOT "ОШИБКÐ: ÐÐµÐ»ÑŒÐ·Ñ Ð¾Ð´Ð½Ð¾Ð²Ñ€ÐµÐ¼ÐµÐ½Ð½Ð¾ выключить и перезагрузить компьютер.\n" + IDS_ERROR_TIMEOUT "ОШИБКÐ: Ð’Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ %u находитÑÑ Ð·Ð° границами диапазона (0-315360000).\n" + IDS_ERROR_ABORT "ОШИБКÐ: Ðевозможно отменить завершение ÑиÑтемы.\n" + IDS_ERROR_LOGOFF "ОШИБКÐ: Ðевозможно Ñовершить выход из ÑиÑтемы.\n" + IDS_ERROR_SHUTDOWN "ОШИБКÐ: Ðевозможно выключить ÑиÑтему.\n" + IDS_ERROR_RESTART "ОШИБКÐ: Ðевозможно перезагрузить ÑиÑтему.\n" + IDS_ERROR_MAX_COMMENT_LENGTH "ОШИБКÐ: Длина ÐºÐ¾Ð¼ÐµÐ½Ñ‚Ð°Ñ€Ð¸Ñ Ð¿Ñ€ÐµÐ²Ñ‹Ñила макÑимальную длину ÑообщениÑ.\n" + IDS_ERROR_HIBERNATE "ОШИБКÐ: Ðевозможно отправить ÑиÑтему в режим гибернации (""ÑпÑщий режим"").\n" + IDS_ERROR_HIBERNATE_LOCAL "ОШИБКÐ: СпÑщий режим Ð½ÐµÐ»ÑŒÐ·Ñ Ð·Ð°Ð¿ÑƒÑтить на удаленном компьютере.\n" + IDS_ERROR_HIBERNATE_ENABLED "ОШИБКÐ: СпÑщий режим не включен.\n" + IDS_ERROR_DIALOG_CAPTION "Удаленное завершение работы" + IDS_ERROR_DIALOG_INIT "Ðе удаетÑÑ Ð¿Ð¾ÐºÐ°Ð·Ð°Ñ‚ÑŒ окно графичеÑкого интерфейÑа." END /* Remote shutdown action strings */ STRINGTABLE BEGIN - IDS_ACTION_SHUTDOWN "Shutdown the system" - IDS_ACTION_RESTART "Restart the system" - IDS_ACTION_UNEXPECTED_SHUTDOWN "Annotate the unexpected shutdown" + IDS_ACTION_SHUTDOWN "Выключить ÑиÑтему" + IDS_ACTION_RESTART "ПерезапуÑтить ÑиÑтему" + IDS_ACTION_UNEXPECTED_SHUTDOWN "ОпиÑать неожиданное выключение" END /* Remote shutdown reason strings */ STRINGTABLE BEGIN - IDS_REASON_OTHER "Other" - IDS_REASON_HARDWARE_MAINTENANCE "Hardware: Maintenance" - IDS_REASON_HARDWARE_INSTALL "Hardware: Installation" - IDS_REASON_OS_RECOVER "Operating System: Recovery" - IDS_REASON_OS_RECONFIGURE "Operating System: Reconfigure" - IDS_REASON_APP_MAINTENANCE "Application: Maintenance" - IDS_REASON_APP_INSTALL "Application: Installation" - IDS_REASON_APP_UNRESPONSIVE "Application: Unresponsive" - IDS_REASON_APP_UNSTABLE "Application: Unstable" - IDS_REASON_SECURITY "Security Issue" - IDS_REASON_NETWORK "Loss of network connectivity" + IDS_REASON_OTHER "ДругаÑ" + IDS_REASON_HARDWARE_MAINTENANCE "Оборудование: ОбÑлуживание" + IDS_REASON_HARDWARE_INSTALL "Оборудование: УÑтановка" + IDS_REASON_OS_RECOVER "ÐžÐ¿ÐµÑ€Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð°Ñ ÑиÑтема: ВоÑÑтановление" + IDS_REASON_OS_RECONFIGURE "ÐžÐ¿ÐµÑ€Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð°Ñ ÑиÑтема: ÐаÑтройка" + IDS_REASON_APP_MAINTENANCE "Приложение: ОбÑлуживание" + IDS_REASON_APP_INSTALL "Приложение: УÑтановка" + IDS_REASON_APP_UNRESPONSIVE "Приложение: Ðе отвечает" + IDS_REASON_APP_UNSTABLE "Приложение: ÐеÑÑ‚Ð°Ð±Ð¸Ð»ÑŒÐ½Ð°Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ð°" + IDS_REASON_SECURITY "Проблема безопаÑноÑти" + IDS_REASON_NETWORK "ÐŸÐ¾Ñ‚ÐµÑ€Ñ Ñетевого ÑоединениÑ" END diff --git a/reactos/base/applications/sndrec32/lang/ru-RU.rc b/reactos/base/applications/sndrec32/lang/ru-RU.rc new file mode 100644 index 00000000000..6f6e7f0d2e3 --- /dev/null +++ b/reactos/base/applications/sndrec32/lang/ru-RU.rc @@ -0,0 +1,79 @@ +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +IDC_REACTOS_SNDREC32 ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + +IDD_ABOUTBOX DIALOGEX 0, 0, 196, 75 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ программе ""ЗвукозапиÑÑŒ Ð´Ð»Ñ ReactOS"" " +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + ICON IDI_SNDREC32, -1, 19, 14, 21, 20 + LTEXT "ЗвукозапиÑÑŒ Ð´Ð»Ñ ReactOS, верÑÐ¸Ñ 1.0", IDC_STATIC, 56, 16, 114, 8, SS_NOPREFIX + LTEXT "Copyright (C) 2009", IDC_STATIC, 56, 25, 114, 8 + DEFPUSHBUTTON "OK", IDOK, 139, 54, 50, 14, WS_GROUP +END + +IDR_MENU1 MENU +BEGIN + POPUP "&Файл" + BEGIN + MENUITEM "&Создать", ID_FILE_NEW + MENUITEM "&Открыть...", ID_FILE_OPEN + MENUITEM "&Сохранить", ID_FILE_SAVE, GRAYED + MENUITEM "Сохранить к&ак...", ID_FILE_SAVEAS, GRAYED + MENUITEM "&ВоÑÑтановить...", ID_FILE_RESTORE, GRAYED + MENUITEM "Сво&йÑтва", ID_FILE_PROPERTIES + MENUITEM SEPARATOR + MENUITEM "Ð’&ыход", ID_FILE_EXIT + END + POPUP "&Правка" + BEGIN + MENUITEM "&Копировать", ID_EDIT_COPY + MENUITEM "&Ð’Ñтавить", ID_EDIT_PASTE, GRAYED + MENUITEM "Ð’Ñтавить и Ñ&мешать", ID_EDIT_PASTEMIX, GRAYED + MENUITEM SEPARATOR + MENUITEM "Ð’Ñтавить &файл...", ID_EDIT_INSERTFILE + MENUITEM "Сме&шать Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð¼...", ID_EDIT_MIXFILE + MENUITEM SEPARATOR + MENUITEM "&Удалить до текущей позиции", ID_EDIT_DELETEBEFORE, GRAYED + MENUITEM "Уда&лить поÑле текущей позиции", ID_EDIT_DELETEAFTER, GRAYED + MENUITEM SEPARATOR + MENUITEM "Сво&йÑтва аудио", ID_EDIT_AUDIOPROPS + END + POPUP "&Эффекты" + BEGIN + MENUITEM "&Увеличить громкоÑть (на 25%)", ID_EFFECTS_INCVOL + MENUITEM "У&меньшить громкоÑть", ID_EFFECTS_DECVOL + MENUITEM SEPARATOR + MENUITEM "У&величить ÑкороÑть (на 100%)", ID_EFFECTS_INCSPD + MENUITEM "Ум&еньшить ÑкороÑть", ID_EFFECTS_DECSPD + MENUITEM SEPARATOR + MENUITEM "Добавить &Ñхо", ID_EFFECTS_ECHO + MENUITEM "О&братить", ID_EFFECTS_REVERSE + END + POPUP "&?" + BEGIN + MENUITEM "&О программе...", ID_ABOUT + END +END + +STRINGTABLE +BEGIN + IDS_APP_TITLE "ЗвукозапиÑÑŒ" + IDC_REACTOS_SNDREC32 "REACTOS_SNDREC32" +END + +STRINGTABLE +BEGIN + IDS_STRPOS "ПозициÑ: %.2f Ñ." + IDS_STRDUR "Длина: %.2f Ñ." + IDS_STRBUF "Буфер: %.2f Кб" + IDS_STRFMT "%.1f кГц, %u бит" + IDS_STRMONO "моно" + IDS_STRSTEREO "Ñтерео" + IDS_STRCHAN "%s" +END diff --git a/reactos/base/applications/sndrec32/rsrc.rc b/reactos/base/applications/sndrec32/rsrc.rc index 5132c80590c..24b89c32875 100644 --- a/reactos/base/applications/sndrec32/rsrc.rc +++ b/reactos/base/applications/sndrec32/rsrc.rc @@ -53,6 +53,9 @@ IDB_BITMAP2_STOP_DIS BITMAP "resources/but_stop_dis.bmp" #ifdef LANGUAGE_RO_RO #include "lang/ro-RO.rc" #endif +#ifdef LANGUAGE_RU_RU + #include "lang/ru-RU.rc" +#endif #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif diff --git a/reactos/base/applications/sndvol32/lang/ru-RU.rc b/reactos/base/applications/sndvol32/lang/ru-RU.rc index 8290d70e3fd..7ed361747cd 100644 --- a/reactos/base/applications/sndvol32/lang/ru-RU.rc +++ b/reactos/base/applications/sndvol32/lang/ru-RU.rc @@ -47,12 +47,12 @@ IDD_VOLUME_CTRL DIALOG 0, 0, 90, 150 STYLE WS_POPUP | WS_BORDER FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Master", IDC_LINE_NAME, 4, 7, 100, 15 + LTEXT "ГлавнаÑ", IDC_LINE_NAME, 4, 7, 100, 15 CONTROL "", -1, "static", SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE, 4, 30, 82, 1 - LTEXT "Balance", -1, 4, 35, 80, 42 - LTEXT "Volume", -1, 4, 100, 77, 108 + LTEXT "БаланÑ", -1, 4, 35, 80, 42 + LTEXT "ГромкоÑть", -1, 4, 100, 77, 108 CONTROL "", IDC_LINE_SLIDER_HORZ, "msctls_trackbar32", TBS_HORZ | TBS_AUTOTICKS | TBS_BOTH | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 25, 55, 85, 30 CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT | TBS_AUTOTICKS | TBS_BOTH | TBS_DOWNISLEFT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 32, 115, 30, 70 - CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX + CHECKBOX "Ð’&ыкл. вÑе", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD | WS_VISIBLE, 130, 7, 1, 200 END diff --git a/reactos/base/setup/reactos/lang/ru-RU.rc b/reactos/base/setup/reactos/lang/ru-RU.rc index 792b6250100..af3bb1e2cfb 100644 --- a/reactos/base/setup/reactos/lang/ru-RU.rc +++ b/reactos/base/setup/reactos/lang/ru-RU.rc @@ -7,7 +7,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Ð’Ð°Ñ Ð¿Ñ€Ð¸Ð²ÐµÑ‚Ñтвует программа уÑтановки ReactOS.", IDC_STARTTITLE, 115, 8, 195, 24 LTEXT "УÑтановку ReactOS можно производить только загрузившиÑÑŒ Ñ Ñтого диÑка! ПоÑле перезапуÑка компьютера выберите загрузку Ñ CD и начните уÑтановку ReactOS.", IDC_STATIC, 115, 40, 195, 100 - LTEXT "Ðажмите кнопку ""ЗавершитьW"" Ð´Ð»Ñ Ð²Ñ‹Ñ…Ð¾Ð´Ð°.", IDC_STATIC, 115, 169, 195, 17 + LTEXT "Ðажмите кнопку ""Завершить"" Ð´Ð»Ñ Ð²Ñ‹Ñ…Ð¾Ð´Ð°.", IDC_STATIC, 115, 169, 195, 17 END IDD_LANGSELPAGE DIALOGEX 0, 0, 317, 193 @@ -40,7 +40,7 @@ CAPTION "УÑтановка ReactOS" FONT 8, "MS Shell Dlg" BEGIN CONTROL "ОÑновные уÑтройÑтва", IDC_STATIC, "Button", BS_GROUPBOX, 10, 0, 297, 172 - LTEXT "Компьтер:", IDC_STATIC, 20, 15, 80, 10 + LTEXT "Компьютер:", IDC_STATIC, 20, 15, 80, 10 CONTROL "", IDC_COMPUTER, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST, 100, 15, 150, 80 LTEXT "Экран:", IDC_STATIC, 20, 35, 80, 10 CONTROL "", IDC_DISPLAY, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST, 100, 35, 150, 80 @@ -65,7 +65,7 @@ END IDD_PARTITION DIALOGEX 0, 0, 145, 90 STYLE WS_VISIBLE | WS_CAPTION -CAPTION "Create Partition" +CAPTION "Создать раздел на диÑке" FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_UPDOWN1, "msctls_updown32", WS_VISIBLE, 104, 22, 9, 13 diff --git a/reactos/base/shell/explorer-new/lang/ru-RU.rc b/reactos/base/shell/explorer-new/lang/ru-RU.rc index b74e311e739..c6c9f6aebd6 100644 --- a/reactos/base/shell/explorer-new/lang/ru-RU.rc +++ b/reactos/base/shell/explorer-new/lang/ru-RU.rc @@ -7,19 +7,19 @@ BEGIN POPUP "" BEGIN MENUITEM SEPARATOR - MENUITEM "&Adjust Date/Time", ID_SHELL_CMD_ADJUST_DAT - MENUITEM "&Customize Notifications...", ID_SHELL_CMD_CUST_NOTIF + MENUITEM "&ÐаÑтройка даты и времени", ID_SHELL_CMD_ADJUST_DAT + MENUITEM "&ÐаÑтройка уведомлений...", ID_SHELL_CMD_CUST_NOTIF MENUITEM SEPARATOR - MENUITEM "Ca&scade Windows", ID_SHELL_CMD_CASCADE_WND - MENUITEM "Tile Windows &Horizontally", ID_SHELL_CMD_TILE_WND_H - MENUITEM "Tile Windows V&ertically", ID_SHELL_CMD_TILE_WND_V - MENUITEM "&Show the Desktop", ID_SHELL_CMD_SHOW_DESKTOP - MENUITEM "&Undo", ID_SHELL_CMD_UNDO_ACTION + MENUITEM "РаÑположить окна &каÑкадом", ID_SHELL_CMD_CASCADE_WND + MENUITEM "РаÑположить окна по &горизонтали", ID_SHELL_CMD_TILE_WND_H + MENUITEM "РаÑположить окна по &вертикали", ID_SHELL_CMD_TILE_WND_V + MENUITEM "Показать &рабочий Ñтол", ID_SHELL_CMD_SHOW_DESKTOP + MENUITEM "&Отменить", ID_SHELL_CMD_UNDO_ACTION MENUITEM SEPARATOR - MENUITEM "ДиÑпетчер задач", ID_SHELL_CMD_OPEN_TASKMGR + MENUITEM "Д&иÑпетчер задач", ID_SHELL_CMD_OPEN_TASKMGR MENUITEM SEPARATOR MENUITEM "&Закрепить панель задач", ID_LOCKTASKBAR - MENUITEM "&СвойÑтва", ID_SHELL_CMD_PROPERTIES + MENUITEM "Сво&йÑтва", ID_SHELL_CMD_PROPERTIES END END @@ -123,11 +123,11 @@ END IDD_TASKBARPROP_ADVANCED DIALOGEX 0, 0, 252, 218 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Advanced" +CAPTION "Дополнительно" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "Advanced options", IDC_STATIC, 6, 6, 240, 121 - AUTOCHECKBOX "Show s&econds", IDC_TASKBARPROP_SECONDS, 13, 18, 200, 10 + GROUPBOX "Дополнительные наÑтройки", IDC_STATIC, 6, 6, 240, 121 + AUTOCHECKBOX "Показывать Ñ&екунды", IDC_TASKBARPROP_SECONDS, 13, 18, 200, 10 AUTOCHECKBOX "Отобра&жать образцы окон (ÑÑкизы)", IDC_TASKBARPROP_WNDPREV, 13, 31, 200, 10 END @@ -137,7 +137,7 @@ BEGIN IDS_PROPERTIES "&СвойÑтва" IDS_OPEN_ALL_USERS "&Ð’Ñе пользователи" IDS_EXPLORE_ALL_USERS "&Обзор Ð’Ñех пользователей" - IDS_STARTUP_ERROR "The system cannot start explorer because the registry is corrupted or unavailable." + IDS_STARTUP_ERROR "СиÑтема не может запуÑтить Проводник, потому что данные рееÑтра повреждены или недоÑтупны." END STRINGTABLE diff --git a/reactos/dll/cpl/desk/lang/ru-RU.rc b/reactos/dll/cpl/desk/lang/ru-RU.rc index 9ad815d87ea..d1e1f9f7da5 100644 --- a/reactos/dll/cpl/desk/lang/ru-RU.rc +++ b/reactos/dll/cpl/desk/lang/ru-RU.rc @@ -43,17 +43,17 @@ CAPTION "Оформление" FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass", WS_VISIBLE | WS_BORDER, 7, 7, 232, 120 - LTEXT "Visual Style", IDC_STATIC, 7, 130, 104, 9 + LTEXT "&Окна и кнопки:", IDC_STATIC, 7, 130, 104, 9 COMBOBOX IDC_APPEARANCE_VISUAL_STYLE, 7, 140, 134, 90, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Ð¦Ð²ÐµÑ‚Ð¾Ð²Ð°Ñ Ñхема", IDC_STATIC, 7, 160, 104, 9 + LTEXT "&Ð¦Ð²ÐµÑ‚Ð¾Ð²Ð°Ñ Ñхема:", IDC_STATIC, 7, 160, 104, 9 COMBOBOX IDC_APPEARANCE_COLORSCHEME, 7, 170, 134, 90, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Size", IDC_STATIC, 7, 190, 104, 9 + LTEXT "&Размер шрифта:", IDC_STATIC, 7, 190, 104, 9 COMBOBOX IDC_APPEARANCE_SIZE, 7, 200, 134, 90, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Эффекты...", IDC_APPEARANCE_EFFECTS, 182, 150, 56, 15 - PUSHBUTTON "Дополнительно", IDC_APPEARANCE_ADVANCED, 182, 170, 56, 15 + PUSHBUTTON "&Дополнительно", IDC_APPEARANCE_ADVANCED, 182, 170, 56, 15 END IDD_ADVAPPEARANCE DIALOGEX 0, 0, 250, 239 @@ -222,7 +222,7 @@ BEGIN IDS_MESSBOX "Окно ÑообщениÑ" IDS_MESSTEXT "Сообщение" IDS_BUTTEXT "OK" - IDS_CLASSIC_THEME "Classic Theme" + IDS_CLASSIC_THEME "КлаÑÑичеÑÐºÐ°Ñ Ñ‚ÐµÐ¼Ð°" END STRINGTABLE @@ -233,7 +233,7 @@ BEGIN IDS_ELEMENT_4 "Заголовок активных окон" IDS_ELEMENT_5 "Граница активных окон" IDS_ELEMENT_6 "Меню" - IDS_ELEMENT_7 "Выледенные Ñлементы" + IDS_ELEMENT_7 "Выделенные Ñлементы" IDS_ELEMENT_8 "Окна" IDS_ELEMENT_9 "ПолоÑа прокрутки" IDS_ELEMENT_10 "Рельефные объекты" @@ -244,7 +244,7 @@ BEGIN IDS_ELEMENT_15 "Диалог" IDS_ELEMENT_16 "ПолоÑÑ‹ прокрутки" IDS_ELEMENT_17 "Ð Ð°Ð±Ð¾Ñ‡Ð°Ñ Ð¾Ð±Ð»Ð°Ñть приложениÑ" - IDS_ELEMENT_18 "Small captionbar" + IDS_ELEMENT_18 "Ðазвание панели" IDS_ELEMENT_19 "Интервал между значками (гор.)" IDS_ELEMENT_20 "Интервал между значками (верт.)" IDS_ELEMENT_21 "Ð’ÑÐ¿Ð»Ñ‹Ð²Ð°ÑŽÑ‰Ð°Ñ Ð¿Ð¾Ð´Ñказка" diff --git a/reactos/dll/cpl/mmsys/lang/ru-RU.rc b/reactos/dll/cpl/mmsys/lang/ru-RU.rc index 1a35e37d6f2..5e197eb390c 100644 --- a/reactos/dll/cpl/mmsys/lang/ru-RU.rc +++ b/reactos/dll/cpl/mmsys/lang/ru-RU.rc @@ -233,7 +233,7 @@ BEGIN IDS_CPLNAME "Звук и аудиоуÑтройÑтва" IDS_CPLDESCRIPTION "Изменение звуковых Ñхем вашего компьютера, наÑтройка колонок и запиÑывающих уÑтройÑтв." IDS_NO_SOUND "(Ðет)" - IDS_NO_DEVICES "No Devices" + IDS_NO_DEVICES "Ðет уÑтройÑтв" 5825 "Ошибка программы" 5826 "Закрыть программу" 5827 "Сигнал почти полной разрÑдки батарей" diff --git a/reactos/dll/win32/aclui/lang/ru-RU.rc b/reactos/dll/win32/aclui/lang/ru-RU.rc index 6663e137e0d..86af07471d6 100644 --- a/reactos/dll/win32/aclui/lang/ru-RU.rc +++ b/reactos/dll/win32/aclui/lang/ru-RU.rc @@ -7,7 +7,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN LTEXT "&Ð˜Ð¼Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹ или пользователÑ:", -1, 7, 21, 105, 8 CONTROL "", IDC_PRINCIPALS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 7, 31, 213, 52, WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE - LTEXT "&Owner:", -1, 7, 7, 49, 8 + LTEXT "&Владелец:", -1, 7, 7, 49, 8 EDITTEXT IDC_OWNER, 63, 4, 156, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY PUSHBUTTON "До&бавить...", IDC_ADD_PRINCIPAL, 116, 87, 50, 14 PUSHBUTTON "&Удалить", IDC_REMOVE_PRINCIPAL, 170, 87, 50, 14 From 25007a6e572b67d0cb4ed16316d7fc09f08486a0 Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Mon, 19 May 2014 18:14:30 +0000 Subject: [PATCH 24/69] [BROWSEUI] Russian Translation by Akhlamov Petr CORE-7981 #resolve #comment Committed after some build fixes, thx. P.S. Former commit was made by Alex Gorgurov svn path=/trunk/; revision=63374 --- reactos/dll/win32/browseui/browseui.rc | 3 + reactos/dll/win32/browseui/lang/ru-RU.rc | 256 +++++++++++++++++++++++ 2 files changed, 259 insertions(+) create mode 100644 reactos/dll/win32/browseui/lang/ru-RU.rc diff --git a/reactos/dll/win32/browseui/browseui.rc b/reactos/dll/win32/browseui/browseui.rc index 8e8b15aad20..cbb66703ce7 100644 --- a/reactos/dll/win32/browseui/browseui.rc +++ b/reactos/dll/win32/browseui/browseui.rc @@ -94,6 +94,9 @@ IDR_REGTREEOPTIONS REGISTRY "res/regtreeoptions.rgs" #ifdef LANGUAGE_RO_RO #include "lang/ro-RO.rc" #endif +#ifdef LANGUAGE_RU_RU + #include "lang/ru-RU.rc" +#endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif diff --git a/reactos/dll/win32/browseui/lang/ru-RU.rc b/reactos/dll/win32/browseui/lang/ru-RU.rc new file mode 100644 index 00000000000..a798508c673 --- /dev/null +++ b/reactos/dll/win32/browseui/lang/ru-RU.rc @@ -0,0 +1,256 @@ +/* +* Copyright 2009 Andrew Hill +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +/* Menus */ + +IDM_CABINET_CONTEXTMENU MENUEX +BEGIN + POPUP "", 264,MFT_STRING,MFS_ENABLED + BEGIN + MENUITEM "&Обычные кнопки", IDM_TOOLBARS_STANDARDBUTTONS, MFT_STRING, MFS_ENABLED + MENUITEM "&ÐдреÑÐ½Ð°Ñ Ñтрока", IDM_TOOLBARS_ADDRESSBAR, MFT_STRING, MFS_ENABLED + MENUITEM "&СÑылки", IDM_TOOLBARS_LINKSBAR, MFT_STRING, MFS_ENABLED + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "Закрепить панели инÑтрументов", IDM_TOOLBARS_LOCKTOOLBARS, MFT_STRING, MFS_ENABLED + MENUITEM "&ÐаÑтройка...", IDM_TOOLBARS_CUSTOMIZE, MFT_STRING, MFS_ENABLED + MENUITEM "&Text Labels", IDM_TOOLBARS_TEXTLABELS, MFT_STRING, MFS_ENABLED + MENUITEM "&Кнопка Переход", IDM_TOOLBARS_GOBUTTON, MFT_STRING, MFS_ENABLED + END +END + +IDM_CABINET_MAINMENU MENUEX +BEGIN + POPUP "&Файл", FCIDM_MENU_FILE + BEGIN + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "&Закрыть", IDM_FILE_CLOSE + END + POPUP "&Правка", FCIDM_MENU_EDIT + BEGIN + MENUITEM "", -1, MFT_SEPARATOR + END + POPUP "&Вид", FCIDM_MENU_VIEW + BEGIN + POPUP "&Панели инÑтрументов", IDM_VIEW_TOOLBARS + BEGIN + MENUITEM "", -1, MFT_SEPARATOR + END + MENUITEM "Строка &ÑоÑтоÑниÑ", IDM_VIEW_STATUSBAR + POPUP "&Панели обозревателÑ", IDM_VIEW_EXPLORERBAR + BEGIN + MENUITEM "&ПоиÑк\tCtrl+E", IDM_EXPLORERBAR_SEARCH + MENUITEM "&Избранное\tCtrl+I", IDM_EXPLORERBAR_FAVORITES + MENUITEM "&Медиа", IDM_EXPLORERBAR_MEDIA + MENUITEM "&Журнал\tCtrl+H", IDM_EXPLORERBAR_HISTORY + MENUITEM "П&апки", IDM_EXPLORERBAR_FOLDERS + MENUITEM "", IDM_EXPLORERBAR_SEPARATOR + END + MENUITEM "", FCIDM_MENU_VIEW_SEP_OPTIONS, MFT_SEPARATOR + POPUP "П&ереход", FCIDM_MENU_EXPLORE + BEGIN + MENUITEM "&Ðазад\tAlt+Стрелка влево", IDM_GOTO_BACK + MENUITEM "&Вперед\tAlt+Стрелка вправо", IDM_GOTO_FORWARD + MENUITEM "&Ðа один уровень вверх", IDM_GOTO_UPONELEVEL + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "&Домой\tAlt+Home", IDM_GOTO_HOMEPAGE + END + MENUITEM "&Обновить", IDM_VIEW_REFRESH + END + POPUP "И&збранное", FCIDM_MENU_FAVORITES + BEGIN + MENUITEM "&Добавить в избранное...", IDM_FAVORITES_ADDTOFAVORITES + MENUITEM "&УпорÑдочить избранное...", IDM_FAVORITES_ORGANIZEFAVORITES + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "(пуÑто)", IDM_FAVORITES_EMPTY + END + POPUP "&СервиÑ", FCIDM_MENU_TOOLS + BEGIN + MENUITEM "Подключить &Ñетевой диÑк...", IDM_TOOLS_MAPNETWORKDRIVE + MENUITEM "&Отключить Ñетевой диÑк...", IDM_TOOLS_DISCONNECTNETWORKDRIVE + MENUITEM "&Синхронизировать...", IDM_TOOLS_SYNCHRONIZE + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "&СвойÑтва папки ...", IDM_TOOLS_FOLDEROPTIONS + END + POPUP "&Справка", FCIDM_MENU_HELP + BEGIN + MENUITEM "&Легальна ли Ñта ÐºÐ¾Ð¿Ð¸Ñ ReactOS?", IDM_HELP_ISTHISCOPYLEGAL + MENUITEM "&О ReactOS", IDM_HELP_ABOUT + END +END + +/* Dialogs */ + +IDD_CUSTOMIZETOOLBAREX DIALOGEX 0, 0, 357, 33 +STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Te&xt options:", -1, 4, 2, 48, 15 + COMBOBOX IDC_TEXTOPTIONS, 52, 0, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Ico&n options:", -1, 4, 20, 48, 15 + COMBOBOX IDC_ICONOPTIONS, 52, 18, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +END + +/* Accelerators */ + +IDR_ACCELERATORS ACCELERATORS +BEGIN + VK_F5, IDM_VIEW_REFRESH, VIRTKEY, NOINVERT + VK_F5, IDM_VIEW_REFRESH, VIRTKEY, CONTROL, NOINVERT + "R", IDM_VIEW_REFRESH, VIRTKEY, CONTROL, NOINVERT + VK_HOME, IDM_GOTO_HOMEPAGE, VIRTKEY, ALT, NOINVERT + "D", IDM_FAVORITES_ADDTOFAVORITES, VIRTKEY, CONTROL, NOINVERT + "B", IDM_FAVORITES_ORGANIZEFAVORITES, VIRTKEY, CONTROL, NOINVERT + VK_LEFT, IDM_GOTO_BACK, VIRTKEY, ALT + VK_RIGHT, IDM_GOTO_FORWARD, VIRTKEY, ALT + "W", IDM_FILE_CLOSE, VIRTKEY, CONTROL, NOINVERT + "E", IDM_EXPLORERBAR_SEARCH, VIRTKEY, CONTROL, NOINVERT + "I", IDM_EXPLORERBAR_FAVORITES, VIRTKEY, CONTROL, NOINVERT + "H", IDM_EXPLORERBAR_HISTORY, VIRTKEY, CONTROL, NOINVERT +END + +/* Strings */ + +STRINGTABLE +BEGIN + 800 "Contains commands for manipulating the selected items." +END + +STRINGTABLE +BEGIN + 864 "Contains edit commands." +END + +STRINGTABLE +BEGIN + 928 "Contains commands for manipulating the view." +END + +STRINGTABLE +BEGIN + 992 "Contains tools commands." +END + +STRINGTABLE +BEGIN + 1056 "Contains commands for displaying Help." +END + +STRINGTABLE +BEGIN + 9025 "Закрыть окно." + 9026 "Goes up one level." +END + +STRINGTABLE +BEGIN + 9121 "Подключить Ñетевой диÑк." + 9122 "Отключить Ñетевой диÑк." +END + +STRINGTABLE +BEGIN + 9250 "Displays program information, version number, and copyright." + 9252 "Displays information for debugging." +END + +STRINGTABLE +BEGIN + 9281 "Перейти на предыдущую Ñтраницу." + 9282 "Перейти на Ñледующую Ñтраницу." + 9283 "Enables you to change settings." + 9285 "Перейти на домашнюю Ñтраницу." +END + +STRINGTABLE +BEGIN + 9362 "Открыть папку Избранное." + 9363 "Добавить в избранное." +END + +STRINGTABLE +BEGIN + 9505 "Показать или ÑпрÑтать панели." + 9506 "Отобразить Ñтроку ÑоÑтоÑниÑ." + 9508 "Отобразить обычные кнопки." + 9509 "Отобразить адреÑную Ñтроку." + 9510 "Displays the Quick Links bar." + 9516 "Закрепить панель инÑтрументов." +END + +STRINGTABLE +BEGIN + 9533 "ÐаÑтройка панели инÑтрументов." +END + +STRINGTABLE +BEGIN + 9552 "Shows or hides an Explorer bar." + 9553 "Shows the Search bar." + 9554 "Shows the Favorites bar." + 9555 "Shows the History bar." + 9557 "Shows the Folders bar." + 9559 "Shows the Media Bar." +END + +STRINGTABLE +BEGIN + IDS_SMALLICONS "Мелкие значки" + IDS_LARGEICONS "Крупные значки" + IDS_SHOWTEXTLABELS "ТекÑÑ‚ кнопки" +END + +STRINGTABLE +BEGIN + IDS_NOTEXTLABELS "Без подпиÑей к кнопкам" + IDS_SELECTIVETEXTONRIGHT "Выборочно текÑÑ‚ Ñправа" +END + +STRINGTABLE +BEGIN + IDS_GOBUTTONLABEL "|Переход||" + IDS_GOBUTTONTIPTEMPLATE "Перейти в ""%s""" +END + +STRINGTABLE +BEGIN + IDS_SEARCHLABEL "ПоиÑк" + IDS_ADDRESSBANDLABEL "Ð&дреÑ" +END + +STRINGTABLE +BEGIN + IDS_FOLDERSLABEL "Папки" +END + +STRINGTABLE +BEGIN + IDS_HISTORYTEXT "&ИÑториÑ\tCtrl+H" +END + +STRINGTABLE +BEGIN + IDS_UP "Вверх" +END + +STRINGTABLE +BEGIN + IDS_BACK "Ðазад" + IDS_FORWARD "Вперед" +END From ffbeaececb511ae37ab51790f1f4b8d531228c4e Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Mon, 19 May 2014 18:26:26 +0000 Subject: [PATCH 25/69] [WINED3DCFG] Fixed two errors in the RCs. Shortened a String of ... my ... translation. svn path=/trunk/; revision=63375 --- reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc | 4 ++-- reactos/dll/cpl/wined3dcfg/lang/de-DE.rc | 6 +++--- reactos/dll/cpl/wined3dcfg/lang/en-US.rc | 2 +- reactos/dll/cpl/wined3dcfg/lang/he-IL.rc | 4 ++-- reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc | 4 ++-- reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc | 4 ++-- reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc | 4 ++-- reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc b/reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc index 5aeef2cac91..547063e5f35 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/cs-CZ.rc @@ -12,11 +12,11 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + LTEXT "Enable GLSL:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + LTEXT "Maximum PS Level:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST diff --git a/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc b/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc index c69db3f1e34..c6efbbb3684 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/de-DE.rc @@ -7,7 +7,7 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 GROUPBOX "Shader", -1, 5, 25, 230, 80 - LTEXT "GLSL aktivieren", -1, 15, 42, 80, 10 + LTEXT "GLSL aktivieren:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximaler GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST @@ -18,13 +18,13 @@ BEGIN GROUPBOX "Darstellung", -1, 5, 110, 230, 110 LTEXT "Multisampling:", -1, 15, 127, 80, 10 COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Strikte Zeichenreihenfolge:", -1, 15, 142, 80, 10 + LTEXT "Strikte Zeichenfolge:", -1, 15, 142, 80, 10 COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Offscreen Rendering:", -1, 15, 157, 80, 10 COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Immer Offscreen:", -1, 15, 172, 72, 10, SS_LEFT COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Videospeicher-Größe:", -1, 15, 187, 72, 10, SS_LEFT + LTEXT "Videospeicher-Größe:", -1, 15, 187, 72, 10, SS_LEFT COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST diff --git a/reactos/dll/cpl/wined3dcfg/lang/en-US.rc b/reactos/dll/cpl/wined3dcfg/lang/en-US.rc index cbeccc3bf90..ba1ea497b00 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/en-US.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/en-US.rc @@ -7,7 +7,7 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + LTEXT "Enable GLSL:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST diff --git a/reactos/dll/cpl/wined3dcfg/lang/he-IL.rc b/reactos/dll/cpl/wined3dcfg/lang/he-IL.rc index ebf6a64194b..2b80ded98fc 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/he-IL.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/he-IL.rc @@ -7,11 +7,11 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + LTEXT "Enable GLSL:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + LTEXT "Maximum PS Level:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST diff --git a/reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc b/reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc index 3a6a5f39b1d..c99c1e78e30 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/pl-PL.rc @@ -13,11 +13,11 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + LTEXT "Enable GLSL:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + LTEXT "Maximum PS Level:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST diff --git a/reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc b/reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc index f778b43fdd4..8f89c1b0af0 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/ro-RO.rc @@ -9,11 +9,11 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + LTEXT "Enable GLSL:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + LTEXT "Maximum PS Level:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST diff --git a/reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc b/reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc index 7a91a0a9810..3b77ad0faa8 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/sq-AL.rc @@ -11,11 +11,11 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + LTEXT "Enable GLSL:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + LTEXT "Maximum PS Level:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST diff --git a/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc b/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc index b5c4b1c0857..4d4ac1c9af4 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc @@ -9,11 +9,11 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL", -1, 15, 42, 80, 10 + LTEXT "Enable GLSL:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS level:", -1, 15, 72, 80, 10 + LTEXT "Maximum PS Level:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST From 9e5dfae220bd67227368a086c035b02b9be9ecfc Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Mon, 19 May 2014 20:28:35 +0000 Subject: [PATCH 26/69] [CMAKE/MSVC] - define _ALLOW_KEYWORD_MACROS for VS11 too svn path=/trunk/; revision=63376 --- reactos/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index 894af650fb2..d4736894667 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -63,7 +63,7 @@ if(NOT CMAKE_CROSSCOMPILING) if(ARCH STREQUAL "i386") add_definitions(/D_X86_ /DWIN32 /D_WINDOWS) endif() - if(MSVC_VERSION GREATER 1799) + if(MSVC_VERSION GREATER 1699) add_definitions(/D_ALLOW_KEYWORD_MACROS) endif() add_definitions(/Dinline=__inline) From 74f8d131acbe439b50a04c68ad59ccdf409bd655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 19 May 2014 21:12:35 +0000 Subject: [PATCH 27/69] [NTVDM]: Fix INT 15h, AH=C0h. svn path=/trunk/; revision=63377 --- reactos/subsystems/ntvdm/bios/bios32/bios32.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/subsystems/ntvdm/bios/bios32/bios32.c b/reactos/subsystems/ntvdm/bios/bios32/bios32.c index 6a4aaba2801..34f6b61d6f3 100644 --- a/reactos/subsystems/ntvdm/bios/bios32/bios32.c +++ b/reactos/subsystems/ntvdm/bios/bios32/bios32.c @@ -116,8 +116,9 @@ static VOID WINAPI BiosMiscService(LPWORD Stack) case 0xC0: { /* Return the BIOS ROM Configuration Table address in ES:BX */ - setES(HIWORD(Bct)); - setBX(LOWORD(Bct)); + // The BCT is found at F000:E6F5 for 100% compatible BIOSes. + setES(BIOS_SEGMENT); + setBX(0xE6F5); /* Call successful; clear CF */ setAH(0x00); From a3fe90d0d0d5344e57c4719cef541201eccd7bce Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Mon, 19 May 2014 22:40:36 +0000 Subject: [PATCH 28/69] [NTVDM] Properly repeat the GetNextVDMCommand request. Using "continue" there will not work if the application has been started by a double click, since in that case AcceptCommands is FALSE. svn path=/trunk/; revision=63379 --- reactos/subsystems/ntvdm/ntvdm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/subsystems/ntvdm/ntvdm.c b/reactos/subsystems/ntvdm/ntvdm.c index d0e1293cec7..9f630e18730 100644 --- a/reactos/subsystems/ntvdm/ntvdm.c +++ b/reactos/subsystems/ntvdm/ntvdm.c @@ -435,6 +435,7 @@ CommandThreadProc(LPVOID Parameter) if (First) CommandInfo.VDMState |= VDM_FLAG_FIRST_TASK; +Command: if (!GetNextVDMCommand(&CommandInfo)) { if (CommandInfo.EnvLen > EnvSize) @@ -443,7 +444,8 @@ CommandThreadProc(LPVOID Parameter) EnvSize = CommandInfo.EnvLen; Env = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Env, EnvSize); - continue; + /* Repeat the request */ + goto Command; } break; From 8546e5f6459fdda1a219fe6bafd8f9ba9311f374 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 20 May 2014 03:40:42 +0000 Subject: [PATCH 29/69] [Win32k] - Fix load menu callback. Use it for loading system menus. - Sync in more wine code, fix sub-menu arrow drawing. See WinMerge. - Miscellaneous code changes. svn path=/trunk/; revision=63380 --- reactos/win32ss/include/callback.h | 1 + reactos/win32ss/user/ntuser/callback.c | 2 +- reactos/win32ss/user/ntuser/window.c | 34 +- reactos/win32ss/user/user32/windows/menu.c | 611 +++++++++++---------- 4 files changed, 342 insertions(+), 306 deletions(-) diff --git a/reactos/win32ss/include/callback.h b/reactos/win32ss/include/callback.h index 2f44a3ec2da..b193c277fcb 100644 --- a/reactos/win32ss/include/callback.h +++ b/reactos/win32ss/include/callback.h @@ -81,6 +81,7 @@ typedef struct _EVENTPROC_CALLBACK_ARGUMENTS typedef struct _LOADMENU_CALLBACK_ARGUMENTS { HINSTANCE hModule; + LPCWSTR InterSource; WCHAR MenuName[1]; } LOADMENU_CALLBACK_ARGUMENTS, *PLOADMENU_CALLBACK_ARGUMENTS; diff --git a/reactos/win32ss/user/ntuser/callback.c b/reactos/win32ss/user/ntuser/callback.c index 3ed610f8bb4..6bd8060c9d3 100644 --- a/reactos/win32ss/user/ntuser/callback.c +++ b/reactos/win32ss/user/ntuser/callback.c @@ -884,7 +884,7 @@ co_IntCallLoadMenu( HINSTANCE hModule, if (pMenuName->Length) RtlCopyMemory(&Common->MenuName, pMenuName->Buffer, pMenuName->Length); else - RtlCopyMemory(&Common->MenuName, &pMenuName->Buffer, sizeof(WCHAR)); + Common->InterSource = pMenuName->Buffer; ResultPointer = NULL; ResultLength = sizeof(LRESULT); diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 6259742e623..b5386d76102 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -901,7 +901,9 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu) PMENU Menu, NewMenu = NULL, SysMenu = NULL, ret = NULL; PTHREADINFO W32Thread; HMENU hNewMenu, hSysMenu; + ROSMENUITEMINFO ItemInfoSet = {0}; ROSMENUITEMINFO ItemInfo = {0}; + UNICODE_STRING MenuName; if(bRevert) { @@ -952,14 +954,21 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu) } SysMenu->fFlags |= MNF_SYSDESKMN; SysMenu->hWnd = Window->head.h; - hNewMenu = co_IntLoadSysMenuTemplate(); + //hNewMenu = co_IntLoadSysMenuTemplate(); //if ( Window->ExStyle & WS_EX_MDICHILD ) - //hNewMenu = co_IntCallLoadMenu( NULL, L"SYSMENUMDI"); - // else - //hNewMenu = co_IntCallLoadMenu( NULL, L"SYSMENU"); - // Do the rest in here. + //{ + // RtlInitUnicodeString( &MenuName, L"SYSMENUMDI"); + // hNewMenu = co_IntCallLoadMenu( hModClient, &MenuName); + //} + //else + { + RtlInitUnicodeString( &MenuName, L"SYSMENU"); + hNewMenu = co_IntCallLoadMenu( hModClient, &MenuName); + //ERR("%wZ\n",&MenuName); + } if(!hNewMenu) { + ERR("No Menu!!\n"); IntReleaseMenuObject(SysMenu); UserDestroyMenu(hSysMenu); return NULL; @@ -972,6 +981,21 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu) return NULL; } + // Do the rest in here. + + Menu->fFlags |= MNS_CHECKORBMP | MNF_SYSDESKMN | MNF_POPUP; + + ItemInfoSet.cbSize = sizeof( MENUITEMINFOW); + ItemInfoSet.fMask = MIIM_BITMAP; + ItemInfoSet.hbmpItem = HBMMENU_POPUP_CLOSE; + IntMenuItemInfo(Menu, SC_CLOSE, FALSE, &ItemInfoSet, TRUE, NULL); + ItemInfoSet.hbmpItem = HBMMENU_POPUP_RESTORE; + IntMenuItemInfo(Menu, SC_RESTORE, FALSE, &ItemInfoSet, TRUE, NULL); + ItemInfoSet.hbmpItem = HBMMENU_POPUP_MAXIMIZE; + IntMenuItemInfo(Menu, SC_MAXIMIZE, FALSE, &ItemInfoSet, TRUE, NULL); + ItemInfoSet.hbmpItem = HBMMENU_POPUP_MINIMIZE; + IntMenuItemInfo(Menu, SC_MINIMIZE, FALSE, &ItemInfoSet, TRUE, NULL); + NewMenu = IntCloneMenu(Menu); if(NewMenu) { diff --git a/reactos/win32ss/user/user32/windows/menu.c b/reactos/win32ss/user/user32/windows/menu.c index 08e33325c31..5298c6c90ac 100644 --- a/reactos/win32ss/user/user32/windows/menu.c +++ b/reactos/win32ss/user/user32/windows/menu.c @@ -39,6 +39,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(menu); #define TPM_BUTTONDOWN 0x40000000 /* menu was clicked before tracking */ #define TPM_POPUPMENU 0x20000000 /* menu is a popup menu */ + /* Space between 2 columns */ +#define MENU_COL_SPACE 4 + /* top and bottom margins for popup menus */ #define MENU_TOP_MARGIN 3 #define MENU_BOTTOM_MARGIN 2 @@ -495,7 +498,7 @@ MenuGetRosMenuItemInfo(HMENU Menu, UINT Index, PROSMENUITEMINFO ItemInfo) ItemInfo->Rect.right = pItem->cxItem; // Do this for now...... ItemInfo->Rect.bottom = pItem->cyItem; ItemInfo->dxTab = pItem->dxTab; - ItemInfo->lpstr = pItem->lpstr.Buffer; + ItemInfo->lpstr = pItem->lpstr.Buffer ? DesktopPtrToUser(pItem->lpstr.Buffer) : NULL; ItemInfo->maxBmpSize.cx = pItem->cxBmp; ItemInfo->maxBmpSize.cy = pItem->cyBmp; @@ -870,42 +873,42 @@ static UINT FASTCALL MENU_FindItemByKey(HWND WndOwner, HMENU hmenu, TRACE("\tlooking for '%c' (0x%02x) in [%p]\n", (char)Key, Key, hmenu ); if (!IsMenu( hmenu )) hmenu = GetSubMenu( get_win_sys_menu(WndOwner), 0); - if (hmenu) - { - MENU *menu = MENU_GetMenu( hmenu ); - ITEM *item = menu->rgItems ? DesktopPtrToUser(menu->rgItems) : NULL; + if (hmenu) + { + MENU *menu = MENU_GetMenu( hmenu ); + ITEM *item = menu->rgItems ? DesktopPtrToUser(menu->rgItems) : NULL; - if( !ForceMenuChar ) - { - UINT i; - BOOL cjk = GetSystemMetrics( SM_DBCSENABLED ); + if ( !ForceMenuChar ) + { + UINT i; + BOOL cjk = GetSystemMetrics( SM_DBCSENABLED ); - for (i = 0; i < menu->cItems; i++, item++) - { - LPWSTR text = item->Xlpstr ? DesktopPtrToUser(item->Xlpstr) : NULL; - if( text) - { - const WCHAR *p = text - 2; - do - { - const WCHAR *q = p + 2; - p = strchrW (q, '&'); - if (!p && cjk) p = strchrW (q, '\036'); /* Japanese Win16 */ - } - while (p != NULL && p [1] == '&'); - if (p && (toupperW(p[1]) == toupperW(Key))) return i; - } - } - } + for (i = 0; i < menu->cItems; i++, item++) + { + LPWSTR text = item->Xlpstr ? DesktopPtrToUser(item->Xlpstr) : NULL; + if( text) + { + const WCHAR *p = text - 2; + do + { + const WCHAR *q = p + 2; + p = strchrW (q, '&'); + if (!p && cjk) p = strchrW (q, '\036'); /* Japanese Win16 */ + } + while (p != NULL && p [1] == '&'); + if (p && (toupperW(p[1]) == toupperW(Key))) return i; + } + } + } - Flags |= menu->fFlags & MNF_POPUP ? MF_POPUP : 0; - Flags |= menu->fFlags & MNF_SYSDESKMN ? MF_SYSMENU : 0; + Flags |= menu->fFlags & MNF_POPUP ? MF_POPUP : 0; + Flags |= menu->fFlags & MNF_SYSDESKMN ? MF_SYSMENU : 0; - MenuChar = SendMessageW(WndOwner, WM_MENUCHAR, + MenuChar = SendMessageW( WndOwner, WM_MENUCHAR, MAKEWPARAM(Key, Flags), (LPARAM) hmenu); - if (HIWORD(MenuChar) == MNC_EXECUTE) return LOWORD(MenuChar); - if (HIWORD(MenuChar) == MNC_CLOSE) return (UINT)(-2); - } + if (HIWORD(MenuChar) == MNC_EXECUTE) return LOWORD(MenuChar); + if (HIWORD(MenuChar) == MNC_CLOSE) return (UINT)(-2); + } return (UINT)(-1); } @@ -1205,20 +1208,20 @@ static void FASTCALL MenuCalcItemSize( HDC hdc, PROSMENUITEMINFO lpitem, PROSMEN hfontOld = SelectObject( hdc, hMenuFontBold ); } if (menuBar) { - txtheight = DrawTextW( hdc, lpitem->dwTypeData, -1, &rc, + txtheight = DrawTextW( hdc, lpitem->lpstr, -1, &rc, DT_SINGLELINE|DT_CALCRECT); lpitem->Rect.right += rc.right - rc.left; itemheight = max( max( itemheight, txtheight), GetSystemMetrics( SM_CYMENU) - 1); lpitem->Rect.right += 2 * MenuCharSize.cx; } else { - if ((p = strchrW( lpitem->dwTypeData, '\t' )) != NULL) { + if ((p = strchrW( lpitem->lpstr, '\t' )) != NULL) { RECT tmprc = rc; LONG tmpheight; - int n = (int)( p - lpitem->dwTypeData); + int n = (int)( p - lpitem->lpstr); /* Item contains a tab (only meaningful in popup menus) */ /* get text size before the tab */ - txtheight = DrawTextW( hdc, lpitem->dwTypeData, n, &rc, + txtheight = DrawTextW( hdc, lpitem->lpstr, n, &rc, DT_SINGLELINE|DT_CALCRECT); txtwidth = rc.right - rc.left; p += 1; /* advance past the Tab */ @@ -1230,7 +1233,7 @@ static void FASTCALL MenuCalcItemSize( HDC hdc, PROSMENUITEMINFO lpitem, PROSMEN txtwidth += MenuCharSize.cx + /* space for the tab */ tmprc.right - tmprc.left; /* space for the short cut */ } else { - txtheight = DrawTextW( hdc, lpitem->dwTypeData, -1, &rc, + txtheight = DrawTextW( hdc, lpitem->lpstr, -1, &rc, DT_SINGLELINE|DT_CALCRECT); txtwidth = rc.right - rc.left; lpitem->dxTab += txtwidth; @@ -1287,15 +1290,18 @@ static void FASTCALL MenuPopupMenuCalcSize(PROSMENUINFO MenuInfo, HWND WndOwner) MenuInfo->cxTextAlign = 0; MenuInitRosMenuItemInfo(&lpitem); + //MenuGetRosMenuItemInfo(MenuInfo->Self, start, &lpitem); while (start < MenuInfo->cItems) { + //lpitem = &lppop->items[start]; orgX = maxX; - orgY = 2; + //if( lpitem.fType & (MF_MENUBREAK | MF_MENUBARBREAK)) + // orgX += MENU_COL_SPACE; + orgY = 2;//MENU_TOP_MARGIN; maxTab = maxTabWidth = 0; - /* Parse items until column break or end of menu */ - for (i = start; i < MenuInfo->cItems; i++) + for (i = start; i < MenuInfo->cItems; i++)//, lpitem++) { if (! MenuGetRosMenuItemInfo(MenuInfo->Self, i, &lpitem)) { @@ -1306,7 +1312,6 @@ static void FASTCALL MenuPopupMenuCalcSize(PROSMENUINFO MenuInfo, HWND WndOwner) if (i != start && (lpitem.fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break; - if( lpitem.lpstr && lpitem.hbmpItem) textandbmp = TRUE; MenuCalcItemSize(hdc, &lpitem, MenuInfo, WndOwner, orgX, orgY, FALSE, textandbmp); if (! MenuSetRosMenuItemInfo(MenuInfo->Self, i, &lpitem)) @@ -1315,36 +1320,33 @@ static void FASTCALL MenuPopupMenuCalcSize(PROSMENUINFO MenuInfo, HWND WndOwner) MenuSetRosMenuInfo(MenuInfo); return; } -// Not sure here,, The patch from wine removes this. -// if ((lpitem.fType & MF_MENUBARBREAK) != 0) -// { -// OrgX++; -// } + maxX = max(maxX, lpitem.Rect.right); orgY = lpitem.Rect.bottom; - if ((lpitem.lpstr) && lpitem.dxTab ) + if (IS_STRING_ITEM(lpitem.fType) && lpitem.dxTab ) { maxTab = max( maxTab, lpitem.dxTab ); maxTabWidth = max(maxTabWidth, lpitem.Rect.right - lpitem.dxTab); } - } + if( lpitem.lpstr && lpitem.hbmpItem) textandbmp = TRUE; + } /* Finish the column (set all items to the largest width found) */ - maxX = max( maxX, maxTab + maxTabWidth ); - while (start < i) - { - if (MenuGetRosMenuItemInfo(MenuInfo->Self, start, &lpitem)) - { - lpitem.Rect.right = maxX; - if ((lpitem.lpstr) && 0 != lpitem.dxTab) - { - lpitem.dxTab = maxTab; - } - MenuSetRosMenuItemInfo(MenuInfo->Self, start, &lpitem); - } - start++; - } - MenuInfo->cyMenu = max(MenuInfo->cyMenu, orgY); + maxX = max( maxX, maxTab + maxTabWidth ); + while (start < i) + { + if (MenuGetRosMenuItemInfo(MenuInfo->Self, start, &lpitem)) + { + lpitem.Rect.right = maxX; + if (IS_STRING_ITEM(lpitem.fType) && lpitem.dxTab) + { + lpitem.dxTab = maxTab; + } + MenuSetRosMenuItemInfo(MenuInfo->Self, start, &lpitem); + } + start++; + } + MenuInfo->cyMenu = max(MenuInfo->cyMenu, orgY); } MenuInfo->cxMenu = maxX; @@ -1447,7 +1449,7 @@ static void FASTCALL MenuMenuBarCalcSize( HDC hdc, LPRECT lprect, } /* FIXME: Is this really needed? */ /*NO! it is not needed, why make the -HBMMENU_MBAR_CLOSE, MINIMIZE & RESTORE, look the same size as the menu bar! */ + HBMMENU_MBAR_CLOSE, MINIMIZE & RESTORE, look the same size as the menu bar! */ #if 0 /* Finish the line (set all items to the largest height found) */ while (start < i) @@ -1480,30 +1482,21 @@ HBMMENU_MBAR_CLOSE, MINIMIZE & RESTORE, look the same size as the menu bar! */ orgY = ItemInfo.Rect.top; orgX = lprect->right; for (i = MenuInfo->cItems - 1; helpPos <= i; i--) - { - if (i < helpPos) - { - break; /* done */ - } - if (ItemInfo.Rect.top != orgY) - { - break; /* Other line */ - } - if (orgX <= ItemInfo.Rect.right) - { - break; /* Too far right already */ - } + { + if (i < helpPos) break; /* done */ + if (ItemInfo.Rect.top != orgY) break; /* Other line */ + if (orgX <= ItemInfo.Rect.right) break; /* Too far right already */ ItemInfo.Rect.left += orgX - ItemInfo.Rect.right; ItemInfo.Rect.right = orgX; orgX = ItemInfo.Rect.left; MenuSetRosMenuItemInfo(MenuInfo->Self, i, &ItemInfo); if (helpPos + 1 <= i && ! MenuGetRosMenuItemInfo(MenuInfo->Self, i - 1, &ItemInfo)) - { + { MenuCleanupRosMenuItemInfo(&ItemInfo); return; - } - } + } + } } MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -1527,7 +1520,6 @@ MENU_DrawScrollArrows(PROSMENUINFO lppop, HDC hdc) arrow_bitmap_width = bmp.bmWidth; arrow_bitmap_height = bmp.bmHeight; - if (lppop->iTop) hOrigBitmap = SelectObject(hdcMem, get_up_arrow_bitmap()); else @@ -1553,6 +1545,26 @@ MENU_DrawScrollArrows(PROSMENUINFO lppop, HDC hdc) DeleteDC(hdcMem); } +/*********************************************************************** + * draw_popup_arrow + * + * Draws the popup-menu arrow. + */ +static void draw_popup_arrow( HDC hdc, RECT rect, UINT arrow_bitmap_width, + UINT arrow_bitmap_height) +{ + HDC hdcMem = CreateCompatibleDC( hdc ); + HBITMAP hOrigBitmap; + + hOrigBitmap = SelectObject( hdcMem, get_arrow_bitmap() ); + BitBlt( hdc, rect.right - arrow_bitmap_width - 1, + (rect.top + rect.bottom - arrow_bitmap_height) / 2, + arrow_bitmap_width, arrow_bitmap_height, + hdcMem, 0, 0, SRCCOPY ); + SelectObject( hdcMem, hOrigBitmap ); + DeleteDC( hdcMem ); +} + /*********************************************************************** * MenuDrawMenuItem * @@ -1565,11 +1577,19 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd PWCHAR Text; BOOL flat_menu = FALSE; int bkgnd; + UINT arrow_bitmap_width = 0, arrow_bitmap_height = 0; PWND Wnd = ValidateHwndNoErr(hWnd); if (!Wnd) return; + if (!menuBar) { + BITMAP bmp; + GetObjectW( get_arrow_bitmap(), sizeof(bmp), &bmp ); + arrow_bitmap_width = bmp.bmWidth; + arrow_bitmap_height = bmp.bmHeight; + } + if (lpitem->fType & MF_SYSMENU) { if ( (Wnd->style & WS_MINIMIZE)) @@ -1649,10 +1669,12 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd /* Draw the popup-menu arrow */ if (lpitem->hSubMenu) { - RECT rectTemp; + /* RECT rectTemp; CopyRect(&rectTemp, &rect); rectTemp.left = rectTemp.right - GetSystemMetrics(SM_CXMENUCHECK); DrawFrameControl(hdc, &rectTemp, DFC_MENU, DFCS_MENUARROW); + */ + draw_popup_arrow( hdc, rect, arrow_bitmap_width, arrow_bitmap_height); } return; } @@ -1687,7 +1709,7 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd HPEN oldPen; RECT rc = rect; - rc.left -= 3; + rc.left -= 3;//MENU_COL_SPACE / 2 + 1; rc.top = 3; rc.bottom = Height - 3; if (flat_menu) @@ -1764,15 +1786,22 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd else if (lpitem->fState & MF_CHECKED) /* standard bitmaps */ { RECT r; + //HBITMAP bm = CreateBitmap( check_bitmap_width, check_bitmap_height, 1, 1, NULL ); + //HDC hdcMem = CreateCompatibleDC( hdc ); + //SelectObject( hdcMem, bm ); + //SetRect( &r, 0, 0, check_bitmap_width, check_bitmap_height); CopyRect(&r, &rect); r.right = r.left + GetSystemMetrics(SM_CXMENUCHECK); DrawFrameControl( hdc, &r, DFC_MENU, (lpitem->fType & MFT_RADIOCHECK) ? DFCS_MENUBULLET : DFCS_MENUCHECK); + //BitBlt( hdc, rc.left, (y - r.bottom) / 2, r.right, r.bottom, hdcMem, 0, 0, SRCCOPY ); + //DeleteDC( hdcMem ); + //DeleteObject( bm ); checked = TRUE; } } - if ( lpitem->hbmpItem ) + if ( lpitem->hbmpItem )//&& !( checked && (MenuInfo->dwStyle & MNS_CHECKORBMP))) { RECT bmpRect; CopyRect(&bmpRect, &rect); @@ -1780,26 +1809,36 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd bmpRect.left += check_bitmap_width + 2; if (!(checked && (MenuInfo->dwStyle & MNS_CHECKORBMP))) { + //POINT origorg; bmpRect.right = bmpRect.left + lpitem->maxBmpSize.cx; + /* some applications make this assumption on the DC's origin */ + //SetViewportOrgEx( hdc, rect.left, rect.top, &origorg); MenuDrawBitmapItem(hdc, lpitem, &bmpRect, MenuInfo, WndOwner, odaction, menuBar); + //SetViewportOrgEx( hdc, origorg.x, origorg.y, NULL); } } /* Draw the popup-menu arrow */ if (lpitem->hSubMenu) { - RECT rectTemp; + /* RECT rectTemp; CopyRect(&rectTemp, &rect); rectTemp.left = rectTemp.right - GetSystemMetrics(SM_CXMENUCHECK); DrawFrameControl(hdc, &rectTemp, DFC_MENU, DFCS_MENUARROW); + */ + draw_popup_arrow( hdc, rect, arrow_bitmap_width, arrow_bitmap_height); } rect.left += 4; if( !(MenuInfo->dwStyle & MNS_NOCHECK)) rect.left += check_bitmap_width; - rect.right -= check_bitmap_width; + rect.right -= arrow_bitmap_width;//check_bitmap_width; } else if( lpitem->hbmpItem) { /* Draw the bitmap */ + //POINT origorg; + + //SetViewportOrgEx( hdc, rect.left, rect.top, &origorg); MenuDrawBitmapItem(hdc, lpitem, &rect, MenuInfo, WndOwner, odaction, menuBar); + //SetViewportOrgEx( hdc, origorg.x, origorg.y, NULL); } /* process text if present */ @@ -1807,7 +1846,6 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd { register int i = 0; HFONT hfontOld = 0; - UINT uFormat = menuBar ? DT_CENTER | DT_VCENTER | DT_SINGLELINE : DT_LEFT | DT_VCENTER | DT_SINGLELINE; @@ -1827,7 +1865,7 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd rect.right -= MENU_BAR_ITEMS_SPACE / 2; } - Text = (PWCHAR) lpitem->dwTypeData; + Text = lpitem->lpstr; if(Text) { for (i = 0; L'\0' != Text[i]; i++) @@ -1916,8 +1954,8 @@ static void FASTCALL MenuDrawPopupMenu(HWND hwnd, HDC hdc, HMENU hmenu ) else DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT); - /* draw menu items */ //TRACE("hmenu %p Style %08x\n", hmenu, menu->dwStyle); + /* draw menu items */ if (MenuGetRosMenuInfo(&MenuInfo, hmenu) && MenuInfo.cItems) { UINT u; @@ -1929,10 +1967,9 @@ static void FASTCALL MenuDrawPopupMenu(HWND hwnd, HDC hdc, HMENU hmenu ) { HWND WndOwner = MenuInfo.spwndNotify ? MenuInfo.spwndNotify->head.h : NULL; MenuDrawMenuItem(hwnd, &MenuInfo, WndOwner, hdc, &ItemInfo, - MenuInfo.cyMenu, FALSE, ODA_DRAWENTIRE); + MenuInfo.cyMenu, FALSE, ODA_DRAWENTIRE); } } - /* draw scroll arrows */ if (MenuInfo.dwArrowsOn) MENU_DrawScrollArrows(&MenuInfo, hdc); @@ -2185,7 +2222,6 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn ItemInfo.fState &= ~(MF_HILITE|MF_MOUSESELECT); MenuSetRosMenuItemInfo(hmenu->Self, hmenu->iItem, &ItemInfo); } - //MENU_EnsureMenuItemVisible(hmenu, &ItemInfo, hdc); MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, &ItemInfo, hmenu->cyMenu, !(hmenu->fFlags & MNF_POPUP), ODA_SELECT); @@ -2203,9 +2239,9 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn ItemInfo.fMask |= MIIM_STATE; ItemInfo.fState |= MF_HILITE; MenuSetRosMenuItemInfo(hmenu->Self, hmenu->iItem, &ItemInfo); + MENU_EnsureMenuItemVisible(hmenu, &ItemInfo, hdc); MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, - &ItemInfo, hmenu->cyMenu, !(hmenu->fFlags & MNF_POPUP), - ODA_SELECT); + &ItemInfo, hmenu->cyMenu, !(hmenu->fFlags & MNF_POPUP), ODA_SELECT); } if (sendMenuSelect) { @@ -2649,8 +2685,8 @@ static LPCSTR MENUEX_ParseResource(LPCSTR res, HMENU hMenu) TRACE("Menu item: [%08x,%08x,%04x,%04x,%S]\n", mii.fType, mii.fState, mii.wID, resinfo, mii.dwTypeData); - if (resinfo & 1) /* Pop-up? */ - { + if (resinfo & 1) /* Pop-up? */ + { /* DWORD helpid = GET_DWORD(res); FIXME: use this. */ res += sizeof(DWORD); mii.hSubMenu = CreatePopupMenu(); @@ -2670,6 +2706,8 @@ static LPCSTR MENUEX_ParseResource(LPCSTR res, HMENU hMenu) } else if (!mii.dwTypeData[0] && !(mii.fType & MF_SEPARATOR)) { + WARN("Converting NULL menu item %04x, type %04x to SEPARATOR\n", + mii.wID, mii.fType); mii.fType |= MF_SEPARATOR; } InsertMenuItemW(hMenu, -1, MF_BYPOSITION, &mii); @@ -2773,51 +2811,46 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl TRACE("owner=%x menu=%p 0x%04x\n", WndOwner, MenuInfo, SelectFirst); - if (NO_SELECTED_ITEM == MenuInfo->iItem) - { - return MenuInfo->Self; - } + if (MenuInfo->iItem == NO_SELECTED_ITEM) return MenuInfo->Self; MenuInitRosMenuItemInfo(&ItemInfo); if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->iItem, &ItemInfo)) - { + { MenuCleanupRosMenuItemInfo(&ItemInfo); return MenuInfo->Self; - } - if (0 == (ItemInfo.hSubMenu) || 0 != (ItemInfo.fState & (MF_GRAYED | MF_DISABLED))) - { + } + + //item = &menu->rgItems[menu->iItem]; + if (!(ItemInfo.hSubMenu) || (ItemInfo.fState & (MF_GRAYED | MF_DISABLED))) + { MenuCleanupRosMenuItemInfo(&ItemInfo); return MenuInfo->Self; - } + } /* message must be sent before using item, because nearly everything may be changed by the application ! */ /* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */ - if (0 == (Flags & TPM_NONOTIFY)) - { + if (!(Flags & TPM_NONOTIFY)) + { SendMessageW(WndOwner, WM_INITMENUPOPUP, (WPARAM) ItemInfo.hSubMenu, MAKELPARAM(MenuInfo->iItem, IS_SYSTEM_MENU(MenuInfo))); - } + } if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->iItem, &ItemInfo)) - { + { MenuCleanupRosMenuItemInfo(&ItemInfo); return MenuInfo->Self; - } + } + + //item = &menu->rgItems[menu->iItem]; Rect = ItemInfo.Rect; /* correct item if modified as a reaction to WM_INITMENUPOPUP message */ - if (0 == (ItemInfo.fState & MF_HILITE)) - { - if (0 != (MenuInfo->fFlags & MNF_POPUP)) - { - Dc = GetDC(MenuInfo->Wnd); - } - else - { - Dc = GetDCEx(MenuInfo->Wnd, 0, DCX_CACHE | DCX_WINDOW); - } + if (!(ItemInfo.fState & MF_HILITE)) + { + if (MenuInfo->fFlags & MNF_POPUP) Dc = GetDC(MenuInfo->Wnd); + else Dc = GetDCEx(MenuInfo->Wnd, 0, DCX_CACHE | DCX_WINDOW); SelectObject(Dc, hMenuFont); ItemInfo.fMask |= MIIM_STATE; @@ -2826,13 +2859,10 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl MenuDrawMenuItem(MenuInfo->Wnd, MenuInfo, WndOwner, Dc, &ItemInfo, MenuInfo->cyMenu, !(MenuInfo->fFlags & MNF_POPUP), ODA_DRAWENTIRE); ReleaseDC(MenuInfo->Wnd, Dc); - } + } - if (0 == ItemInfo.Rect.top && 0 == ItemInfo.Rect.left - && 0 == ItemInfo.Rect.bottom && 0 == ItemInfo.Rect.right) - { + if (!ItemInfo.Rect.top && !ItemInfo.Rect.left && !ItemInfo.Rect.bottom && !ItemInfo.Rect.right) ItemInfo.Rect = Rect; - } ItemInfo.fMask |= MIIM_STATE; ItemInfo.fState |= MF_MOUSESELECT; @@ -2840,11 +2870,12 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl if (IS_SYSTEM_MENU(MenuInfo)) { - ERR("Right click on window bar and Draw system menu!\n"); - MenuInitSysMenuPopup(ItemInfo.hSubMenu, GetWindowLongPtrW(MenuInfo->Wnd, GWL_STYLE), + MenuInitSysMenuPopup(ItemInfo.hSubMenu, + GetWindowLongPtrW(MenuInfo->Wnd, GWL_STYLE), GetClassLongPtrW(MenuInfo->Wnd, GCL_STYLE), HTSYSMENU); - if (Flags & TPM_LAYOUTRTL) Rect.left; + NcGetSysPopupPos(MenuInfo->Wnd, &Rect); + if (Flags & TPM_LAYOUTRTL) Rect.left = Rect.right; Rect.top = Rect.bottom; Rect.right = GetSystemMetrics(SM_CXSIZE); Rect.bottom = GetSystemMetrics(SM_CYSIZE); @@ -2852,16 +2883,18 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl else { GetWindowRect(MenuInfo->Wnd, &Rect); - if (0 != (MenuInfo->fFlags & MNF_POPUP)) + if (MenuInfo->fFlags & MNF_POPUP) { RECT rc = ItemInfo.Rect; MENU_AdjustMenuItemRect(MenuInfo, &rc); + /* The first item in the popup menu has to be at the + same y position as the focused menu item */ if(Flags & TPM_LAYOUTRTL) Rect.left += GetSystemMetrics(SM_CXBORDER); else - Rect.left += ItemInfo.Rect.right- GetSystemMetrics(SM_CXBORDER); + Rect.left += rc.right /*ItemInfo.Rect.right*/ - GetSystemMetrics(SM_CXBORDER); Rect.top += rc.top - MENU_TOP_MARGIN;//3; Rect.right = rc.left - rc.right + GetSystemMetrics(SM_CXBORDER); Rect.bottom = rc.top - rc.bottom - MENU_TOP_MARGIN - MENU_BOTTOM_MARGIN/*2*/ @@ -2926,13 +2959,14 @@ MenuHideSubPopups(HWND WndOwner, PROSMENUINFO MenuInfo, TRACE("owner=%x menu=%x 0x%04x\n", WndOwner, MenuInfo, SendMenuSelect); - if (NULL != MenuInfo && NULL != top_popup && NO_SELECTED_ITEM != MenuInfo->iItem) + if (MenuInfo && top_popup && NO_SELECTED_ITEM != MenuInfo->iItem) { + //item = &menu->rgItems[menu->iItem]; MenuInitRosMenuItemInfo(&ItemInfo); ItemInfo.fMask |= MIIM_FTYPE | MIIM_STATE; if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->iItem, &ItemInfo) - || 0 == (ItemInfo.hSubMenu) - || 0 == (ItemInfo.fState & MF_MOUSESELECT)) + || !(ItemInfo.hSubMenu) + || !(ItemInfo.fState & MF_MOUSESELECT)) { MenuCleanupRosMenuItemInfo(&ItemInfo); return; @@ -2973,19 +3007,19 @@ MenuSwitchTracking(MTRACKER* Mt, PROSMENUINFO PtMenuInfo, UINT Index, UINT wFlag TRACE("%x menu=%x 0x%04x\n", Mt, PtMenuInfo->Self, Index); - if (MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu) && - Mt->TopMenu != PtMenuInfo->Self && - 0 == ((PtMenuInfo->fFlags | TopMenuInfo.fFlags) & MNF_POPUP)) - { + if ( MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu) && + Mt->TopMenu != PtMenuInfo->Self && + !((PtMenuInfo->fFlags | TopMenuInfo.fFlags) & MNF_POPUP) ) + { /* both are top level menus (system and menu-bar) */ MenuHideSubPopups(Mt->OwnerWnd, &TopMenuInfo, FALSE, wFlags); MenuSelectItem(Mt->OwnerWnd, &TopMenuInfo, NO_SELECTED_ITEM, FALSE, NULL); Mt->TopMenu = PtMenuInfo->Self; - } + } else - { + { MenuHideSubPopups(Mt->OwnerWnd, PtMenuInfo, FALSE, wFlags); - } + } MenuSelectItem(Mt->OwnerWnd, PtMenuInfo, Index, TRUE, NULL); } @@ -3009,35 +3043,35 @@ MenuExecFocusedItem(MTRACKER *Mt, PROSMENUINFO MenuInfo, UINT Flags) TRACE("%p menu=%p\n", Mt, MenuInfo); if (0 == MenuInfo->cItems || NO_SELECTED_ITEM == MenuInfo->iItem) - { + { return -1; - } + } MenuInitRosMenuItemInfo(&ItemInfo); if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->iItem, &ItemInfo)) - { + { MenuCleanupRosMenuItemInfo(&ItemInfo); return -1; - } + } TRACE("%p %08x %p\n", MenuInfo, ItemInfo.wID, ItemInfo.hSubMenu); if (0 == (ItemInfo.hSubMenu)) - { + { if (0 == (ItemInfo.fState & (MF_GRAYED | MF_DISABLED)) && 0 == (ItemInfo.fType & MF_SEPARATOR)) - { + { /* If TPM_RETURNCMD is set you return the id, but do not send a message to the owner */ if (0 == (Flags & TPM_RETURNCMD)) - { + { if (0 != (MenuInfo->fFlags & MNF_SYSDESKMN)) - { + { PostMessageW(Mt->OwnerWnd, WM_SYSCOMMAND, ItemInfo.wID, MAKELPARAM((SHORT) Mt->Pt.x, (SHORT) Mt->Pt.y)); - } + } else - { + { ROSMENUINFO topmenuI; BOOL ret = MenuGetRosMenuInfo(&topmenuI, Mt->TopMenu); DWORD dwStyle = MenuInfo->dwStyle | (ret ? topmenuI.dwStyle : 0); @@ -3046,18 +3080,18 @@ MenuExecFocusedItem(MTRACKER *Mt, PROSMENUINFO MenuInfo, UINT Flags) PostMessageW(Mt->OwnerWnd, WM_MENUCOMMAND, MenuInfo->iItem, (LPARAM)MenuInfo->Self); else PostMessageW(Mt->OwnerWnd, WM_COMMAND, ItemInfo.wID, 0); - } - } + } + } wID = ItemInfo.wID; MenuCleanupRosMenuItemInfo(&ItemInfo); return wID; - } - } + } + } else - { + { Mt->CurrentMenu = MenuShowSubPopup(Mt->OwnerWnd, MenuInfo, TRUE, Flags); return -2; - } + } return -1; } @@ -3077,40 +3111,40 @@ MENU_ButtonDown(MTRACKER* Mt, HMENU PtMenu, UINT Flags) TRACE("%x PtMenu=%p\n", Mt, PtMenu); if (NULL != PtMenu) - { + { if (! MenuGetRosMenuInfo(&MenuInfo, PtMenu)) - { + { return FALSE; - } + } if (IS_SYSTEM_MENU(&MenuInfo)) - { + { Index = 0; - } + } else - { + { Index = NtUserMenuItemFromPoint(Mt->OwnerWnd, PtMenu, Mt->Pt.x, Mt->Pt.y); - } + } MenuInitRosMenuItemInfo(&Item); if (NO_SELECTED_ITEM == Index || ! MenuGetRosMenuItemInfo(PtMenu, Index, &Item)) - { + { MenuCleanupRosMenuItemInfo(&Item); return FALSE; - } + } if (!(Item.fType & MF_SEPARATOR) && !(Item.fState & (MFS_DISABLED | MFS_GRAYED)) ) - { + { if (MenuInfo.iItem != Index) - { + { MenuSwitchTracking(Mt, &MenuInfo, Index, Flags); - } + } /* If the popup menu is not already "popped" */ if (0 == (Item.fState & MF_MOUSESELECT)) - { + { Mt->CurrentMenu = MenuShowSubPopup(Mt->OwnerWnd, &MenuInfo, FALSE, Flags); - } - } + } + } MenuCleanupRosMenuItemInfo(&Item); @@ -3140,42 +3174,42 @@ MENU_ButtonUp(MTRACKER *Mt, HMENU PtMenu, UINT Flags) TRACE("%p hmenu=%x\n", Mt, PtMenu); if (NULL != PtMenu) - { + { Id = 0; if (! MenuGetRosMenuInfo(&MenuInfo, PtMenu)) - { + { return -1; - } + } if (! IS_SYSTEM_MENU(&MenuInfo)) - { + { Id = NtUserMenuItemFromPoint(Mt->OwnerWnd, MenuInfo.Self, Mt->Pt.x, Mt->Pt.y); - } + } MenuInitRosMenuItemInfo(&ItemInfo); if (0 <= Id && MenuGetRosMenuItemInfo(MenuInfo.Self, Id, &ItemInfo) && MenuInfo.iItem == Id) - { + { if (0 == (ItemInfo.hSubMenu)) - { + { INT ExecutedMenuId = MenuExecFocusedItem(Mt, &MenuInfo, Flags); MenuCleanupRosMenuItemInfo(&ItemInfo); return (ExecutedMenuId < 0) ? -1 : ExecutedMenuId; - } + } MenuCleanupRosMenuItemInfo(&ItemInfo); /* If we are dealing with the top-level menu */ /* and this is a click on an already "popped" item: */ /* Stop the menu tracking and close the opened submenus */ if (Mt->TopMenu == MenuInfo.Self && MenuInfo.TimeToHide) - { + { MenuCleanupRosMenuItemInfo(&ItemInfo); return 0; - } - } + } + } MenuCleanupRosMenuItemInfo(&ItemInfo); MenuInfo.TimeToHide = TRUE; MenuSetRosMenuInfo(&MenuInfo); - } + } return -1; } @@ -3236,46 +3270,46 @@ MenuMouseMove(MTRACKER *Mt, HMENU PtMenu, UINT Flags) ROSMENUITEMINFO ItemInfo; if (NULL != PtMenu) - { + { if (! MenuGetRosMenuInfo(&MenuInfo, PtMenu)) - { + { return TRUE; - } + } if (IS_SYSTEM_MENU(&MenuInfo)) - { + { Index = 0; - } + } else - { + { Index = NtUserMenuItemFromPoint(Mt->OwnerWnd, PtMenu, Mt->Pt.x, Mt->Pt.y); - } - } + } + } else - { + { Index = NO_SELECTED_ITEM; - } + } if (NO_SELECTED_ITEM == Index) - { + { if (Mt->CurrentMenu == MenuInfo.Self || MenuGetRosMenuInfo(&MenuInfo, Mt->CurrentMenu)) - { + { MenuSelectItem(Mt->OwnerWnd, &MenuInfo, NO_SELECTED_ITEM, TRUE, Mt->TopMenu); - } - } + } + } else if (MenuInfo.iItem != Index) - { + { MenuInitRosMenuItemInfo(&ItemInfo); if (MenuGetRosMenuItemInfo(MenuInfo.Self, Index, &ItemInfo) && - !(ItemInfo.fType & MF_SEPARATOR)) + !(ItemInfo.fType & MF_SEPARATOR)) { MenuSwitchTracking(Mt, &MenuInfo, Index, Flags); - if (!(ItemInfo.fState & (MFS_DISABLED | MFS_GRAYED))) + if (!(ItemInfo.fState & (MFS_DISABLED | MFS_GRAYED))) Mt->CurrentMenu = MenuShowSubPopup(Mt->OwnerWnd, &MenuInfo, FALSE, Flags); } MenuCleanupRosMenuItemInfo(&ItemInfo); - } + } return TRUE; } @@ -3318,13 +3352,13 @@ MenuDoNextMenu(MTRACKER* Mt, UINT Vk, UINT wFlags) ROSMENUINFO MenuInfo; if (! MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu)) - { + { return (LRESULT) FALSE; - } + } if ((VK_LEFT == Vk && 0 == TopMenuInfo.iItem) || (VK_RIGHT == Vk && TopMenuInfo.iItem == TopMenuInfo.cItems - 1)) - { + { MDINEXTMENU NextMenu; HMENU NewMenu; HWND NewWnd; @@ -3339,93 +3373,93 @@ MenuDoNextMenu(MTRACKER* Mt, UINT Vk, UINT wFlags) Mt->CurrentMenu, Mt->OwnerWnd, NextMenu.hmenuNext, NextMenu.hwndNext ); if (NULL == NextMenu.hmenuNext || NULL == NextMenu.hwndNext) - { + { DWORD Style = GetWindowLongPtrW(Mt->OwnerWnd, GWL_STYLE); NewWnd = Mt->OwnerWnd; if (IS_SYSTEM_MENU(&TopMenuInfo)) - { + { /* switch to the menu bar */ if (0 != (Style & WS_CHILD) || NULL == (NewMenu = GetMenu(NewWnd))) - { + { return FALSE; - } + } if (VK_LEFT == Vk) - { + { if (! MenuGetRosMenuInfo(&MenuInfo, NewMenu)) - { + { return FALSE; - } + } Id = MenuInfo.cItems - 1; - } - } + } + } else if (0 != (Style & WS_SYSMENU)) - { + { /* switch to the system menu */ NewMenu = NtUserGetSystemMenu(NewWnd, FALSE); - } + } else - { + { return FALSE; - } - } + } + } else /* application returned a new menu to switch to */ - { + { NewMenu = NextMenu.hmenuNext; NewWnd = NextMenu.hwndNext; if (IsMenu(NewMenu) && IsWindow(NewWnd)) - { + { DWORD Style = GetWindowLongPtrW(NewWnd, GWL_STYLE); if (0 != (Style & WS_SYSMENU) && GetSystemMenu(NewWnd, FALSE) == NewMenu) - { + { /* get the real system menu */ NewMenu = NtUserGetSystemMenu(NewWnd, FALSE); - } + } else if (0 != (Style & WS_CHILD) || GetMenu(NewWnd) != NewMenu) - { + { /* FIXME: Not sure what to do here; * perhaps try to track NewMenu as a popup? */ WARN(" -- got confused.\n"); return FALSE; - } - } + } + } else - { + { return FALSE; - } - } + } + } if (NewMenu != Mt->TopMenu) - { + { MenuSelectItem(Mt->OwnerWnd, &TopMenuInfo, NO_SELECTED_ITEM, FALSE, 0 ); if (Mt->CurrentMenu != Mt->TopMenu) - { + { MenuHideSubPopups(Mt->OwnerWnd, &TopMenuInfo, FALSE, wFlags); - } - } + } + } if (NewWnd != Mt->OwnerWnd) - { + { Mt->OwnerWnd = NewWnd; NtUserxSetGUIThreadHandle(MSQ_STATE_MENUOWNER, Mt->OwnerWnd); // 1 SetCapture(Mt->OwnerWnd); // 2 - } + } Mt->TopMenu = Mt->CurrentMenu = NewMenu; /* all subpopups are hidden */ if (MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu)) - { + { MenuSelectItem(Mt->OwnerWnd, &TopMenuInfo, Id, TRUE, 0); - } + } return TRUE; - } + } return FALSE; } @@ -3444,7 +3478,7 @@ MenuSuspendPopup(MTRACKER* Mt, UINT uMsg) msg.hwnd = Mt->OwnerWnd; PeekMessageW( &msg, 0, uMsg, uMsg, PM_NOYIELD | PM_REMOVE); // ported incorrectly since 8317 GvG -// Mt->TrackFlags |= TF_SKIPREMOVE; // This sends TrackMenu into a loop with arrow keys!!!! + //Mt->TrackFlags |= TF_SKIPREMOVE; // This sends TrackMenu into a loop with arrow keys!!!! switch( uMsg ) { @@ -3481,27 +3515,27 @@ MenuKeyEscape(MTRACKER *Mt, UINT Flags) HMENU MenuTmp, MenuPrev; if (Mt->CurrentMenu != Mt->TopMenu) - { + { if (MenuGetRosMenuInfo(&MenuInfo, Mt->CurrentMenu) && 0 != (MenuInfo.fFlags & MNF_POPUP)) - { + { MenuPrev = MenuTmp = Mt->TopMenu; /* close topmost popup */ while (MenuTmp != Mt->CurrentMenu) - { + { MenuPrev = MenuTmp; MenuTmp = MENU_GetSubPopup(MenuPrev); - } + } if (MenuGetRosMenuInfo(&MenuInfo, MenuPrev)) - { + { MenuHideSubPopups(Mt->OwnerWnd, &MenuInfo, TRUE, Flags); - } + } Mt->CurrentMenu = MenuPrev; EndMenu = FALSE; - } - } + } + } return EndMenu; } @@ -3534,44 +3568,44 @@ MenuKeyLeft(MTRACKER* Mt, UINT Flags) /* close topmost popup */ while (MenuTmp != Mt->CurrentMenu) - { + { MenuPrev = MenuTmp; MenuTmp = MENU_GetSubPopup(MenuPrev); - } + } if (! MenuGetRosMenuInfo(&PrevMenuInfo, MenuPrev)) - { + { return; - } + } MenuHideSubPopups(Mt->OwnerWnd, &PrevMenuInfo, TRUE, Flags); Mt->CurrentMenu = MenuPrev; if (! MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu)) - { + { return; - } + } if ((MenuPrev == Mt->TopMenu) && !(TopMenuInfo.fFlags & MNF_POPUP)) - { + { /* move menu bar selection if no more popups are left */ if (!MenuDoNextMenu(Mt, VK_LEFT, Flags)) - { + { MenuMoveSelection(Mt->OwnerWnd, &TopMenuInfo, ITEM_PREV); - } + } if (MenuPrev != MenuTmp || Mt->TrackFlags & TF_SUSPENDPOPUP) - { + { /* A sublevel menu was displayed - display the next one * unless there is another displacement coming up */ if (! MenuSuspendPopup(Mt, WM_KEYDOWN) && MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu)) - { + { Mt->CurrentMenu = MenuShowSubPopup(Mt->OwnerWnd, &TopMenuInfo, TRUE, Flags); - } - } - } + } + } + } } /*********************************************************************** @@ -3618,28 +3652,28 @@ static void FASTCALL MenuKeyRight(MTRACKER *Mt, UINT Flags) if (!(MenuInfo.fFlags & MNF_POPUP)) /* menu bar tracking */ { if (Mt->CurrentMenu != Mt->TopMenu) - { + { MenuHideSubPopups(Mt->OwnerWnd, &MenuInfo, FALSE, Flags); hmenutmp = Mt->CurrentMenu = Mt->TopMenu; - } + } else - { + { hmenutmp = NULL; - } + } /* try to move to the next item */ if ( !MenuDoNextMenu(Mt, VK_RIGHT, Flags)) MenuMoveSelection(Mt->OwnerWnd, &MenuInfo, ITEM_NEXT); if ( hmenutmp || Mt->TrackFlags & TF_SUSPENDPOPUP ) - { + { if (! MenuSuspendPopup(Mt, WM_KEYDOWN) && MenuGetRosMenuInfo(&MenuInfo, Mt->TopMenu)) - { + { Mt->CurrentMenu = MenuShowSubPopup(Mt->OwnerWnd, &MenuInfo, TRUE, Flags); - } - } + } + } } } @@ -4401,29 +4435,9 @@ MenuCleanup(VOID) NTSTATUS WINAPI User32LoadSysMenuTemplateForKernel(PVOID Arguments, ULONG ArgumentLength) { - HMENU hmenu = LoadMenuW(User32Instance, L"SYSMENU"); - LRESULT Result = (LRESULT)hmenu; - MENUINFO menuinfo = {0}; - MENUITEMINFOW info = {0}; + LRESULT Result = 0; - // removing space for checkboxes from menu - menuinfo.cbSize = sizeof(menuinfo); - menuinfo.fMask = MIM_STYLE; - GetMenuInfo(hmenu, &menuinfo); - menuinfo.dwStyle |= MNS_CHECKORBMP; // test_menu_bmp_and_string MNS_CHECKORBMP - SetMenuInfo(hmenu, &menuinfo); - - // adding bitmaps to menu items - info.cbSize = sizeof(info); - info.fMask |= MIIM_BITMAP; - info.hbmpItem = HBMMENU_POPUP_MINIMIZE; - SetMenuItemInfoW(hmenu, SC_MINIMIZE, FALSE, &info); - info.hbmpItem = HBMMENU_POPUP_RESTORE; - SetMenuItemInfoW(hmenu, SC_RESTORE, FALSE, &info); - info.hbmpItem = HBMMENU_POPUP_MAXIMIZE; - SetMenuItemInfoW(hmenu, SC_MAXIMIZE, FALSE, &info); - info.hbmpItem = HBMMENU_POPUP_CLOSE; - SetMenuItemInfoW(hmenu, SC_CLOSE, FALSE, &info); + // Will be converted to load bitmaps for OBMI! return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS)); } @@ -4436,10 +4450,7 @@ User32CallLoadMenuFromKernel(PVOID Arguments, ULONG ArgumentLength) Common = (PLOADMENU_CALLBACK_ARGUMENTS) Arguments; - Result = (LRESULT)LoadMenuW( Common->hModule, - IS_INTRESOURCE(Common->MenuName[0]) ? - MAKEINTRESOURCE(Common->MenuName[0]) : - (LPCWSTR)&Common->MenuName); + Result = (LRESULT)LoadMenuW( Common->hModule, Common->InterSource ? MAKEINTRESOURCE(Common->InterSource) : (LPCWSTR)&Common->MenuName); return ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS); } @@ -4464,7 +4475,7 @@ AppendMenuA(HMENU hMenu, MENU_mnu2mnuii( uFlags, uIDNewItem, (LPCWSTR)lpNewItem, &mii, FALSE); - /* copy the text string, it wll be one or the other */ + /* copy the text string, it will be one or the other */ if (lpNewItem && mii.fMask & MIIM_STRING && !mii.hbmpItem && mii.dwTypeData) { if (!RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)mii.dwTypeData)) @@ -4502,7 +4513,7 @@ AppendMenuW(HMENU hMenu, MENU_mnu2mnuii( uFlags, uIDNewItem, lpNewItem, &mii, TRUE); - /* copy the text string, it wll be one or the other */ + /* copy the text string, it will be one or the other */ if (lpNewItem && mii.fMask & MIIM_STRING && !mii.hbmpItem && mii.dwTypeData) { RtlInitUnicodeString(&MenuText, (PWSTR)mii.dwTypeData); @@ -5039,7 +5050,7 @@ InsertMenuA( MENU_mnu2mnuii( uFlags, uIDNewItem, (LPCWSTR)lpNewItem, &mii, FALSE); - /* copy the text string, it wll be one or the other */ + /* copy the text string, it will be one or the other */ if (lpNewItem && mii.fMask & MIIM_STRING && !mii.hbmpItem && mii.dwTypeData) { if (!RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)mii.dwTypeData)) @@ -5160,7 +5171,7 @@ InsertMenuW( MENU_mnu2mnuii( uFlags, uIDNewItem, lpNewItem, &mii, TRUE); - /* copy the text string, it wll be one or the other */ + /* copy the text string, it will be one or the other */ if (lpNewItem && mii.fMask & MIIM_STRING && !mii.hbmpItem && mii.dwTypeData) { RtlInitUnicodeString(&MenuText, (PWSTR)mii.dwTypeData); @@ -5296,7 +5307,7 @@ ModifyMenuA( MENU_mnu2mnuii( uFlags, uIDNewItem, (LPCWSTR)lpNewItem, &mii, FALSE); - /* copy the text string, it wll be one or the other */ + /* copy the text string, it will be one or the other */ if (lpNewItem && mii.fMask & MIIM_STRING && !mii.hbmpItem && mii.dwTypeData) { if (!RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)mii.dwTypeData)) @@ -5336,7 +5347,7 @@ ModifyMenuW( MENU_mnu2mnuii( uFlags, uIDNewItem, lpNewItem, &mii, TRUE); - /* copy the text string, it wll be one or the other */ + /* copy the text string, it will be one or the other */ if (lpNewItem && mii.fMask & MIIM_STRING && !mii.hbmpItem && mii.dwTypeData) { RtlInitUnicodeString(&MenuText, (PWSTR)mii.dwTypeData); From 4c4205442e1f6caa82fa6157466b4a6d07014784 Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Tue, 20 May 2014 18:46:50 +0000 Subject: [PATCH 30/69] [NTVDM] Use a separate palette for text mode. Previously the text mode palette was equal to the first 16 entries of the graphical palette, which is wrong since the AC registers can be used to select arbitrary colors from the DAC. svn path=/trunk/; revision=63385 --- reactos/subsystems/ntvdm/hardware/vga.c | 115 ++++++++++++++++++++---- 1 file changed, 97 insertions(+), 18 deletions(-) diff --git a/reactos/subsystems/ntvdm/hardware/vga.c b/reactos/subsystems/ntvdm/hardware/vga.c index 590ff058407..4593a5d5188 100644 --- a/reactos/subsystems/ntvdm/hardware/vga.c +++ b/reactos/subsystems/ntvdm/hardware/vga.c @@ -171,6 +171,32 @@ static CONST COLORREF VgaDefaultPalette[VGA_MAX_COLORS] = #endif +/* + * Default 16-color palette for foreground and background + * (corresponding flags in comments). + * Taken from subsystems/win32/winsrv/consrv/frontends/gui/conwnd.c + */ +static const COLORREF ConsoleColors[16] = +{ + RGB(0, 0, 0), // (Black) + RGB(0, 0, 128), // BLUE + RGB(0, 128, 0), // GREEN + RGB(0, 128, 128), // BLUE | GREEN + RGB(128, 0, 0), // RED + RGB(128, 0, 128), // BLUE | RED + RGB(128, 128, 0), // GREEN | RED + RGB(192, 192, 192), // BLUE | GREEN | RED + + RGB(128, 128, 128), // (Grey) INTENSITY + RGB(0, 0, 255), // BLUE | INTENSITY + RGB(0, 255, 0), // GREEN | INTENSITY + RGB(0, 255, 255), // BLUE | GREEN | INTENSITY + RGB(255, 0, 0), // RED | INTENSITY + RGB(255, 0, 255), // BLUE | RED | INTENSITY + RGB(255, 255, 0), // GREEN | RED | INTENSITY + RGB(255, 255, 255) // BLUE | GREEN | RED | INTENSITY +}; + /* * Console interface -- VGA-mode-agnostic */ @@ -184,6 +210,7 @@ C_ASSERT(sizeof(CHAR_CELL) == 2); static LPVOID ConsoleFramebuffer = NULL; // Active framebuffer, points to // either TextFramebuffer or a valid // graphics framebuffer. +static HPALETTE TextPaletteHandle = NULL; static HPALETTE PaletteHandle = NULL; static HANDLE StartEvent = NULL; @@ -774,7 +801,7 @@ static VOID VgaWriteCrtc(BYTE Data) static VOID VgaWriteDac(BYTE Data) { - INT PaletteIndex; + INT i, PaletteIndex; PALETTEENTRY Entry; /* Set the value */ @@ -789,8 +816,20 @@ static VOID VgaWriteDac(BYTE Data) Entry.peBlue = VGA_DAC_TO_COLOR(VgaDacRegisters[PaletteIndex * 3 + 2]); Entry.peFlags = 0; - /* Update the palette entry and set the palette change flag */ + /* Update the palette entry */ SetPaletteEntries(PaletteHandle, PaletteIndex, 1, &Entry); + + /* Check which text palette entries are affected */ + for (i = 0; i <= VGA_AC_PAL_F_REG; i++) + { + if (VgaAcRegisters[i] == PaletteIndex) + { + /* Update the text palette entry */ + SetPaletteEntries(TextPaletteHandle, i, 1, &Entry); + } + } + + /* Set the palette changed flag */ PaletteChanged = TRUE; /* Update the index */ @@ -800,6 +839,8 @@ static VOID VgaWriteDac(BYTE Data) static VOID VgaWriteAc(BYTE Data) { + PALETTEENTRY Entry; + ASSERT(VgaAcIndex < VGA_AC_MAX_REG); /* Save the value */ @@ -810,8 +851,17 @@ static VOID VgaWriteAc(BYTE Data) // DbgPrint(" AC Palette Writing %d to index %d\n", Data, VgaAcIndex); if (VgaAcRegisters[VgaAcIndex] != Data) { - /* Update the AC register and set the palette change flag */ + /* Update the AC register */ VgaAcRegisters[VgaAcIndex] = Data; + + /* Fill the entry structure */ + Entry.peRed = VGA_DAC_TO_COLOR(VgaDacRegisters[Data * 3]); + Entry.peGreen = VGA_DAC_TO_COLOR(VgaDacRegisters[Data * 3 + 1]); + Entry.peBlue = VGA_DAC_TO_COLOR(VgaDacRegisters[Data * 3 + 2]); + Entry.peFlags = 0; + + /* Update the palette entry and set the palette change flag */ + SetPaletteEntries(TextPaletteHandle, VgaAcIndex, 1, &Entry); PaletteChanged = TRUE; } } @@ -843,33 +893,62 @@ static VOID VgaRestoreDefaultPalette(PPALETTEENTRY Entries, USHORT NumOfEntries) static BOOLEAN VgaInitializePalette(VOID) { - LPLOGPALETTE Palette; + INT i; + BOOLEAN Result = FALSE; + LPLOGPALETTE Palette, TextPalette; - /* Allocate storage space for the palette */ + /* Allocate storage space for the palettes */ Palette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LOGPALETTE) + - VGA_MAX_COLORS * sizeof(PALETTEENTRY)); - if (Palette == NULL) return FALSE; + VGA_MAX_COLORS * sizeof(PALETTEENTRY)); + TextPalette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(LOGPALETTE) + + (VGA_AC_PAL_F_REG + 1) * sizeof(PALETTEENTRY)); + if ((Palette == NULL) || (TextPalette == NULL)) goto Cleanup; - /* Initialize the palette */ - Palette->palVersion = 0x0300; + /* Initialize the palettes */ + Palette->palVersion = TextPalette->palVersion = 0x0300; Palette->palNumEntries = VGA_MAX_COLORS; + TextPalette->palNumEntries = VGA_AC_PAL_F_REG + 1; - /* Restore the default palette */ + /* Restore the default graphics palette */ VgaRestoreDefaultPalette(Palette->palPalEntry, Palette->palNumEntries); - /* Create the palette */ + /* Set the default text palette */ + for (i = 0; i < TextPalette->palNumEntries; i++) + { + /* Set the palette entries */ + TextPalette->palPalEntry[i].peRed = GetRValue(ConsoleColors[i]); + TextPalette->palPalEntry[i].peGreen = GetGValue(ConsoleColors[i]); + TextPalette->palPalEntry[i].peBlue = GetBValue(ConsoleColors[i]); + TextPalette->palPalEntry[i].peFlags = 0; + } + + /* Create the palettes */ PaletteHandle = CreatePalette(Palette); + TextPaletteHandle = CreatePalette(TextPalette); - /* Free the palette */ - HeapFree(GetProcessHeap(), 0, Palette); + if (PaletteHandle != NULL && TextPaletteHandle != NULL) + { + /* The palettes have been created successfully */ + Result = TRUE; + } - /* Fail if the palette wasn't successfully created... */ - if (PaletteHandle == NULL) return FALSE; +Cleanup: + /* Free the palettes */ + if (Palette) HeapFree(GetProcessHeap(), 0, Palette); + if (TextPalette) HeapFree(GetProcessHeap(), 0, TextPalette); - /* ... otherwise return success */ - return TRUE; + if (!Result) + { + /* Something failed, delete the palettes */ + if (PaletteHandle) DeleteObject(PaletteHandle); + if (TextPaletteHandle) DeleteObject(TextPaletteHandle); + } + + return Result; } static BOOL VgaEnterGraphicsMode(PCOORD Resolution) @@ -1001,7 +1080,7 @@ static BOOL VgaEnterTextMode(PCOORD Resolution) * screen-buffers, which is a new feature on ReactOS). */ SetConsolePalette(TextConsoleBuffer, - PaletteHandle, + TextPaletteHandle, SYSPAL_NOSTATIC256); /* Set the screen mode flag */ From e387cb4358f62fb5531a18a5a8b64ad828df34ac Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 20 May 2014 19:39:34 +0000 Subject: [PATCH 31/69] [User32] - Update and sync DDE code with wine. Make name space close to what it should be. svn path=/trunk/; revision=63386 --- reactos/win32ss/user/user32/misc/dde.c | 1586 +++++++++--------- reactos/win32ss/user/user32/misc/ddeclient.c | 65 +- reactos/win32ss/user/user32/misc/ddeserver.c | 71 +- 3 files changed, 900 insertions(+), 822 deletions(-) diff --git a/reactos/win32ss/user/user32/misc/dde.c b/reactos/win32ss/user/user32/misc/dde.c index 30498d13c11..d600ba47876 100644 --- a/reactos/win32ss/user/user32/misc/dde.c +++ b/reactos/win32ss/user/user32/misc/dde.c @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddeml); static WDML_INSTANCE* WDML_InstanceList = NULL; static LONG WDML_MaxInstanceID = 0; /* OK for present, have to worry about wrap-around later */ -const WCHAR WDML_szEventClass[] = {'D','d','e','E','v','e','n','t','C','l','a','s','s',0}; +const WCHAR WDML_szEventClass[] = {'D','D','E','M','L','E','v','e','n','t',0}; /* protection for instance list */ CRITICAL_SECTION WDML_CritSect; @@ -91,7 +91,7 @@ LPARAM WINAPI PackDDElParam(UINT msg, UINT_PTR uiLo, UINT_PTR uiHi) return uiHi; default: - return MAKELPARAM(uiLo, uiHi); + return MAKELONG(uiLo, uiHi); } } @@ -229,7 +229,7 @@ BOOL WINAPI ImpersonateDdeClientWindow(HWND hWndClient, HWND hWndServer) * DdeSetQualityOfService (USER32.@) */ -BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, CONST SECURITY_QUALITY_OF_SERVICE *pqosNew, +BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, const SECURITY_QUALITY_OF_SERVICE *pqosNew, PSECURITY_QUALITY_OF_SERVICE pqosPrev) { FIXME("(%p %p %p): stub\n", hwndClient, pqosNew, pqosPrev); @@ -238,535 +238,10 @@ BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, CONST SECURITY_QUALITY_OF_SE /* ================================================================ * - * Instance management + * WDML Error management * * ================================================================ */ -/****************************************************************************** - * IncrementInstanceId - * - * generic routine to increment the max instance Id and allocate a new application instance - */ -static void WDML_IncrementInstanceId(WDML_INSTANCE* pInstance) -{ - DWORD id = InterlockedIncrement(&WDML_MaxInstanceID); - - pInstance->instanceID = id; - TRACE("New instance id %d allocated\n", id); -} - -/****************************************************************** - * WDML_EventProc - * - * - */ -static LRESULT CALLBACK WDML_EventProc(HWND hwndEvent, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - WDML_INSTANCE* pInstance; - HSZ hsz1, hsz2; - - switch (uMsg) - { - case WM_WDML_REGISTER: - pInstance = WDML_GetInstanceFromWnd(hwndEvent); - /* try calling the Callback */ - if (pInstance && !(pInstance->CBFflags & CBF_SKIP_REGISTRATIONS)) - { - hsz1 = WDML_MakeHszFromAtom(pInstance, wParam); - hsz2 = WDML_MakeHszFromAtom(pInstance, lParam); - WDML_InvokeCallback(pInstance, XTYP_REGISTER, 0, 0, hsz1, hsz2, 0, 0, 0); - WDML_DecHSZ(pInstance, hsz1); - WDML_DecHSZ(pInstance, hsz2); - } - break; - - case WM_WDML_UNREGISTER: - pInstance = WDML_GetInstanceFromWnd(hwndEvent); - if (pInstance && !(pInstance->CBFflags & CBF_SKIP_UNREGISTRATIONS)) - { - hsz1 = WDML_MakeHszFromAtom(pInstance, wParam); - hsz2 = WDML_MakeHszFromAtom(pInstance, lParam); - WDML_InvokeCallback(pInstance, XTYP_UNREGISTER, 0, 0, hsz1, hsz2, 0, 0, 0); - WDML_DecHSZ(pInstance, hsz1); - WDML_DecHSZ(pInstance, hsz2); - } - break; - - case WM_WDML_CONNECT_CONFIRM: - pInstance = WDML_GetInstanceFromWnd(hwndEvent); - if (pInstance && !(pInstance->CBFflags & CBF_SKIP_CONNECT_CONFIRMS)) - { - WDML_CONV* pConv; - /* confirm connection... - * lookup for this conv handle - */ - HWND client = (HWND)wParam; - HWND server = (HWND)lParam; - for (pConv = pInstance->convs[WDML_SERVER_SIDE]; pConv != NULL; pConv = pConv->next) - { - if (pConv->hwndClient == client && pConv->hwndServer == server) - break; - } - if (pConv) - { - pConv->wStatus |= ST_ISLOCAL; - - WDML_InvokeCallback(pInstance, XTYP_CONNECT_CONFIRM, 0, (HCONV)pConv, - pConv->hszTopic, pConv->hszService, 0, 0, - (pConv->wStatus & ST_ISSELF) ? 1 : 0); - } - } - break; - default: - return DefWindowProcW(hwndEvent, uMsg, wParam, lParam); - } - return 0; -} - -/****************************************************************** - * WDML_Initialize - * - * - */ -UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, - DWORD afCmd, DWORD ulRes, BOOL bUnicode) -{ - WDML_INSTANCE* pInstance; - WDML_INSTANCE* reference_inst; - UINT ret; - WNDCLASSEXW wndclass; - - TRACE("(%p,%p,0x%x,%d,0x%x)\n", - pidInst, pfnCallback, afCmd, ulRes, bUnicode); - - if (ulRes) - { - ERR("Reserved value not zero? What does this mean?\n"); - /* trap this and no more until we know more */ - return DMLERR_NO_ERROR; - } - - /* grab enough heap for one control struct - not really necessary for re-initialise - * but allows us to use same validation routines */ - pInstance = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_INSTANCE)); - if (pInstance == NULL) - { - /* catastrophe !! warn user & abort */ - ERR("Instance create failed - out of memory\n"); - return DMLERR_SYS_ERROR; - } - pInstance->next = NULL; - pInstance->monitor = (afCmd | APPCLASS_MONITOR); - - /* messy bit, spec implies that 'Client Only' can be set in 2 different ways, catch 1 here */ - - pInstance->clientOnly = afCmd & APPCMD_CLIENTONLY; - pInstance->instanceID = *pidInst; /* May need to add calling proc Id */ - pInstance->threadID = GetCurrentThreadId(); - pInstance->callback = *pfnCallback; - pInstance->unicode = bUnicode; - pInstance->nodeList = NULL; /* node will be added later */ - pInstance->monitorFlags = afCmd & MF_MASK; - pInstance->wStatus = 0; - pInstance->lastError = DMLERR_NO_ERROR; - pInstance->servers = NULL; - pInstance->convs[0] = NULL; - pInstance->convs[1] = NULL; - pInstance->links[0] = NULL; - pInstance->links[1] = NULL; - - /* isolate CBF flags in one go, expect this will go the way of all attempts to be clever !! */ - - pInstance->CBFflags = afCmd^((afCmd&MF_MASK)|((afCmd&APPCMD_MASK)|(afCmd&APPCLASS_MASK))); - - if (!pInstance->clientOnly) - { - /* Check for other way of setting Client-only !! */ - pInstance->clientOnly = - (pInstance->CBFflags & CBF_FAIL_ALLSVRXACTIONS) == CBF_FAIL_ALLSVRXACTIONS; - } - - TRACE("instance created - checking validity\n"); - - if (*pidInst == 0) - { - /* Initialisation of new Instance Identifier */ - TRACE("new instance, callback %p flags %X\n",pfnCallback,afCmd); - - EnterCriticalSection(&WDML_CritSect); - - if (WDML_InstanceList == NULL) - { - /* can't be another instance in this case, assign to the base pointer */ - WDML_InstanceList = pInstance; - - /* since first must force filter of XTYP_CONNECT and XTYP_WILDCONNECT for - * present - * ------------------------------- NOTE NOTE NOTE -------------------------- - * - * the manual is not clear if this condition - * applies to the first call to DdeInitialize from an application, or the - * first call for a given callback !!! - */ - - pInstance->CBFflags = pInstance->CBFflags|APPCMD_FILTERINITS; - TRACE("First application instance detected OK\n"); - /* allocate new instance ID */ - WDML_IncrementInstanceId(pInstance); - } - else - { - /* really need to chain the new one in to the latest here, but after checking conditions - * such as trying to start a conversation from an application trying to monitor */ - reference_inst = WDML_InstanceList; - TRACE("Subsequent application instance - starting checks\n"); - while (reference_inst->next != NULL) - { - /* - * This set of tests will work if application uses same instance Id - * at application level once allocated - which is what manual implies - * should happen. If someone tries to be - * clever (lazy ?) it will fail to pick up that later calls are for - * the same application - should we trust them ? - */ - if (pInstance->instanceID == reference_inst->instanceID) - { - /* Check 1 - must be same Client-only state */ - - if (pInstance->clientOnly != reference_inst->clientOnly) - { - ret = DMLERR_DLL_USAGE; - goto theError; - } - - /* Check 2 - cannot use 'Monitor' with any non-monitor modes */ - - if (pInstance->monitor != reference_inst->monitor) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - - /* Check 3 - must supply different callback address */ - - if (pInstance->callback == reference_inst->callback) - { - ret = DMLERR_DLL_USAGE; - goto theError; - } - } - reference_inst = reference_inst->next; - } - /* All cleared, add to chain */ - - TRACE("Application Instance checks finished\n"); - WDML_IncrementInstanceId(pInstance); - reference_inst->next = pInstance; - } - LeaveCriticalSection(&WDML_CritSect); - - *pidInst = pInstance->instanceID; - - /* for deadlock issues, windows must always be created when outside the critical section */ - wndclass.cbSize = sizeof(wndclass); - wndclass.style = 0; - wndclass.lpfnWndProc = WDML_EventProc; - wndclass.cbClsExtra = 0; - wndclass.cbWndExtra = sizeof(ULONG_PTR); - wndclass.hInstance = 0; - wndclass.hIcon = 0; - wndclass.hCursor = 0; - wndclass.hbrBackground = 0; - wndclass.lpszMenuName = NULL; - wndclass.lpszClassName = WDML_szEventClass; - wndclass.hIconSm = 0; - - RegisterClassExW(&wndclass); - - pInstance->hwndEvent = CreateWindowW(WDML_szEventClass, NULL, - WS_POPUP, 0, 0, 0, 0, - 0, 0, 0, 0); - - SetWindowLongPtrW(pInstance->hwndEvent, GWL_WDML_INSTANCE, (ULONG_PTR)pInstance); - - TRACE("New application instance processing finished OK\n"); - } - else - { - /* Reinitialisation situation --- FIX */ - TRACE("reinitialisation of (%p,%p,0x%x,%d): stub\n", pidInst, pfnCallback, afCmd, ulRes); - - EnterCriticalSection(&WDML_CritSect); - - if (WDML_InstanceList == NULL) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - /* can't reinitialise if we have initialised nothing !! */ - reference_inst = WDML_InstanceList; - /* must first check if we have been given a valid instance to re-initialise !! how do we do that ? */ - /* - * MS allows initialisation without specifying a callback, should we allow addition of the - * callback by a later call to initialise ? - if so this lot will have to change - */ - while (reference_inst->next != NULL) - { - if (*pidInst == reference_inst->instanceID && pfnCallback == reference_inst->callback) - { - /* Check 1 - cannot change client-only mode if set via APPCMD_CLIENTONLY */ - - if (reference_inst->clientOnly) - { - if ((reference_inst->CBFflags & CBF_FAIL_ALLSVRXACTIONS) != CBF_FAIL_ALLSVRXACTIONS) - { - /* i.e. Was set to Client-only and through APPCMD_CLIENTONLY */ - - if (!(afCmd & APPCMD_CLIENTONLY)) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - } - } - /* Check 2 - cannot change monitor modes */ - - if (pInstance->monitor != reference_inst->monitor) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - - /* Check 3 - trying to set Client-only via APPCMD when not set so previously */ - - if ((afCmd&APPCMD_CLIENTONLY) && !reference_inst->clientOnly) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - break; - } - reference_inst = reference_inst->next; - } - if (reference_inst->next == NULL) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - /* All checked - change relevant flags */ - - reference_inst->CBFflags = pInstance->CBFflags; - reference_inst->clientOnly = pInstance->clientOnly; - reference_inst->monitorFlags = pInstance->monitorFlags; - - HeapFree(GetProcessHeap(), 0, pInstance); /* finished - release heap space used as work store */ - - LeaveCriticalSection(&WDML_CritSect); - } - - return DMLERR_NO_ERROR; - theError: - HeapFree(GetProcessHeap(), 0, pInstance); - LeaveCriticalSection(&WDML_CritSect); - return ret; -} - -/****************************************************************************** - * DdeInitializeA (USER32.@) - * - * See DdeInitializeW. - */ -UINT WINAPI DdeInitializeA(LPDWORD pidInst, PFNCALLBACK pfnCallback, - DWORD afCmd, DWORD ulRes) -{ - return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, FALSE); -} - -/****************************************************************************** - * DdeInitializeW [USER32.@] - * Registers an application with the DDEML - * - * PARAMS - * pidInst [I] Pointer to instance identifier - * pfnCallback [I] Pointer to callback function - * afCmd [I] Set of command and filter flags - * ulRes [I] Reserved - * - * RETURNS - * Success: DMLERR_NO_ERROR - * Failure: DMLERR_DLL_USAGE, DMLERR_INVALIDPARAMETER, DMLERR_SYS_ERROR - */ -UINT WINAPI DdeInitializeW(LPDWORD pidInst, PFNCALLBACK pfnCallback, - DWORD afCmd, DWORD ulRes) -{ - return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, TRUE); -} - -/***************************************************************** - * DdeUninitialize [USER32.@] Frees DDEML resources - * - * PARAMS - * idInst [I] Instance identifier - * - * RETURNS - * Success: TRUE - * Failure: FALSE - */ - -BOOL WINAPI DdeUninitialize(DWORD idInst) -{ - /* Stage one - check if we have a handle for this instance - */ - WDML_INSTANCE* pInstance; - WDML_CONV* pConv; - WDML_CONV* pConvNext; - - TRACE("(%d)\n", idInst); - - /* First check instance - */ - pInstance = WDML_GetInstance(idInst); - if (pInstance == NULL) - { - /* - * Needs something here to record NOT_INITIALIZED ready for DdeGetLastError - */ - return FALSE; - } - - /* first terminate all conversations client side - * this shall close existing links... - */ - for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv != NULL; pConv = pConvNext) - { - pConvNext = pConv->next; - DdeDisconnect((HCONV)pConv); - } - if (pInstance->convs[WDML_CLIENT_SIDE]) - FIXME("still pending conversations\n"); - - /* then unregister all known service names */ - DdeNameService(idInst, 0, 0, DNS_UNREGISTER); - - /* Free the nodes that were not freed by this instance - * and remove the nodes from the list of HSZ nodes. - */ - WDML_FreeAllHSZ(pInstance); - - DestroyWindow(pInstance->hwndEvent); - - /* OK now delete the instance handle itself */ - - if (WDML_InstanceList == pInstance) - { - /* special case - the first/only entry */ - WDML_InstanceList = pInstance->next; - } - else - { - /* general case, remove entry */ - WDML_INSTANCE* inst; - - for (inst = WDML_InstanceList; inst->next != pInstance; inst = inst->next); - inst->next = pInstance->next; - } - /* release the heap entry - */ - HeapFree(GetProcessHeap(), 0, pInstance); - - return TRUE; -} - -/****************************************************************** - * WDML_NotifyThreadExit - * - * - */ -void WDML_NotifyThreadDetach(void) -{ - WDML_INSTANCE* pInstance; - WDML_INSTANCE* next; - DWORD tid = GetCurrentThreadId(); - - EnterCriticalSection(&WDML_CritSect); - for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = next) - { - next = pInstance->next; - if (pInstance->threadID == tid) - { - LeaveCriticalSection(&WDML_CritSect); - DdeUninitialize(pInstance->instanceID); - EnterCriticalSection(&WDML_CritSect); - } - } - LeaveCriticalSection(&WDML_CritSect); -} - -/****************************************************************** - * WDML_InvokeCallback - * - * - */ -HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInstance, UINT uType, UINT uFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hdata, - ULONG_PTR dwData1, ULONG_PTR dwData2) -{ - HDDEDATA ret; - - if (pInstance == NULL) - return NULL; - - TRACE("invoking CB[%p] (%x %x %p %p %p %p %lx %lx)\n", - pInstance->callback, uType, uFmt, - hConv, hsz1, hsz2, hdata, dwData1, dwData2); - ret = pInstance->callback(uType, uFmt, hConv, hsz1, hsz2, hdata, dwData1, dwData2); - TRACE("done => %p\n", ret); - return ret; -} - -/***************************************************************************** - * WDML_GetInstance - * - * generic routine to return a pointer to the relevant DDE_HANDLE_ENTRY - * for an instance Id, or NULL if the entry does not exist - * - */ -WDML_INSTANCE* WDML_GetInstance(DWORD instId) -{ - WDML_INSTANCE* pInstance; - - EnterCriticalSection(&WDML_CritSect); - - for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = pInstance->next) - { - if (pInstance->instanceID == instId) - { - if (GetCurrentThreadId() != pInstance->threadID) - { - FIXME("Tried to get instance from wrong thread\n"); - continue; - } - break; - } - } - - LeaveCriticalSection(&WDML_CritSect); - - if (!pInstance) - WARN("Instance entry missing for id %04x\n", instId); - return pInstance; -} - -/****************************************************************** - * WDML_GetInstanceFromWnd - * - * - */ -WDML_INSTANCE* WDML_GetInstanceFromWnd(HWND hWnd) -{ - return (WDML_INSTANCE*)GetWindowLongPtrW(hWnd, GWL_WDML_INSTANCE); -} - /****************************************************************************** * DdeGetLastError [USER32.@] Gets most recent error code * @@ -1258,6 +733,545 @@ INT WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) return ret; } +/* ================================================================ + * + * Instance management + * + * ================================================================ */ + +/****************************************************************************** + * IncrementInstanceId + * + * generic routine to increment the max instance Id and allocate a new application instance + */ +static void WDML_IncrementInstanceId(WDML_INSTANCE* pInstance) +{ + DWORD id = InterlockedIncrement(&WDML_MaxInstanceID); + + pInstance->instanceID = id; + TRACE("New instance id %d allocated\n", id); +} + +/****************************************************************** + * WDML_EventProc + * + * + */ +static LRESULT CALLBACK WDML_EventProc(HWND hwndEvent, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + WDML_INSTANCE* pInstance; + HSZ hsz1, hsz2; + + switch (uMsg) + { + case WM_WDML_REGISTER: + pInstance = WDML_GetInstanceFromWnd(hwndEvent); + /* try calling the Callback */ + if (pInstance && !(pInstance->CBFflags & CBF_SKIP_REGISTRATIONS)) + { + hsz1 = WDML_MakeHszFromAtom(pInstance, wParam); + hsz2 = WDML_MakeHszFromAtom(pInstance, lParam); + WDML_InvokeCallback(pInstance, XTYP_REGISTER, 0, 0, hsz1, hsz2, 0, 0, 0); + WDML_DecHSZ(pInstance, hsz1); + WDML_DecHSZ(pInstance, hsz2); + } + break; + + case WM_WDML_UNREGISTER: + pInstance = WDML_GetInstanceFromWnd(hwndEvent); + if (pInstance && !(pInstance->CBFflags & CBF_SKIP_UNREGISTRATIONS)) + { + hsz1 = WDML_MakeHszFromAtom(pInstance, wParam); + hsz2 = WDML_MakeHszFromAtom(pInstance, lParam); + WDML_InvokeCallback(pInstance, XTYP_UNREGISTER, 0, 0, hsz1, hsz2, 0, 0, 0); + WDML_DecHSZ(pInstance, hsz1); + WDML_DecHSZ(pInstance, hsz2); + } + break; + + case WM_WDML_CONNECT_CONFIRM: + pInstance = WDML_GetInstanceFromWnd(hwndEvent); + if (pInstance && !(pInstance->CBFflags & CBF_SKIP_CONNECT_CONFIRMS)) + { + WDML_CONV* pConv; + /* confirm connection... + * lookup for this conv handle + */ + HWND client = (HWND)wParam; + HWND server = (HWND)lParam; + for (pConv = pInstance->convs[WDML_SERVER_SIDE]; pConv != NULL; pConv = pConv->next) + { + if (pConv->hwndClient == client && pConv->hwndServer == server) + break; + } + if (pConv) + { + pConv->wStatus |= ST_ISLOCAL; + + WDML_InvokeCallback(pInstance, XTYP_CONNECT_CONFIRM, 0, (HCONV)pConv, + pConv->hszTopic, pConv->hszService, 0, 0, + (pConv->wStatus & ST_ISSELF) ? 1 : 0); + } + } + break; + default: + return DefWindowProcW(hwndEvent, uMsg, wParam, lParam); + } + return 0; +} + +/****************************************************************** + * WDML_Initialize + * + * + */ +UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, + DWORD afCmd, DWORD ulRes, BOOL bUnicode) +{ + WDML_INSTANCE* pInstance; + WDML_INSTANCE* reference_inst; + UINT ret; + WNDCLASSEXW wndclass; + + TRACE("(%p,%p,0x%x,%d,0x%x)\n", + pidInst, pfnCallback, afCmd, ulRes, bUnicode); + + if (ulRes) + { + ERR("Reserved value not zero? What does this mean?\n"); + /* trap this and no more until we know more */ + return DMLERR_INVALIDPARAMETER; + } + + /* grab enough heap for one control struct - not really necessary for re-initialise + * but allows us to use same validation routines */ + pInstance = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_INSTANCE)); + if (pInstance == NULL) + { + /* catastrophe !! warn user & abort */ + ERR("Instance create failed - out of memory\n"); + return DMLERR_SYS_ERROR; + } + pInstance->next = NULL; + pInstance->monitor = (afCmd | APPCLASS_MONITOR); + + /* messy bit, spec implies that 'Client Only' can be set in 2 different ways, catch 1 here */ + + pInstance->clientOnly = afCmd & APPCMD_CLIENTONLY; + pInstance->instanceID = *pidInst; /* May need to add calling proc Id */ + pInstance->threadID = GetCurrentThreadId(); + pInstance->callback = *pfnCallback; + pInstance->unicode = bUnicode; + pInstance->nodeList = NULL; /* node will be added later */ + pInstance->monitorFlags = afCmd & MF_MASK; + pInstance->wStatus = 0; + pInstance->lastError = DMLERR_NO_ERROR; + pInstance->servers = NULL; + pInstance->convs[0] = NULL; + pInstance->convs[1] = NULL; + pInstance->links[0] = NULL; + pInstance->links[1] = NULL; + + /* isolate CBF flags in one go, expect this will go the way of all attempts to be clever !! */ + + pInstance->CBFflags = afCmd^((afCmd&MF_MASK)|((afCmd&APPCMD_MASK)|(afCmd&APPCLASS_MASK))); + + if (!pInstance->clientOnly) + { + /* Check for other way of setting Client-only !! */ + pInstance->clientOnly = + (pInstance->CBFflags & CBF_FAIL_ALLSVRXACTIONS) == CBF_FAIL_ALLSVRXACTIONS; + } + + ERR("instance created - checking validity\n"); + + if (*pidInst == 0) + { + /* Initialisation of new Instance Identifier */ + ERR("new instance, callback %p flags %X\n",pfnCallback,afCmd); + + EnterCriticalSection(&WDML_CritSect); + + if (WDML_InstanceList == NULL) + { + /* can't be another instance in this case, assign to the base pointer */ + WDML_InstanceList = pInstance; + + /* since first must force filter of XTYP_CONNECT and XTYP_WILDCONNECT for + * present + * ------------------------------- NOTE NOTE NOTE -------------------------- + * + * the manual is not clear if this condition + * applies to the first call to DdeInitialize from an application, or the + * first call for a given callback !!! + */ + + pInstance->CBFflags = pInstance->CBFflags|APPCMD_FILTERINITS; + ERR("First application instance detected OK\n"); + /* allocate new instance ID */ + WDML_IncrementInstanceId(pInstance); + } + else + { + /* really need to chain the new one in to the latest here, but after checking conditions + * such as trying to start a conversation from an application trying to monitor */ + reference_inst = WDML_InstanceList; + ERR("Subsequent application instance - starting checks\n"); + while (reference_inst->next != NULL) + { + /* + * This set of tests will work if application uses same instance Id + * at application level once allocated - which is what manual implies + * should happen. If someone tries to be + * clever (lazy ?) it will fail to pick up that later calls are for + * the same application - should we trust them ? + */ + if (pInstance->instanceID == reference_inst->instanceID) + { + /* Check 1 - must be same Client-only state */ + + if (pInstance->clientOnly != reference_inst->clientOnly) + { + ERR("WDML_Initialize Mustbe Client-only\n"); + ret = DMLERR_DLL_USAGE; + goto theError; + } + + /* Check 2 - cannot use 'Monitor' with any non-monitor modes */ + + if (pInstance->monitor != reference_inst->monitor) + { + ERR("WDML_Initialize cannot use monitor w/any modes\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + + /* Check 3 - must supply different callback address */ + + if (pInstance->callback == reference_inst->callback) + { + ret = DMLERR_DLL_USAGE; + goto theError; + } + } + reference_inst = reference_inst->next; + } + /* All cleared, add to chain */ + + ERR("Application Instance checks finished\n"); + WDML_IncrementInstanceId(pInstance); + reference_inst->next = pInstance; + } + LeaveCriticalSection(&WDML_CritSect); + + *pidInst = pInstance->instanceID; + + /* for deadlock issues, windows must always be created when outside the critical section */ + wndclass.cbSize = sizeof(wndclass); + wndclass.style = 0; + wndclass.lpfnWndProc = WDML_EventProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = sizeof(ULONG_PTR); + wndclass.hInstance = 0; + wndclass.hIcon = 0; + wndclass.hCursor = 0; + wndclass.hbrBackground = 0; + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = WDML_szEventClass; + wndclass.hIconSm = 0; + + RegisterClassExW(&wndclass); + + pInstance->hwndEvent = CreateWindowW(WDML_szEventClass, NULL, + WS_POPUP, 0, 0, 0, 0, + 0, 0, 0, 0); + + SetWindowLongPtrW(pInstance->hwndEvent, GWL_WDML_INSTANCE, (ULONG_PTR)pInstance); + + ERR("New application instance processing finished OK\n"); + } + else + { + /* Reinitialisation situation --- FIX */ + ERR("reinitialisation of (%p,%p,0x%x,%d): stub\n", pidInst, pfnCallback, afCmd, ulRes); + + EnterCriticalSection(&WDML_CritSect); + + if (WDML_InstanceList == NULL) + { + ERR("WDML_Initialize No instance list\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + /* can't reinitialise if we have initialised nothing !! */ + reference_inst = WDML_InstanceList; + /* must first check if we have been given a valid instance to re-initialise !! how do we do that ? */ + /* + * MS allows initialisation without specifying a callback, should we allow addition of the + * callback by a later call to initialise ? - if so this lot will have to change + */ + while (reference_inst->next != NULL) + { + if (*pidInst == reference_inst->instanceID && pfnCallback == reference_inst->callback) + { + /* Check 1 - cannot change client-only mode if set via APPCMD_CLIENTONLY */ + + if (reference_inst->clientOnly) + { + if ((reference_inst->CBFflags & CBF_FAIL_ALLSVRXACTIONS) != CBF_FAIL_ALLSVRXACTIONS) + { + /* i.e. Was set to Client-only and through APPCMD_CLIENTONLY */ + + if (!(afCmd & APPCMD_CLIENTONLY)) + { + ERR("WDML_Initialize AppCmd Client-only 2\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + } + } + /* Check 2 - cannot change monitor modes */ + + if (pInstance->monitor != reference_inst->monitor) + { + ERR("WDML_Initialize cannot change monitor modes 2\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + + /* Check 3 - trying to set Client-only via APPCMD when not set so previously */ + + if ((afCmd&APPCMD_CLIENTONLY) && !reference_inst->clientOnly) + { + ERR("WDML_Initialize trying to set Client-only via APPCMD\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + break; + } + reference_inst = reference_inst->next; + } + if (reference_inst->next == NULL) + { + ERR("WDML_Initialize Nothing Next\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + /* All checked - change relevant flags */ + + reference_inst->CBFflags = pInstance->CBFflags; + reference_inst->clientOnly = pInstance->clientOnly; + reference_inst->monitorFlags = pInstance->monitorFlags; + + HeapFree(GetProcessHeap(), 0, pInstance); /* finished - release heap space used as work store */ + + LeaveCriticalSection(&WDML_CritSect); + } + + return DMLERR_NO_ERROR; + theError: + ERR("WDML_Initialize error %x\n",ret); + HeapFree(GetProcessHeap(), 0, pInstance); + LeaveCriticalSection(&WDML_CritSect); + return ret; +} + +/****************************************************************************** + * DdeInitializeA (USER32.@) + * + * See DdeInitializeW. + */ +UINT WINAPI DdeInitializeA(LPDWORD pidInst, PFNCALLBACK pfnCallback, + DWORD afCmd, DWORD ulRes) +{ + return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, FALSE); +} + +/****************************************************************************** + * DdeInitializeW [USER32.@] + * Registers an application with the DDEML + * + * PARAMS + * pidInst [I] Pointer to instance identifier + * pfnCallback [I] Pointer to callback function + * afCmd [I] Set of command and filter flags + * ulRes [I] Reserved + * + * RETURNS + * Success: DMLERR_NO_ERROR + * Failure: DMLERR_DLL_USAGE, DMLERR_INVALIDPARAMETER, DMLERR_SYS_ERROR + */ +UINT WINAPI DdeInitializeW(LPDWORD pidInst, PFNCALLBACK pfnCallback, + DWORD afCmd, DWORD ulRes) +{ + return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, TRUE); +} + +/***************************************************************** + * DdeUninitialize [USER32.@] Frees DDEML resources + * + * PARAMS + * idInst [I] Instance identifier + * + * RETURNS + * Success: TRUE + * Failure: FALSE + */ + +BOOL WINAPI DdeUninitialize(DWORD idInst) +{ + /* Stage one - check if we have a handle for this instance + */ + WDML_INSTANCE* pInstance; + WDML_CONV* pConv; + WDML_CONV* pConvNext; + + TRACE("(%d)\n", idInst); + + /* First check instance + */ + pInstance = WDML_GetInstance(idInst); + if (pInstance == NULL) + { + /* + * Needs something here to record NOT_INITIALIZED ready for DdeGetLastError + */ + return FALSE; + } + + /* first terminate all conversations client side + * this shall close existing links... + */ + for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv != NULL; pConv = pConvNext) + { + pConvNext = pConv->next; + DdeDisconnect((HCONV)pConv); + } + if (pInstance->convs[WDML_CLIENT_SIDE]) + FIXME("still pending conversations\n"); + + /* then unregister all known service names */ + DdeNameService(idInst, 0, 0, DNS_UNREGISTER); + + /* Free the nodes that were not freed by this instance + * and remove the nodes from the list of HSZ nodes. + */ + WDML_FreeAllHSZ(pInstance); + + DestroyWindow(pInstance->hwndEvent); + + /* OK now delete the instance handle itself */ + + if (WDML_InstanceList == pInstance) + { + /* special case - the first/only entry */ + WDML_InstanceList = pInstance->next; + } + else + { + /* general case, remove entry */ + WDML_INSTANCE* inst; + + for (inst = WDML_InstanceList; inst->next != pInstance; inst = inst->next); + inst->next = pInstance->next; + } + /* release the heap entry + */ + HeapFree(GetProcessHeap(), 0, pInstance); + + return TRUE; +} + +/****************************************************************** + * WDML_NotifyThreadExit + * + * + */ +void WDML_NotifyThreadDetach(void) +{ + WDML_INSTANCE* pInstance; + WDML_INSTANCE* next; + DWORD tid = GetCurrentThreadId(); + + EnterCriticalSection(&WDML_CritSect); + for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = next) + { + next = pInstance->next; + if (pInstance->threadID == tid) + { + LeaveCriticalSection(&WDML_CritSect); + DdeUninitialize(pInstance->instanceID); + EnterCriticalSection(&WDML_CritSect); + } + } + LeaveCriticalSection(&WDML_CritSect); +} + +/****************************************************************** + * WDML_InvokeCallback + * + * + */ +HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInstance, UINT uType, UINT uFmt, HCONV hConv, + HSZ hsz1, HSZ hsz2, HDDEDATA hdata, + ULONG_PTR dwData1, ULONG_PTR dwData2) +{ + HDDEDATA ret; + + if (pInstance == NULL) + return NULL; + + TRACE("invoking CB[%p] (%x %x %p %p %p %p %lx %lx)\n", + pInstance->callback, uType, uFmt, + hConv, hsz1, hsz2, hdata, dwData1, dwData2); + ret = pInstance->callback(uType, uFmt, hConv, hsz1, hsz2, hdata, dwData1, dwData2); + TRACE("done => %p\n", ret); + return ret; +} + +/***************************************************************************** + * WDML_GetInstance + * + * generic routine to return a pointer to the relevant DDE_HANDLE_ENTRY + * for an instance Id, or NULL if the entry does not exist + * + */ +WDML_INSTANCE* WDML_GetInstance(DWORD instId) +{ + WDML_INSTANCE* pInstance; + + EnterCriticalSection(&WDML_CritSect); + + for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = pInstance->next) + { + if (pInstance->instanceID == instId) + { + if (GetCurrentThreadId() != pInstance->threadID) + { + FIXME("Tried to get instance from wrong thread\n"); + continue; + } + break; + } + } + + LeaveCriticalSection(&WDML_CritSect); + + if (!pInstance) + WARN("Instance entry missing for id %04x\n", instId); + return pInstance; +} + +/****************************************************************** + * WDML_GetInstanceFromWnd + * + * + */ +WDML_INSTANCE* WDML_GetInstanceFromWnd(HWND hWnd) +{ + return (WDML_INSTANCE*)GetWindowLongPtrW(hWnd, GWL_WDML_INSTANCE); +} + /* ================================================================ * * Data handle management @@ -1459,7 +1473,7 @@ BOOL WINAPI DdeFreeDataHandle(HDDEDATA hData) /* 1 is the handle value returned by an asynchronous operation. */ if (hData == (HDDEDATA)1) - return TRUE; + return TRUE; return GlobalFree(hData) == 0; } @@ -1514,7 +1528,7 @@ HDDEDATA WDML_Global2DataHandle(WDML_CONV* pConv, HGLOBAL hMem, WINE_DDEH default: FIXME("Unsupported format (%04x) for data %p, passing raw information\n", pDd->cfFormat, hMem); - /* fall thru */ + /* fall through */ case 0: case CF_TEXT: ret = DdeCreateDataHandle(pConv->instance->instanceID, pDd->Value, size, 0, 0, pDd->cfFormat, 0); @@ -1573,7 +1587,7 @@ HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, default: FIXME("Unsupported format (%04x) for data %p, passing raw information\n", pDdh->cfFormat, hDdeData); - /* fall thru */ + /* fall through */ case 0: case CF_TEXT: hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, sizeof(WINE_DDEHEAD) + dwSize); @@ -1736,6 +1750,259 @@ WDML_SERVER* WDML_FindServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTo return NULL; } +/* ================================================================ + * + * Link (hot & warm) management + * + * ================================================================ */ + +/****************************************************************** + * WDML_AddLink + * + * + */ +void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, + UINT wType, HSZ hszItem, UINT wFmt) +{ + WDML_LINK* pLink; + + pLink = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_LINK)); + if (pLink == NULL) + { + ERR("OOM\n"); + return; + } + + pLink->hConv = hConv; + pLink->transactionType = wType; + WDML_IncHSZ(pInstance, pLink->hszItem = hszItem); + pLink->uFmt = wFmt; + pLink->next = pInstance->links[side]; + pInstance->links[side] = pLink; +} + +/****************************************************************** + * WDML_RemoveLink + * + * + */ +void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, + HSZ hszItem, UINT uFmt) +{ + WDML_LINK* pPrev = NULL; + WDML_LINK* pCurrent = NULL; + + pCurrent = pInstance->links[side]; + + while (pCurrent != NULL) + { + if (pCurrent->hConv == hConv && + DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && + pCurrent->uFmt == uFmt) + { + if (pCurrent == pInstance->links[side]) + { + pInstance->links[side] = pCurrent->next; + } + else + { + pPrev->next = pCurrent->next; + } + + WDML_DecHSZ(pInstance, pCurrent->hszItem); + HeapFree(GetProcessHeap(), 0, pCurrent); + break; + } + + pPrev = pCurrent; + pCurrent = pCurrent->next; + } +} + +/* this function is called to remove all links related to the conv. + It should be called from both client and server when terminating + the conversation. +*/ +/****************************************************************** + * WDML_RemoveAllLinks + * + * + */ +void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side) +{ + WDML_LINK* pPrev = NULL; + WDML_LINK* pCurrent = NULL; + WDML_LINK* pNext = NULL; + + pCurrent = pInstance->links[side]; + + while (pCurrent != NULL) + { + if (pCurrent->hConv == (HCONV)pConv) + { + if (pCurrent == pInstance->links[side]) + { + pInstance->links[side] = pCurrent->next; + pNext = pCurrent->next; + } + else + { + pPrev->next = pCurrent->next; + pNext = pCurrent->next; + } + + WDML_DecHSZ(pInstance, pCurrent->hszItem); + + HeapFree(GetProcessHeap(), 0, pCurrent); + pCurrent = NULL; + } + + if (pCurrent) + { + pPrev = pCurrent; + pCurrent = pCurrent->next; + } + else + { + pCurrent = pNext; + } + } +} + +/****************************************************************** + * WDML_FindLink + * + * + */ +WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, + HSZ hszItem, BOOL use_fmt, UINT uFmt) +{ + WDML_LINK* pCurrent = NULL; + + for (pCurrent = pInstance->links[side]; pCurrent != NULL; pCurrent = pCurrent->next) + { + /* we don't need to check for transaction type as it can be altered */ + + if (pCurrent->hConv == hConv && + DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && + (!use_fmt || pCurrent->uFmt == uFmt)) + { + break; + } + + } + + return pCurrent; +} + +/* ================================================================ + * + * Transaction management + * + * ================================================================ */ + +/****************************************************************** + * WDML_AllocTransaction + * + * Alloc a transaction structure for handling the message ddeMsg + */ +WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, + UINT wFmt, HSZ hszItem) +{ + WDML_XACT* pXAct; + static WORD tid = 1; /* FIXME: wrap around */ + + pXAct = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_XACT)); + if (!pXAct) + { + pInstance->lastError = DMLERR_MEMORY_ERROR; + return NULL; + } + + pXAct->xActID = tid++; + pXAct->ddeMsg = ddeMsg; + pXAct->hDdeData = 0; + pXAct->hUser = 0; + pXAct->next = NULL; + pXAct->wType = 0; + pXAct->wFmt = wFmt; + if ((pXAct->hszItem = hszItem)) WDML_IncHSZ(pInstance, pXAct->hszItem); + pXAct->atom = 0; + pXAct->hMem = 0; + pXAct->lParam = 0; + + return pXAct; +} + +/****************************************************************** + * WDML_QueueTransaction + * + * Adds a transaction to the list of transaction + */ +void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) +{ + WDML_XACT** pt; + + /* advance to last in queue */ + for (pt = &pConv->transactions; *pt != NULL; pt = &(*pt)->next); + *pt = pXAct; +} + +/****************************************************************** + * WDML_UnQueueTransaction + * + * + */ +BOOL WDML_UnQueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) +{ + WDML_XACT** pt; + + for (pt = &pConv->transactions; *pt; pt = &(*pt)->next) + { + if (*pt == pXAct) + { + *pt = pXAct->next; + return TRUE; + } + } + return FALSE; +} + +/****************************************************************** + * WDML_FreeTransaction + * + * + */ +void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFreePmt) +{ + /* free pmt(s) in pXAct too. check against one for not deleting TRUE return values */ + if (doFreePmt && (ULONG_PTR)pXAct->hMem > 1) + { + GlobalFree(pXAct->hMem); + } + if (pXAct->hszItem) WDML_DecHSZ(pInstance, pXAct->hszItem); + + HeapFree(GetProcessHeap(), 0, pXAct); +} + +/****************************************************************** + * WDML_FindTransaction + * + * + */ +WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid) +{ + WDML_XACT* pXAct; + + tid = HIWORD(tid); + for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) + { + if (pXAct->xActID == tid) + break; + } + return pXAct; +} + /* ================================================================ * * Conversation management @@ -1876,7 +2143,7 @@ static BOOL WDML_EnableCallback(WDML_CONV *pConv, UINT wCmd) } if (wCmd == EC_QUERYWAITING) - return pConv->transactions ? TRUE : FALSE; + return pConv->transactions != NULL; if (wCmd != EC_ENABLEALL && wCmd != EC_ENABLEONE) { @@ -2201,259 +2468,6 @@ UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD id, PCONVINFO lpConvInfo) return ret; } -/* ================================================================ - * - * Link (hot & warm) management - * - * ================================================================ */ - -/****************************************************************** - * WDML_AddLink - * - * - */ -void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, - UINT wType, HSZ hszItem, UINT wFmt) -{ - WDML_LINK* pLink; - - pLink = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_LINK)); - if (pLink == NULL) - { - ERR("OOM\n"); - return; - } - - pLink->hConv = hConv; - pLink->transactionType = wType; - WDML_IncHSZ(pInstance, pLink->hszItem = hszItem); - pLink->uFmt = wFmt; - pLink->next = pInstance->links[side]; - pInstance->links[side] = pLink; -} - -/****************************************************************** - * WDML_RemoveLink - * - * - */ -void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, - HSZ hszItem, UINT uFmt) -{ - WDML_LINK* pPrev = NULL; - WDML_LINK* pCurrent = NULL; - - pCurrent = pInstance->links[side]; - - while (pCurrent != NULL) - { - if (pCurrent->hConv == hConv && - DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && - pCurrent->uFmt == uFmt) - { - if (pCurrent == pInstance->links[side]) - { - pInstance->links[side] = pCurrent->next; - } - else - { - pPrev->next = pCurrent->next; - } - - WDML_DecHSZ(pInstance, pCurrent->hszItem); - HeapFree(GetProcessHeap(), 0, pCurrent); - break; - } - - pPrev = pCurrent; - pCurrent = pCurrent->next; - } -} - -/* this function is called to remove all links related to the conv. - It should be called from both client and server when terminating - the conversation. -*/ -/****************************************************************** - * WDML_RemoveAllLinks - * - * - */ -void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side) -{ - WDML_LINK* pPrev = NULL; - WDML_LINK* pCurrent = NULL; - WDML_LINK* pNext = NULL; - - pCurrent = pInstance->links[side]; - - while (pCurrent != NULL) - { - if (pCurrent->hConv == (HCONV)pConv) - { - if (pCurrent == pInstance->links[side]) - { - pInstance->links[side] = pCurrent->next; - pNext = pCurrent->next; - } - else - { - pPrev->next = pCurrent->next; - pNext = pCurrent->next; - } - - WDML_DecHSZ(pInstance, pCurrent->hszItem); - - HeapFree(GetProcessHeap(), 0, pCurrent); - pCurrent = NULL; - } - - if (pCurrent) - { - pPrev = pCurrent; - pCurrent = pCurrent->next; - } - else - { - pCurrent = pNext; - } - } -} - -/****************************************************************** - * WDML_FindLink - * - * - */ -WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, - HSZ hszItem, BOOL use_fmt, UINT uFmt) -{ - WDML_LINK* pCurrent = NULL; - - for (pCurrent = pInstance->links[side]; pCurrent != NULL; pCurrent = pCurrent->next) - { - /* we don't need to check for transaction type as it can be altered */ - - if (pCurrent->hConv == hConv && - DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && - (!use_fmt || pCurrent->uFmt == uFmt)) - { - break; - } - - } - - return pCurrent; -} - -/* ================================================================ - * - * Transaction management - * - * ================================================================ */ - -/****************************************************************** - * WDML_AllocTransaction - * - * Alloc a transaction structure for handling the message ddeMsg - */ -WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, - UINT wFmt, HSZ hszItem) -{ - WDML_XACT* pXAct; - static WORD tid = 1; /* FIXME: wrap around */ - - pXAct = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_XACT)); - if (!pXAct) - { - pInstance->lastError = DMLERR_MEMORY_ERROR; - return NULL; - } - - pXAct->xActID = tid++; - pXAct->ddeMsg = ddeMsg; - pXAct->hDdeData = 0; - pXAct->hUser = 0; - pXAct->next = NULL; - pXAct->wType = 0; - pXAct->wFmt = wFmt; - if ((pXAct->hszItem = hszItem)) WDML_IncHSZ(pInstance, pXAct->hszItem); - pXAct->atom = 0; - pXAct->hMem = 0; - pXAct->lParam = 0; - - return pXAct; -} - -/****************************************************************** - * WDML_QueueTransaction - * - * Adds a transaction to the list of transaction - */ -void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) -{ - WDML_XACT** pt; - - /* advance to last in queue */ - for (pt = &pConv->transactions; *pt != NULL; pt = &(*pt)->next); - *pt = pXAct; -} - -/****************************************************************** - * WDML_UnQueueTransaction - * - * - */ -BOOL WDML_UnQueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) -{ - WDML_XACT** pt; - - for (pt = &pConv->transactions; *pt; pt = &(*pt)->next) - { - if (*pt == pXAct) - { - *pt = pXAct->next; - return TRUE; - } - } - return FALSE; -} - -/****************************************************************** - * WDML_FreeTransaction - * - * - */ -void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFreePmt) -{ - /* free pmt(s) in pXAct too. check against one for not deleting TRUE return values */ - if (doFreePmt && (ULONG_PTR)pXAct->hMem > 1) - { - GlobalFree(pXAct->hMem); - } - if (pXAct->hszItem) WDML_DecHSZ(pInstance, pXAct->hszItem); - - HeapFree(GetProcessHeap(), 0, pXAct); -} - -/****************************************************************** - * WDML_FindTransaction - * - * - */ -WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid) -{ - WDML_XACT* pXAct; - - tid = HIWORD(tid); - for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) - { - if (pXAct->xActID == tid) - break; - } - return pXAct; -} - /* ================================================================ * * Information broadcast across DDEML implementations diff --git a/reactos/win32ss/user/user32/misc/ddeclient.c b/reactos/win32ss/user/user32/misc/ddeclient.c index 723a1b1b9e4..1a7ca94a927 100644 --- a/reactos/win32ss/user/user32/misc/ddeclient.c +++ b/reactos/win32ss/user/user32/misc/ddeclient.c @@ -30,8 +30,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddeml); static LRESULT CALLBACK WDML_ClientProc(HWND, UINT, WPARAM, LPARAM); /* only for one client, not conv list */ -const char WDML_szClientConvClassA[] = "DdeClientAnsi"; -const WCHAR WDML_szClientConvClassW[] = {'D','d','e','C','l','i','e','n','t','U','n','i','c','o','d','e',0}; +const char WDML_szClientConvClassA[] = "DDEMLAnsiClient"; +const WCHAR WDML_szClientConvClassW[] = {'D','D','E','M','L','U','n','i','c','o','d','e','C','l','i','e','n','t',0}; /****************************************************************************** * DdeConnectList [USER32.@] Establishes conversation with DDE servers @@ -91,7 +91,7 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, WDML_CONV* pConv = NULL; ATOM aSrv = 0, aTpc = 0; - TRACE("(0x%x,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC); + ERR("(0x%x,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC); pInstance = WDML_GetInstance(idInst); if (!pInstance) @@ -166,7 +166,7 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, /* note: sent messages shall not use packing */ SendMessageTimeoutW( HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndClient, MAKELPARAM(aSrv, aTpc), - SMTO_ABORTIFHUNG, 2000, NULL ); + SMTO_ABORTIFHUNG, 0, NULL ); pInstance = WDML_GetInstance(idInst); if (!pInstance) @@ -180,12 +180,12 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, pConv = WDML_GetConvFromWnd(hwndClient); if (pConv == NULL || pConv->hwndServer == 0) { - WARN("Done with INITIATE, but no Server window available\n"); + ERR("Done with INITIATE, but no Server window available %p\n", (pConv ? pConv->hwndServer : NULL)); pConv = NULL; pInstance->lastError = DMLERR_NO_CONV_ESTABLISHED; goto theEnd; } - TRACE("Connected to Server window (%p)\n", pConv->hwndServer); + ERR("Connected to Server window (%p)\n", pConv->hwndServer); pConv->wConvst = XST_CONNECTED; /* finish init of pConv */ @@ -312,8 +312,8 @@ static WDML_XACT* WDML_ClientQueueAdvise(WDML_CONV* pConv, UINT wType, UINT wFmt /* pack DdeAdvise */ pDdeAdvise = GlobalLock(pXAct->hMem); - pDdeAdvise->fAckReq = (wType & XTYPF_ACKREQ) ? TRUE : FALSE; - pDdeAdvise->fDeferUpd = (wType & XTYPF_NODATA) ? TRUE : FALSE; + pDdeAdvise->fAckReq = (wType & XTYPF_ACKREQ) != 0; + pDdeAdvise->fDeferUpd = (wType & XTYPF_NODATA) != 0; pDdeAdvise->cfFormat = wFmt; GlobalUnlock(pXAct->hMem); @@ -848,7 +848,7 @@ static WDML_QUEUE_STATE WDML_HandleIncomingData(WDML_CONV* pConv, MSG* msg, HDDE * XTYP_ADVDATA and callback should return the proper status. */ pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, hsz, - uiLo ? TRUE : FALSE, wdh.cfFormat); + uiLo != 0, wdh.cfFormat); if (!pLink) { WDML_DecHSZ(pConv->instance, hsz); @@ -1008,22 +1008,20 @@ static WDML_QUEUE_STATE WDML_HandleReply(WDML_CONV* pConv, MSG* msg, HDDEDATA* h */ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, const WDML_XACT* pXAct, DWORD *ack) { - DWORD dwTime; + DWORD start, elapsed; DWORD err; WDML_CONV* pConv; - TRACE("Starting wait for a timeout of %d ms\n", dwTimeout); + ERR("Starting wait for a timeout of %d ms\n", dwTimeout); - /* FIXME: time 32 bit wrap around */ - dwTimeout += GetCurrentTime(); - - while ((dwTime = GetCurrentTime()) < dwTimeout) + start = GetTickCount(); + while ((elapsed = GetTickCount() - start) < dwTimeout) { /* we cannot be in the crit sect all the time because when client and server run in a * single process they need to share the access to the internal data */ if (MsgWaitForMultipleObjects(0, NULL, FALSE, - dwTimeout - dwTime, QS_POSTMESSAGE) == WAIT_OBJECT_0) + dwTimeout - elapsed, QS_POSTMESSAGE) == WAIT_OBJECT_0) { MSG msg; @@ -1034,16 +1032,18 @@ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, cons pConv = WDML_GetConv(hConv, FALSE); if (pConv == NULL) { + ERR("conversation no longer available\n"); /* conversation no longer available... return failure */ return 0; } + ERR("Msg hWnd %p & Client %p\n",msg.hwnd,pConv->hwndClient); if (msg.hwnd == pConv->hwndClient) { /* check that either pXAct has been processed or no more xActions are pending */ BOOL ret = (pConv->transactions == pXAct); if (WDML_HandleReply(pConv, &msg, &hdd, ack) == WDML_QS_HANDLED) { - TRACE("WDML_HandleReply returned WDML_QS_HANDLED\n"); + ERR("WDML_HandleReply returned WDML_QS_HANDLED\n"); ret = TRUE; } else @@ -1057,13 +1057,14 @@ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, cons } else { + ERR("Dispatching message\n"); DispatchMessageW(&msg); } } } } - TRACE("Timeout !!\n"); + ERR("Timeout !!\n"); pConv = WDML_GetConv(hConv, FALSE); if (pConv != NULL) @@ -1143,6 +1144,7 @@ HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HS if (pConv == NULL) { /* cannot set error... cannot get back to DDE instance */ + ERR("No Conv!\n"); return 0; } @@ -1237,14 +1239,18 @@ BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction { if ((pConv = WDML_GetConv(hConv, TRUE)) && pConv->instance == pInstance) { - for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) - { + + pXAct = pConv->transactions; + while (pXAct) { + WDML_XACT *nextXAct = pXAct->next; + if (pXAct->dwTimeout == TIMEOUT_ASYNC && (idTransaction == 0 || pXAct->xActID == idTransaction)) { WDML_UnQueueTransaction(pConv, pXAct); WDML_FreeTransaction(pInstance, pXAct, TRUE); } + pXAct = nextXAct; } } } @@ -1253,13 +1259,16 @@ BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv; pConv = pConv->next) { if (!(pConv->wStatus & ST_CONNECTED)) continue; - for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) - { + pXAct = pConv->transactions; + while (pXAct) { + WDML_XACT *nextXAct = pXAct->next; + if (pXAct->dwTimeout == TIMEOUT_ASYNC) { WDML_UnQueueTransaction(pConv, pXAct); WDML_FreeTransaction(pInstance, pXAct, TRUE); } + pXAct = nextXAct; } } } @@ -1278,16 +1287,18 @@ static LRESULT CALLBACK WDML_ClientProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPA UINT uiLo, uiHi; WDML_CONV* pConv = NULL; HSZ hszSrv, hszTpc; + char buf[256]; + WDML_INSTANCE* pInstance; - TRACE("%p %04x %08lx %08lx\n", hwnd, iMsg, wParam , lParam); + ERR("%p %04x %08lx %08lx\n", hwnd, iMsg, wParam , lParam); - if (iMsg == WM_DDE_ACK && /* in the initial WM_INITIATE sendmessage */ - ((pConv = WDML_GetConvFromWnd(hwnd)) == NULL || pConv->wStatus == XST_INIT1)) + if (iMsg == WM_DDE_ACK && + (!(pConv = WDML_GetConvFromWnd(hwnd)) || pConv->wStatus == XST_INIT1)) { + + ERR("WM_DDE_ACK\n"); /* In response to WM_DDE_INITIATE, save server window */ - char buf[256]; - WDML_INSTANCE* pInstance; /* note: sent messages do not need packing */ uiLo = LOWORD(lParam); diff --git a/reactos/win32ss/user/user32/misc/ddeserver.c b/reactos/win32ss/user/user32/misc/ddeserver.c index 087431a8931..711fbc24c4e 100644 --- a/reactos/win32ss/user/user32/misc/ddeserver.c +++ b/reactos/win32ss/user/user32/misc/ddeserver.c @@ -30,8 +30,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddeml); static const WCHAR szServerNameClass[] = {'D','d','e','S','e','r','v','e','r','N','a','m','e',0}; -const char WDML_szServerConvClassA[] = "DdeServerConvAnsi"; -const WCHAR WDML_szServerConvClassW[] = {'D','d','e','S','e','r','v','e','r','C','o','n','v','U','n','i','c','o','d','e',0}; +const char WDML_szServerConvClassA[] = "DdeServerConvA"; +const WCHAR WDML_szServerConvClassW[] = {'D','d','e','S','e','r','v','e','r','C','o','n','v','W',0}; static LRESULT CALLBACK WDML_ServerNameProc(HWND, UINT, WPARAM, LPARAM); static LRESULT CALLBACK WDML_ServerConvProc(HWND, UINT, WPARAM, LPARAM); @@ -62,7 +62,7 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) pInstance = WDML_GetInstance(idInst); - if (pInstance == NULL || pInstance->links == NULL) + if (pInstance == NULL) return FALSE; atom = WDML_MakeAtomFromHsz(hszItem); @@ -135,7 +135,7 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) return TRUE; theError: - if (atom) GlobalDeleteAtom(atom); + GlobalDeleteAtom(atom); return FALSE; } @@ -380,12 +380,12 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w LOWORD(lParam) -- application atom HIWORD(lParam) -- topic atom */ - TRACE("WM_DDE_INITIATE message received!\n"); + ERR("WM_DDE_INITIATE message received!\n"); hwndClient = (HWND)wParam; pInstance = WDML_GetInstanceFromWnd(hwndServer); - TRACE("idInst=%d, threadID=0x%x\n", pInstance->instanceID, GetCurrentThreadId()); if (!pInstance) return 0; + ERR("idInst=%d, threadID=0x%x\n", pInstance->instanceID, GetCurrentThreadId()); /* don't free DDEParams, since this is a broadcast */ UnpackDDElParam(WM_DDE_INITIATE, lParam, &uiLo, &uiHi); @@ -708,7 +708,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleUnadvise(WDML_CONV* pConv, WDML_XACT* p pXAct->hszItem, TRUE, pXAct->wFmt); if (pLink == NULL) { - ERR("Couln'd find link for %p, dropping request\n", pXAct->hszItem); + ERR("Couldn't find link for %p, dropping request\n", pXAct->hszItem); FreeDDElParam(WM_DDE_UNADVISE, pXAct->lParam); return WDML_QS_ERROR; } @@ -748,6 +748,54 @@ static WDML_XACT* WDML_ServerQueueExecute(WDML_CONV* pConv, LPARAM lParam) return pXAct; } +static BOOL data_looks_unicode( const WCHAR *data, DWORD size ) +{ + DWORD i; + + if (size % sizeof(WCHAR)) return FALSE; + for (i = 0; i < size / sizeof(WCHAR); i++) if (data[i] > 255) return FALSE; + return TRUE; +} + +/* convert data to Unicode, unless it looks like it's already Unicode */ +static HDDEDATA map_A_to_W( DWORD instance, void *ptr, DWORD size ) +{ + HDDEDATA ret; + DWORD len; + const char *end; + + if (!data_looks_unicode( ptr, size )) + { + if ((end = memchr( ptr, 0, size ))) size = end + 1 - (const char *)ptr; + len = MultiByteToWideChar( CP_ACP, 0, ptr, size, NULL, 0 ); + ret = DdeCreateDataHandle( instance, NULL, len * sizeof(WCHAR), 0, 0, CF_TEXT, 0); + MultiByteToWideChar( CP_ACP, 0, ptr, size, (WCHAR *)DdeAccessData(ret, NULL), len ); + } + else ret = DdeCreateDataHandle( instance, ptr, size, 0, 0, CF_TEXT, 0 ); + + return ret; +} + +/* convert data to ASCII, unless it looks like it's not in Unicode format */ +static HDDEDATA map_W_to_A( DWORD instance, void *ptr, DWORD size ) +{ + HDDEDATA ret; + DWORD len; + const WCHAR *end; + + if (data_looks_unicode( ptr, size )) + { + size /= sizeof(WCHAR); + if ((end = memchrW( ptr, 0, size ))) size = end + 1 - (const WCHAR *)ptr; + len = WideCharToMultiByte( CP_ACP, 0, ptr, size, NULL, 0, NULL, NULL ); + ret = DdeCreateDataHandle( instance, NULL, len, 0, 0, CF_TEXT, 0); + WideCharToMultiByte( CP_ACP, 0, ptr, size, (char *)DdeAccessData(ret, NULL), len, NULL, NULL ); + } + else ret = DdeCreateDataHandle( instance, ptr, size, 0, 0, CF_TEXT, 0 ); + + return ret; +} + /****************************************************************** * WDML_ServerHandleExecute * @@ -761,11 +809,16 @@ static WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pX if (!(pConv->instance->CBFflags & CBF_FAIL_EXECUTES)) { LPVOID ptr = GlobalLock(pXAct->hMem); + DWORD size = GlobalSize(pXAct->hMem); if (ptr) { - hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, ptr, GlobalSize(pXAct->hMem), - 0, 0, CF_TEXT, 0); + if (pConv->instance->unicode) /* Unicode server, try to map A->W */ + hDdeData = map_A_to_W( pConv->instance->instanceID, ptr, size ); + else if (!IsWindowUnicode( pConv->hwndClient )) /* ASCII server and client, try to map W->A */ + hDdeData = map_W_to_A( pConv->instance->instanceID, ptr, size ); + else + hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, ptr, size, 0, 0, CF_TEXT, 0); GlobalUnlock(pXAct->hMem); } hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_EXECUTE, 0, (HCONV)pConv, From 590447888e1b2d49a2c00344acff63fe3ca8153c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 20 May 2014 21:11:43 +0000 Subject: [PATCH 32/69] [NTOSKRNL] Fix ending address calculation for the commit path in NtAllocateVirtualMemory like done for the reserve path in r63356. Add a comment about a Windows kernel bug, which we will keep for now, until the implications are better determined. svn path=/trunk/; revision=63388 --- reactos/ntoskrnl/mm/ARM3/virtual.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index 935fc971dda..3eef793fcd9 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -4593,8 +4593,8 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // on the user input, and then compute the actual region size once all the // alignments have been done. // - StartingAddress = (ULONG_PTR)PAGE_ALIGN(PBaseAddress); EndingAddress = (((ULONG_PTR)PBaseAddress + PRegionSize - 1) | (PAGE_SIZE - 1)); + StartingAddress = (ULONG_PTR)PAGE_ALIGN(PBaseAddress); PRegionSize = EndingAddress - StartingAddress + 1; // @@ -4700,6 +4700,12 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, { // // Make sure it's okay to touch it + // Note: The Windows 2003 kernel has a bug here, passing the + // unaligned base address together with the aligned size, + // potentially covering a region larger than the actual allocation. + // Might be exposed through NtGdiCreateDIBSection w/ section handle + // For now we keep this behavior. + // TODO: analyze possible implications, create test case // Status = MiCheckSecuredVad(FoundVad, PBaseAddress, From aede864303310416cff8dd3db5fe9faad54185f6 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Tue, 20 May 2014 21:29:27 +0000 Subject: [PATCH 33/69] [urlmon_winetest] -Fixed some occasionally failing tests. Patch by Jacek Caban (sync to wine head) svn path=/trunk/; revision=63389 --- rostests/winetests/urlmon/url.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rostests/winetests/urlmon/url.c b/rostests/winetests/urlmon/url.c index 820c93fd56b..132d64f5a33 100644 --- a/rostests/winetests/urlmon/url.c +++ b/rostests/winetests/urlmon/url.c @@ -2818,6 +2818,7 @@ static BOOL test_RegisterBindStatusCallback(void) #define BINDTEST_ABORT_START 0x0400 #define BINDTEST_ABORT_PROGRESS 0x0800 #define BINDTEST_ASYNC_SWITCH 0x1000 +#define BINDTEST_ALLOW_FINDINGRESOURCE 0x2000 static void init_bind_test(int protocol, DWORD flags, DWORD t) { @@ -2893,9 +2894,11 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) MSG msg; IBindStatusCallback *previousclb; IUnknown *unk = (IUnknown*)0x00ff00ff; + BOOL allow_finding_resource; IBinding *bind; init_bind_test(protocol, flags, t); + allow_finding_resource = (flags & BINDTEST_ALLOW_FINDINGRESOURCE) != 0; if(no_callback) { hres = CreateBindCtx(0, &bctx); @@ -2975,7 +2978,7 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) SET_EXPECT(BeginningTransaction); SET_EXPECT(QueryInterface_IHttpNegotiate2); SET_EXPECT(GetRootSecurityId); - if(http_is_first) + if(http_is_first || allow_finding_resource) SET_EXPECT(OnProgress_FINDINGRESOURCE); SET_EXPECT(OnProgress_CONNECTING); } @@ -3133,6 +3136,8 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) CLEAR_CALLED(OnProgress_CONNECTING); } }else if(!abort_start) { + if(allow_finding_resource) + CLEAR_CALLED(OnProgress_FINDINGRESOURCE); /* IE7 does call this */ CLEAR_CALLED(OnProgress_CONNECTING); } @@ -3959,7 +3964,7 @@ START_TEST(url) test_BindToObject(HTTP_TEST, 0, S_OK); trace("http test (short response)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_HTTPRESPONSE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_HTTPRESPONSE|BINDTEST_ALLOW_FINDINGRESOURCE, TYMED_ISTREAM); trace("http test (short response, to object)...\n"); test_BindToObject(HTTP_TEST, 0, S_OK); @@ -3973,7 +3978,7 @@ START_TEST(url) test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE); trace("http test (abort progress)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_PROGRESS, TYMED_FILE); + test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_PROGRESS|BINDTEST_ALLOW_FINDINGRESOURCE, TYMED_FILE); trace("emulated http test...\n"); test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); @@ -4086,3 +4091,4 @@ START_TEST(url) CloseHandle(complete_event2); CoUninitialize(); } + From c71be46956b453e94109903e8589ecb0e70f35da Mon Sep 17 00:00:00 2001 From: David Quintana Date: Tue, 20 May 2014 22:33:26 +0000 Subject: [PATCH 34/69] Fix KeSaveFloatingPointState. It was working once upon a time, but the fix was lost on some refactoring. I was told to blame it on Arch. svn path=/trunk/; revision=63390 --- reactos/ntoskrnl/ke/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/i386/cpu.c b/reactos/ntoskrnl/ke/i386/cpu.c index 2d741ab6144..b56414ce0a7 100644 --- a/reactos/ntoskrnl/ke/i386/cpu.c +++ b/reactos/ntoskrnl/ke/i386/cpu.c @@ -1432,7 +1432,8 @@ KeSaveFloatingPointState(OUT PKFLOATING_SAVE Save) #else __asm { - fnsave [FpState] + mov eax, [FpState] + fnsave [eax] }; #endif From 6a96b1732b600c89669eae901cb684ba0eb9fb5d Mon Sep 17 00:00:00 2001 From: David Quintana Date: Tue, 20 May 2014 22:51:38 +0000 Subject: [PATCH 35/69] I was noted that I forgot to also apply the same fix to the KeRestoreFloatingPointState function. Also, for reference: r23894 contained working implemnentations in fpu.c. In r23895 ion "moved" it to cpu.c, killing the MSVC implementation in the process. In 23972, ion added new MSVC code for it, but this new version had the bug. It has remained undiscovered until very recently. svn path=/trunk/; revision=63391 --- reactos/ntoskrnl/ke/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/i386/cpu.c b/reactos/ntoskrnl/ke/i386/cpu.c index b56414ce0a7..09568113b65 100644 --- a/reactos/ntoskrnl/ke/i386/cpu.c +++ b/reactos/ntoskrnl/ke/i386/cpu.c @@ -1459,7 +1459,8 @@ KeRestoreFloatingPointState(IN PKFLOATING_SAVE Save) __asm { fnclex - frstor [FpState] + mov eax, [FpState] + frstor [eax] }; #endif From 8cbded8053d2519e53c88ff743ca618387d9b448 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 20 May 2014 23:48:36 +0000 Subject: [PATCH 36/69] [USETUP] - Implement creation of extended partitions. - Add creation checks for primary and extended partitions. svn path=/trunk/; revision=63392 --- reactos/base/setup/usetup/errorcode.h | 9 +- reactos/base/setup/usetup/interface/usetup.c | 207 ++++++++++++++-- reactos/base/setup/usetup/lang/bg-BG.h | 51 +++- reactos/base/setup/usetup/lang/cs-CZ.h | 51 +++- reactos/base/setup/usetup/lang/de-DE.h | 48 +++- reactos/base/setup/usetup/lang/el-GR.h | 51 +++- reactos/base/setup/usetup/lang/en-US.h | 48 +++- reactos/base/setup/usetup/lang/es-ES.h | 51 +++- reactos/base/setup/usetup/lang/et-EE.h | 51 +++- reactos/base/setup/usetup/lang/fr-FR.h | 51 +++- reactos/base/setup/usetup/lang/he-IL.h | 49 +++- reactos/base/setup/usetup/lang/it-IT.h | 49 +++- reactos/base/setup/usetup/lang/ja-JP.h | 51 +++- reactos/base/setup/usetup/lang/lt-LT.h | 48 +++- reactos/base/setup/usetup/lang/nl-NL.h | 51 +++- reactos/base/setup/usetup/lang/pl-PL.h | 49 +++- reactos/base/setup/usetup/lang/pt-BR.h | 51 +++- reactos/base/setup/usetup/lang/ro-RO.h | 51 +++- reactos/base/setup/usetup/lang/ru-RU.h | 51 +++- reactos/base/setup/usetup/lang/sk-SK.h | 51 +++- reactos/base/setup/usetup/lang/sq-AL.h | 49 +++- reactos/base/setup/usetup/lang/sv-SE.h | 51 +++- reactos/base/setup/usetup/lang/tr-TR.h | 51 +++- reactos/base/setup/usetup/lang/uk-UA.h | 51 +++- reactos/base/setup/usetup/mui.h | 3 + reactos/base/setup/usetup/partlist.c | 244 ++++++++++++++++++- reactos/base/setup/usetup/partlist.h | 15 +- reactos/base/setup/usetup/usetup.h | 3 +- 28 files changed, 1498 insertions(+), 88 deletions(-) diff --git a/reactos/base/setup/usetup/errorcode.h b/reactos/base/setup/usetup/errorcode.h index 8bb5a43d308..0acfbd67b1f 100644 --- a/reactos/base/setup/usetup/errorcode.h +++ b/reactos/base/setup/usetup/errorcode.h @@ -28,7 +28,8 @@ typedef enum { - ERROR_NOT_INSTALLED = 0, + NOT_AN_ERROR = 0, + ERROR_NOT_INSTALLED, ERROR_NO_HDD, ERROR_NO_SOURCE_DRIVE, ERROR_LOAD_TXTSETUPSIF, @@ -67,6 +68,12 @@ typedef enum ERROR_UPDATE_GEOID, ERROR_INSUFFICIENT_DISKSPACE, + ERROR_PARTITION_TABLE_FULL, + ERROR_ONLY_ONE_EXTENDED, + ERROR_NOT_BEHIND_EXTENDED, + ERROR_EXTENDED_NOT_LAST, + + ERROR_LAST_ERROR_CODE }ERROR_NUMBER; diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index c0c597e617c..af5e16fd99b 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -1463,12 +1463,14 @@ IsDiskSizeValid(PPARTENTRY PartEntry) static PAGE_NUMBER SelectPartitionPage(PINPUT_RECORD Ir) { + ULONG Error; + MUIDisplayPage(SELECT_PARTITION_PAGE); if (PartitionList == NULL) { PartitionList = CreatePartitionList(2, - 19, + 21, xScreen - 3, yScreen - 3); if (PartitionList == NULL) @@ -1521,9 +1523,9 @@ SelectPartitionPage(PINPUT_RECORD Ir) return SELECT_PARTITION_PAGE; /* let the user select another partition */ } #endif - CreateNewPartition(PartitionList, - PartitionList->CurrentPartition->SectorCount.QuadPart, - TRUE); + CreatePrimaryPartition(PartitionList, + PartitionList->CurrentPartition->SectorCount.QuadPart, + TRUE); DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; @@ -1553,6 +1555,10 @@ SelectPartitionPage(PINPUT_RECORD Ir) { CONSOLE_SetStatusText(MUIGetString(STRING_INSTALLCREATEPARTITION)); } + else if (IsContainerPartition(PartitionList->CurrentPartition->PartitionType)) + { + CONSOLE_SetStatusText(MUIGetString(STRING_DELETEPARTITION)); + } else { CONSOLE_SetStatusText(MUIGetString(STRING_INSTALLDELETEPARTITION)); @@ -1591,27 +1597,42 @@ SelectPartitionPage(PINPUT_RECORD Ir) return SELECT_PARTITION_PAGE; /* let the user select another partition */ } #endif + if (IsContainerPartition(PartitionList->CurrentPartition->PartitionType)) + continue; //return SELECT_PARTITION_PAGE; + if (PartitionList->CurrentPartition == NULL || PartitionList->CurrentPartition->IsPartitioned == FALSE) { - CreateNewPartition(PartitionList, - 0ULL, - TRUE); + CreatePrimaryPartition(PartitionList, + 0ULL, + TRUE); } DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; return SELECT_FILE_SYSTEM_PAGE; } - else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'C') /* C */ + else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'P') /* P */ { - if (PartitionList->CurrentPartition->IsPartitioned == TRUE) + Error = PrimaryPartitionCreationChecks(PartitionList); + if (Error != NOT_AN_ERROR) { - MUIDisplayError(ERROR_NEW_PARTITION, Ir, POPUP_WAIT_ANY_KEY); + MUIDisplayError(Error, Ir, POPUP_WAIT_ANY_KEY); return SELECT_PARTITION_PAGE; } - return CREATE_PARTITION_PAGE; + return CREATE_PRIMARY_PARTITION_PAGE; + } + else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'E') /* E */ + { + Error = ExtendedPartitionCreationChecks(PartitionList); + if (Error != NOT_AN_ERROR) + { + MUIDisplayError(Error, Ir, POPUP_WAIT_ANY_KEY); + return SELECT_PARTITION_PAGE; + } + + return CREATE_EXTENDED_PARTITION_PAGE; } else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'D') /* D */ { @@ -1773,7 +1794,7 @@ ShowPartitionSizeInputBox(SHORT Left, static PAGE_NUMBER -CreatePartitionPage(PINPUT_RECORD Ir) +CreatePrimaryPartitionPage(PINPUT_RECORD Ir) { PDISKENTRY DiskEntry; PPARTENTRY PartEntry; @@ -1907,15 +1928,161 @@ CreatePartitionPage(PINPUT_RECORD Ir) DPRINT ("Partition size: %I64u bytes\n", PartSize); - CreateNewPartition(PartitionList, - SectorCount, - FALSE); + CreatePrimaryPartition(PartitionList, + SectorCount, + FALSE); return SELECT_PARTITION_PAGE; } } - return CREATE_PARTITION_PAGE; + return CREATE_PRIMARY_PARTITION_PAGE; +} + + +static PAGE_NUMBER +CreateExtendedPartitionPage(PINPUT_RECORD Ir) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + BOOLEAN Quit; + BOOLEAN Cancel; + CHAR InputBuffer[50]; + ULONG MaxSize; + ULONGLONG PartSize; + ULONGLONG DiskSize; + ULONGLONG SectorCount; + PCHAR Unit; + + if (PartitionList == NULL || + PartitionList->CurrentDisk == NULL || + PartitionList->CurrentPartition == NULL) + { + /* FIXME: show an error dialog */ + return QUIT_PAGE; + } + + DiskEntry = PartitionList->CurrentDisk; + PartEntry = PartitionList->CurrentPartition; + + CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); + + CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHOOSE_NEW_EXTENDED_PARTITION)); + + DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; +#if 0 + if (DiskSize >= 10737418240) /* 10 GB */ + { + DiskSize = DiskSize / 1073741824; + Unit = MUIGetString(STRING_GB); + } + else +#endif + { + DiskSize = DiskSize / 1048576; + if (DiskSize == 0) + DiskSize = 1; + + Unit = MUIGetString(STRING_MB); + } + + if (DiskEntry->DriverName.Length > 0) + { + CONSOLE_PrintTextXY(6, 10, + MUIGetString(STRING_HDINFOPARTCREATE), + DiskSize, + Unit, + DiskEntry->DiskNumber, + DiskEntry->Port, + DiskEntry->Bus, + DiskEntry->Id, + &DiskEntry->DriverName); + } + else + { + CONSOLE_PrintTextXY(6, 10, + MUIGetString(STRING_HDDINFOUNK1), + DiskSize, + Unit, + DiskEntry->DiskNumber, + DiskEntry->Port, + DiskEntry->Bus, + DiskEntry->Id); + } + + CONSOLE_SetTextXY(6, 12, MUIGetString(STRING_HDDSIZE)); + +#if 0 + CONSOLE_PrintTextXY(8, 10, "Maximum size of the new partition is %I64u MB", + PartitionList->CurrentPartition->SectorCount * DiskEntry->BytesPerSector / 1048576); +#endif + + CONSOLE_SetStatusText(MUIGetString(STRING_CREATEPARTITION)); + + PartEntry = PartitionList->CurrentPartition; + while (TRUE) + { + MaxSize = (PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector) / 1048576; /* in MBytes (rounded) */ + + if (MaxSize > PARTITION_MAXSIZE) + MaxSize = PARTITION_MAXSIZE; + + ShowPartitionSizeInputBox(12, 14, xScreen - 12, 17, /* left, top, right, bottom */ + MaxSize, InputBuffer, &Quit, &Cancel); + + if (Quit == TRUE) + { + if (ConfirmQuit (Ir) == TRUE) + { + return QUIT_PAGE; + } + } + else if (Cancel == TRUE) + { + return SELECT_PARTITION_PAGE; + } + else + { + PartSize = atoi(InputBuffer); + + if (PartSize < 1) + { + /* Too small */ + continue; + } + + if (PartSize > MaxSize) + { + /* Too large */ + continue; + } + + /* Convert to bytes */ + if (PartSize == MaxSize) + { + /* Use all of the unpartitioned disk space */ + SectorCount = PartEntry->SectorCount.QuadPart; + } + else + { + /* Calculate the sector count from the size in MB */ + SectorCount = PartSize * 1048576 / DiskEntry->BytesPerSector; + + /* But never get larger than the unpartitioned disk space */ + if (SectorCount > PartEntry->SectorCount.QuadPart) + SectorCount = PartEntry->SectorCount.QuadPart; + } + + DPRINT ("Partition size: %I64u bytes\n", PartSize); + + CreateExtendedPartition(PartitionList, + SectorCount); + + return SELECT_PARTITION_PAGE; + } + } + + return CREATE_EXTENDED_PARTITION_PAGE; } @@ -3848,8 +4015,12 @@ RunUSetup(VOID) Page = SelectPartitionPage(&Ir); break; - case CREATE_PARTITION_PAGE: - Page = CreatePartitionPage(&Ir); + case CREATE_PRIMARY_PARTITION_PAGE: + Page = CreatePrimaryPartitionPage(&Ir); + break; + + case CREATE_EXTENDED_PARTITION_PAGE: + Page = CreateExtendedPartitionPage(&Ir); break; case DELETE_PARTITION_PAGE: diff --git a/reactos/base/setup/usetup/lang/bg-BG.h b/reactos/base/setup/usetup/lang/bg-BG.h index e4be51b6421..742c323ac08 100644 --- a/reactos/base/setup/usetup/lang/bg-BG.h +++ b/reactos/base/setup/usetup/lang/bg-BG.h @@ -828,12 +828,19 @@ static MUI_ENTRY bgBGSelectPartitionEntries[] = { 8, 15, - "\x07  â¨á­¥â¥ C §  áꧤ ¢ ­¥ ­  ­®¢ ¤ï«.", + "\x07 Press P to create a primary partition.", +// "\x07  â¨á­¥â¥ C §  áꧤ ¢ ­¥ ­  ­®¢ ¤ï«.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07  â¨á­¥â¥ D §  ¨§âਢ ­¥ ­  áêé¥áâ¢ã¢ é ¤ï«.", TEXT_STYLE_NORMAL }, @@ -1288,6 +1295,10 @@ static MUI_ENTRY bgBGRegistryEntries[] = MUI_ERROR bgBGErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "¥ ªâŽ‘ ­¥ ¥ ­ ¯ê«­® á«®¦¥­ ­  ª®¬¯îâêà \n" @@ -1500,6 +1511,32 @@ MUI_ERROR bgBGErrorEntries[] = " *  â¨á­¥â¥ ª« ¢¨è, §  ¤  ¯à®¤ê«¦¨â¥.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1612,13 +1649,19 @@ MUI_STRING bgBGStrings[] = {STRING_PLEASEWAIT, " ®ç ª ©â¥..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = ‘« £ ­¥ C = ‘ꧤ ¢ ­¥ ­  ¤ï« F3 = ˆ§å®¤"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = ‘« £ ­¥ C = ‘ꧤ ¢ ­¥ ­  ¤ï« F3 = ˆ§å®¤"}, {STRING_INSTALLDELETEPARTITION, " ENTER = ‘« £ ­¥ D = ˆ§âਢ ­¥ ­  ¤ï« F3 = ˆ§å®¤"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, " §¬¥à ­  ­®¢¨ï ¤ï«:"}, {STRING_CHOOSENEWPARTITION, - "ˆ§¡à «¨ á⥠¤  áꧤ ¤¥â¥ ­®¢ ¤ï« ­ "}, + "You have chosen to create a primary partition on"}, +// "ˆ§¡à «¨ á⥠¤  áꧤ ¤¥â¥ ­®¢ ¤ï« ­ "}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "‚ꢥ¤¥â¥ à §¬¥à  ­  ­®¢¨ï ¤ï« (¢ ¬¥£ ¡ ©â¨)."}, {STRING_CREATEPARTITION, @@ -1701,6 +1744,8 @@ MUI_STRING bgBGStrings[] = " ¥à §¯à¥¤¥«¥­® ¬ïáâ® %6lu %s"}, {STRING_MAXSIZE, "Œ (¤® %lu Œ)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "®¢ (¥ä®à¬ â¨à ­)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/cs-CZ.h b/reactos/base/setup/usetup/lang/cs-CZ.h index 1bb8dd6e600..79b4e78f7b8 100644 --- a/reactos/base/setup/usetup/lang/cs-CZ.h +++ b/reactos/base/setup/usetup/lang/cs-CZ.h @@ -827,12 +827,19 @@ static MUI_ENTRY csCZSelectPartitionEntries[] = { 8, 15, - "\x07 Stisknut¡m C umo§n¡te vytvoýen¡ nov‚ho odd¡lu.", + "\x07 Press P to create a primary partition.", +// "\x07 Stisknut¡m C umo§n¡te vytvoýen¡ nov‚ho odd¡lu.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Stisknut¡m D umo§n¡te smaz n¡ existuj¡c¡ho odd¡lu.", TEXT_STYLE_NORMAL }, @@ -1286,6 +1293,10 @@ static MUI_ENTRY csCZRegistryEntries[] = MUI_ERROR csCZErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS nen¡ ve vaçem poŸ¡taŸi kompletnØ nainstalov n.\n" @@ -1496,6 +1507,32 @@ MUI_ERROR csCZErrorEntries[] = " * PokraŸujte stisknut¡m libovoln‚ kl vesy.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1608,13 +1645,19 @@ MUI_STRING csCZStrings[] = {STRING_PLEASEWAIT, " ¬ekejte, pros¡m..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalovat C = Vytvoýit odd¡l F3 = UkonŸit"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalovat C = Vytvoýit odd¡l F3 = UkonŸit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalovat D = Odstranit odd¡l F3 = UkonŸit"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Velikost nov‚ho odd¡lu:"}, {STRING_CHOOSENEWPARTITION, - "Zvolili jste vytvoýen¡ nov‚ho odd¡lu na"}, + "You have chosen to create a primary partition on"}, +// "Zvolili jste vytvoýen¡ nov‚ho odd¡lu na"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Zadejte velikost nov‚ho odd¡lu v megabajtech."}, {STRING_CREATEPARTITION, @@ -1697,6 +1740,8 @@ MUI_STRING csCZStrings[] = " M¡sto bez odd¡l… %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Novì (Nenaform tovanì)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/de-DE.h b/reactos/base/setup/usetup/lang/de-DE.h index 731ff05b03f..3df2aa17968 100644 --- a/reactos/base/setup/usetup/lang/de-DE.h +++ b/reactos/base/setup/usetup/lang/de-DE.h @@ -814,12 +814,18 @@ static MUI_ENTRY deDESelectPartitionEntries[] = { 8, 15, - "\x07 C erstellt eine neue Partition.", + "\x07 P erstellt eine prim„re Partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 E erstellt eine erweiterte Partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 D l”scht eine vorhandene Partition.", TEXT_STYLE_NORMAL }, @@ -1279,6 +1285,10 @@ static MUI_ENTRY deDERegistryEntries[] = MUI_ERROR deDEErrorEntries[] = { + { + // NOT_AN_ERROR + "Erfolg\n" + }, { //ERROR_NOT_INSTALLED "ReactOS wurde nicht vollst„ndig auf Ihrem System installiert.\n" @@ -1493,6 +1503,32 @@ MUI_ERROR deDEErrorEntries[] = " * Eine beliebige Taste zum Fortsetzen drcken.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "Sie k”nnen keine weitere prim„re oder erweiterte Partition in\n" + "der Partitionstabelle erstellen, weil die Tabelle voll ist.\n" + "\n" + " * Eine beliebige Taste zum Fortsetzen drcken." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "Sie k”nnen nur eine erweiterte Partition auf jeder Festplatte anlegen.\n" + "\n" + " * Eine beliebige Taste zum Fortsetzen drcken." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "Sie k”nnen hinter einer erweiterten Partition keine weitere Partition anlegen.\n" + "\n" + " * Eine beliebige Taste zum Fortsetzen drcken." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "Eine erweiterte Partition muss immer die letzte Partition in \n" + "einer Partitionstabelle sein.\n" + "\n" + " * Eine beliebige Taste zum Fortsetzen drcken." + }, { NULL, NULL @@ -1605,13 +1641,17 @@ MUI_STRING deDEStrings[] = {STRING_PLEASEWAIT, " Bitte warten..."}, {STRING_INSTALLCREATEPARTITION, - " EINGABETASTE = Installieren C = Partition erstellen F3 = Installation abbr."}, + " EINGABETASTE = Installieren P = Prim„re E = Erweiterte F3 = Installation abbr."}, {STRING_INSTALLDELETEPARTITION, " EINGABETASTE = Installieren D = Partition l”schen F3 = Installation abbr."}, + {STRING_DELETEPARTITION, + " D = Partition l”schen F3 = Installation abbrechen"}, {STRING_PARTITIONSIZE, "Gr”áe der neuen Partition:"}, {STRING_CHOOSENEWPARTITION, - "Eine neue Partition soll hier erstellt werden:"}, + "Eine prim„re Partition soll hier erstellt werden:"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "Eine erweiterte Partition soll hier erstellt werden:"}, {STRING_HDDSIZE, "Bitte geben Sie die Gr”áe der neuen Partition in Megabyte ein."}, {STRING_CREATEPARTITION, @@ -1694,6 +1734,8 @@ MUI_STRING deDEStrings[] = " Unpartitionierter Speicher %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Erweiterte Partition"}, {STRING_UNFORMATTED, "Neu (Unformatiert)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/el-GR.h b/reactos/base/setup/usetup/lang/el-GR.h index 91b88d6410c..15c5dcbde38 100644 --- a/reactos/base/setup/usetup/lang/el-GR.h +++ b/reactos/base/setup/usetup/lang/el-GR.h @@ -837,12 +837,19 @@ static MUI_ENTRY elGRSelectPartitionEntries[] = { 8, 15, - "\x07 ˜«ã©«œ C š ˜ ¤˜ ›ž£ ¦¬¨šã©œ«œ ⤘ ¤â¦ › ˜£â¨ ©£˜.", + "\x07 Press P to create a primary partition.", +// "\x07 ˜«ã©«œ C š ˜ ¤˜ ›ž£ ¦¬¨šã©œ«œ ⤘ ¤â¦ › ˜£â¨ ©£˜.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 ˜«ã©«œ D š ˜ ¤˜ › ˜š¨á¯œ«œ ⤘ ¬§á¨®¦¤ › ˜£â¨ ©£˜.", TEXT_STYLE_NORMAL }, @@ -1308,6 +1315,10 @@ static MUI_ENTRY elGRRegistryEntries[] = MUI_ERROR elGRErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "’¦ ReactOS ›œ¤ œš¡˜«˜©«áŸž¡œ §¢ã¨àª ©«¦¤\n" @@ -1512,6 +1523,32 @@ MUI_ERROR elGRErrorEntries[] = "Setup could not set the geo id.\n" "ENTER = Reboot computer" }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1624,13 +1661,19 @@ MUI_STRING elGRStrings[] = {STRING_PLEASEWAIT, " ˜¨˜¡˜¢é §œ¨ £â¤œ«œ..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = „š¡˜«á©«˜©ž C = ƒž£ ¦¬¨šå˜ Partition F3 = €§¦®é¨ž©ž"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = „š¡˜«á©«˜©ž C = ƒž£ ¦¬¨šå˜ Partition F3 = €§¦®é¨ž©ž"}, {STRING_INSTALLDELETEPARTITION, " ENTER = „š¡˜«á©«˜©ž D = ƒ ˜š¨˜­ã Partition F3 = €§¦®é¨ž©ž"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "‹âšœŸ¦ª «¦¬ ¤â¦¬ partition:"}, {STRING_CHOOSENEWPARTITION, - "„§ ¢â¥˜«œ ¤˜ ›ž£ ¦¬¨šã©œ«œ ⤘ ¤â¦ partition on"}, + "You have chosen to create a primary partition on"}, +// "„§ ¢â¥˜«œ ¤˜ ›ž£ ¦¬¨šã©œ«œ ⤘ ¤â¦ partition on"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "˜¨˜¡˜¢é ›é©«œ «¦ £âšœŸ¦ª «¦¬ partition ©œ megabytes."}, {STRING_CREATEPARTITION, @@ -1713,6 +1756,8 @@ MUI_STRING elGRStrings[] = " Unpartitioned space %6lu %s"}, {STRING_MAXSIZE, "MB (£œš. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Œâ¦ (‹ž › ˜£¦¨­à£â¤¦)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/en-US.h b/reactos/base/setup/usetup/lang/en-US.h index b89e0e4b93e..10374175549 100644 --- a/reactos/base/setup/usetup/lang/en-US.h +++ b/reactos/base/setup/usetup/lang/en-US.h @@ -819,12 +819,18 @@ static MUI_ENTRY enUSSelectPartitionEntries[] = { 8, 15, - "\x07 Press C to create a new partition.", + "\x07 Press P to create a primary partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Press D to delete an existing partition.", TEXT_STYLE_NORMAL }, @@ -1278,6 +1284,10 @@ static MUI_ENTRY enUSRegistryEntries[] = MUI_ERROR enUSErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS is not completely installed on your\n" @@ -1488,6 +1498,32 @@ MUI_ERROR enUSErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1599,13 +1635,17 @@ MUI_STRING enUSStrings[] = {STRING_PLEASEWAIT, " Please wait..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Install C = Create Partition F3 = Quit"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Install D = Delete Partition F3 = Quit"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Size of new partition:"}, {STRING_CHOOSENEWPARTITION, - "You have chosen to create a new partition on"}, + "You have chosen to create a primary partition on"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Please enter the size of the new partition in megabytes."}, {STRING_CREATEPARTITION, @@ -1688,6 +1728,8 @@ MUI_STRING enUSStrings[] = " Unpartitioned space %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "New (Unformatted)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/es-ES.h b/reactos/base/setup/usetup/lang/es-ES.h index 2089e1e313e..277304abee7 100644 --- a/reactos/base/setup/usetup/lang/es-ES.h +++ b/reactos/base/setup/usetup/lang/es-ES.h @@ -826,12 +826,19 @@ static MUI_ENTRY esESSelectPartitionEntries[] = { 8, 15, - "\x07 Presione C para crear una nueva partici¢n.", + "\x07 Press P to create a primary partition.", +// "\x07 Presione C para crear una nueva partici¢n.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Presione D para borrar una partici¢n existente.", TEXT_STYLE_NORMAL }, @@ -1285,6 +1292,10 @@ static MUI_ENTRY esESRegistryEntries[] = MUI_ERROR esESErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS no est  completamente instalado en su\n" @@ -1495,6 +1506,32 @@ MUI_ERROR esESErrorEntries[] = " * Presione una tecla para continuar.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1606,13 +1643,19 @@ MUI_STRING esESStrings[] = {STRING_PLEASEWAIT, " Por favor, espere..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalar C = Crear Partici¢n F3 = Salir"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalar C = Crear Partici¢n F3 = Salir"}, + {STRING_DELETEPARTITION, + " D = Borrar Partici¢n F3 = Salir"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalar D = Borrar Partici¢n F3 = Salir"}, {STRING_PARTITIONSIZE, "Tama¤o de la nueva partici¢n:"}, {STRING_CHOOSENEWPARTITION, - "Ha elegido crear una nueva partici¢n en"}, + "You have chosen to create a primary partition on"}, +// "Ha elegido crear una nueva partici¢n en"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Por favor, introduzca el tama¤o de la nueva partici¢n en megabytes."}, {STRING_CREATEPARTITION, @@ -1695,6 +1738,8 @@ MUI_STRING esESStrings[] = " Espacio sin particionar %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Nuevo (sin formato)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/et-EE.h b/reactos/base/setup/usetup/lang/et-EE.h index 90dce3ffbd6..f07a67cf78f 100644 --- a/reactos/base/setup/usetup/lang/et-EE.h +++ b/reactos/base/setup/usetup/lang/et-EE.h @@ -819,12 +819,19 @@ static MUI_ENTRY etEESelectPartitionEntries[] = { 8, 15, - "\x07 Vajuta C, et teha uus partitsioon.", + "\x07 Press P to create a primary partition.", +// "\x07 Vajuta C, et teha uus partitsioon.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Vajuta D, et kustutada olemasolev partitsioon.", TEXT_STYLE_NORMAL }, @@ -1278,6 +1285,10 @@ static MUI_ENTRY etEERegistryEntries[] = MUI_ERROR etEEErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS ei ole t„ielikult paigaldatud.\n" @@ -1485,6 +1496,32 @@ MUI_ERROR etEEErrorEntries[] = " * Vajuta suvalist klahvi, et j„tkata.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1597,13 +1634,19 @@ MUI_STRING etEEStrings[] = {STRING_PLEASEWAIT, " Palun oota..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Paigalda C = Loo partitsioon F3 = V„lju"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Paigalda C = Loo partitsioon F3 = V„lju"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Paigalda D = Kustuta partitsioon F3 = V„lju"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Uue partitsiooni suurus:"}, {STRING_CHOOSENEWPARTITION, - "Oled valinud kettale uue partitsiooni loomise"}, + "You have chosen to create a primary partition on"}, +// "Oled valinud kettale uue partitsiooni loomise"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Sisesta uue partitsiooni suurus megabaitides."}, {STRING_CREATEPARTITION, @@ -1686,6 +1729,8 @@ MUI_STRING etEEStrings[] = " Kasutamata kettaruum %6lu %s"}, {STRING_MAXSIZE, "MB (maks. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Uus (Vormindamata)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/fr-FR.h b/reactos/base/setup/usetup/lang/fr-FR.h index 258afe6b439..853bcf72acb 100644 --- a/reactos/base/setup/usetup/lang/fr-FR.h +++ b/reactos/base/setup/usetup/lang/fr-FR.h @@ -832,12 +832,19 @@ static MUI_ENTRY frFRSelectPartitionEntries[] = { 8, 15, - "\x07 Appuyer sur C pour creer une nouvelle partition.", + "\x07 Press P to create a primary partition.", +// "\x07 Appuyer sur C pour creer une nouvelle partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Appuyer sur D pour effacer une partition.", TEXT_STYLE_NORMAL }, @@ -1291,6 +1298,10 @@ static MUI_ENTRY frFRRegistryEntries[] = MUI_ERROR frFRErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS n'est pas complŠtement install‚ sur votre\n" @@ -1501,6 +1512,32 @@ MUI_ERROR frFRErrorEntries[] = " * Appuyez sur n'importe quelle touche pour continuer.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1613,13 +1650,19 @@ MUI_STRING frFRStrings[] = {STRING_PLEASEWAIT, " Veuillez patienter..."}, {STRING_INSTALLCREATEPARTITION, - " ENTRE = Installer C = Cr‚er Partition F3 = Quitter"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTRE = Installer C = Cr‚er Partition F3 = Quitter"}, {STRING_INSTALLDELETEPARTITION, " ENTRE = Installer D = Supprimer Partition F3 = Quitter"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Taille de la nouvelle partition :"}, {STRING_CHOOSENEWPARTITION, - "Vous avez choisi de cr‚er une nouvelle partition sur"}, + "You have chosen to create a primary partition on"}, +// "Vous avez choisi de cr‚er une nouvelle partition sur"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Veuillez entrer la taille de la nouvelle partition en m‚gaoctets."}, {STRING_CREATEPARTITION, @@ -1702,6 +1745,8 @@ MUI_STRING frFRStrings[] = " Espace non partitionn‚ %6lu %s"}, {STRING_MAXSIZE, "Mo (max. %lu Mo)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Nouveau (non format‚)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/he-IL.h b/reactos/base/setup/usetup/lang/he-IL.h index 9bdc3a8d2b3..d3734c0a235 100644 --- a/reactos/base/setup/usetup/lang/he-IL.h +++ b/reactos/base/setup/usetup/lang/he-IL.h @@ -820,12 +820,18 @@ static MUI_ENTRY heILSelectPartitionEntries[] = { 8, 15, - "\x07 Press C to create a new partition.", + "\x07 Press P to create a primary partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Press D to delete an existing partition.", TEXT_STYLE_NORMAL }, @@ -1279,6 +1285,10 @@ static MUI_ENTRY heILRegistryEntries[] = MUI_ERROR heILErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS is not completely installed on your\n" @@ -1489,6 +1499,32 @@ MUI_ERROR heILErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1600,13 +1636,18 @@ MUI_STRING heILStrings[] = {STRING_PLEASEWAIT, " € Œ‡‹…š..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = „š— C = –…˜ އ‰–„ F3 = ˆŒ „š—„"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = „š— C = –…˜ އ‰–„ F3 = ˆŒ „š—„"}, {STRING_INSTALLDELETEPARTITION, " ENTER = „š— D = އ— އ‰–„ F3 = ˆŒ „š—„"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "‚…ƒŒ „އ‰–„ „‡ƒ™„:"}, {STRING_CHOOSENEWPARTITION, - "You have chosen to create a new partition on"}, + "You have chosen to create a primary partition on"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Please enter the size of the new partition in megabytes."}, {STRING_CREATEPARTITION, @@ -1689,6 +1730,8 @@ MUI_STRING heILStrings[] = " Unpartitioned space %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "New (Unformatted)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/it-IT.h b/reactos/base/setup/usetup/lang/it-IT.h index 0e4035713c5..1561841e9a6 100644 --- a/reactos/base/setup/usetup/lang/it-IT.h +++ b/reactos/base/setup/usetup/lang/it-IT.h @@ -820,12 +820,19 @@ static MUI_ENTRY itITSelectPartitionEntries[] = { 8, 15, - "\x07 Premere C per creare una nuova partizione.", + "\x07 Press P to create a primary partition.", +// "\x07 Premere C per creare una nuova partizione.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Premere D per cancellare una partizione esistente.", TEXT_STYLE_NORMAL }, @@ -1279,6 +1286,10 @@ static MUI_ENTRY itITRegistryEntries[] = MUI_ERROR itITErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS non Š installato completamente nel vostro\n" @@ -1489,6 +1500,32 @@ MUI_ERROR itITErrorEntries[] = " * Premere un tasto qualsiasi per continuare.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1601,13 +1638,19 @@ MUI_STRING itITStrings[] = {STRING_PLEASEWAIT, " Attendere..."}, {STRING_INSTALLCREATEPARTITION, - " INVIO = Installa C = Crea Partizione F3 = Esci"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " INVIO = Installa C = Crea Partizione F3 = Esci"}, {STRING_INSTALLDELETEPARTITION, " INVIO = Installa D = Rimuovi Partizione F3 = Esci"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Dimensione della nuova partizione:"}, {STRING_CHOOSENEWPARTITION, - "Avete scelto di creare una nuova partizione su"}, + "You have chosen to create a primary partition on"}, +// "Avete scelto di creare una nuova partizione su"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Indicare la dimensione della nuova partizione in megabyte."}, {STRING_CREATEPARTITION, diff --git a/reactos/base/setup/usetup/lang/ja-JP.h b/reactos/base/setup/usetup/lang/ja-JP.h index be3834f7125..83685cdc1ee 100644 --- a/reactos/base/setup/usetup/lang/ja-JP.h +++ b/reactos/base/setup/usetup/lang/ja-JP.h @@ -820,12 +820,19 @@ static MUI_ENTRY jaJPSelectPartitionEntries[] = { 8, 15, - "\x07 ±À×¼² Ê߰è¼®Ý ¦ »¸¾² ½ÙÆÊ C ·°¦ µ¼Ã ¸ÀÞ»²¡", + "\x07 Press P to create a primary partition.", +// "\x07 ±À×¼² Ê߰è¼®Ý ¦ »¸¾² ½ÙÆÊ C ·°¦ µ¼Ã ¸ÀÞ»²¡", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 ·¿ÝÉ Ê߰輮ݦ »¸¼Þ® ½ÙÆÊ D ·°¦ µ¼Ã ¸ÀÞ»²¡", TEXT_STYLE_NORMAL }, @@ -1279,6 +1286,10 @@ static MUI_ENTRY jaJPRegistryEntries[] = MUI_ERROR jaJPErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS Ê ºÝËß­°ÀÆ ¶Ý¾ÞÝÆ ²Ý½Ä°Ù\n" @@ -1489,6 +1500,32 @@ MUI_ERROR jaJPErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1600,13 +1637,19 @@ MUI_STRING jaJPStrings[] = {STRING_PLEASEWAIT, " µÏÁ ¸ÀÞ»²..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = ²Ý½Ä°Ù C = Ê߰è¼®Ý »¸¾² F3 = Á­³¼"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = ²Ý½Ä°Ù C = Ê߰è¼®Ý »¸¾² F3 = Á­³¼"}, {STRING_INSTALLDELETEPARTITION, " ENTER = ²Ý½Ä°Ù D = Ê߰è¼®Ý »¸¼Þ® F3 = Á­³¼"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "±À×¼² Ê߰è¼®ÝÉ »²½Þ:"}, {STRING_CHOOSENEWPARTITION, - "±À×¼² Ê߰輮ݦ Â·ÞÆ »¸¾²½Ù ºÄ¶Þ ¾ÝÀ¸ »ÚϼÀ:"}, + "You have chosen to create a primary partition on"}, +// "±À×¼² Ê߰輮ݦ Â·ÞÆ »¸¾²½Ù ºÄ¶Þ ¾ÝÀ¸ »ÚϼÀ:"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "±À×¼² Ê߰è¼®ÝÉ »²½Þ¦ Ò¶ÞÊÞ²Ä ÀݲÃÞ Æ­³Ø®¸ ¼Ã¸ÀÞ»²¡"}, {STRING_CREATEPARTITION, @@ -1689,6 +1732,8 @@ MUI_STRING jaJPStrings[] = " ÐÌÞݶÂÉ ½Íß°½ %6lu %s"}, {STRING_MAXSIZE, "MB (»²ÀÞ². %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "¼Ý· (ÐÌ«°Ï¯Ä)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/lt-LT.h b/reactos/base/setup/usetup/lang/lt-LT.h index d6f0c71c18a..a02554a5186 100644 --- a/reactos/base/setup/usetup/lang/lt-LT.h +++ b/reactos/base/setup/usetup/lang/lt-LT.h @@ -829,12 +829,18 @@ static MUI_ENTRY ltLTSelectPartitionEntries[] = { 8, 15, - "\x07 Press C to create a new partition.", + "\x07 Press P to create a primary partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Press D to delete an existing partition.", TEXT_STYLE_NORMAL }, @@ -1288,6 +1294,10 @@ static MUI_ENTRY ltLTRegistryEntries[] = MUI_ERROR ltLTErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS is not completely installed on your\n" @@ -1498,6 +1508,32 @@ MUI_ERROR ltLTErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1610,13 +1646,17 @@ MUI_STRING ltLTStrings[] = {STRING_PLEASEWAIT, " Please wait..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Install C = Create Partition F3 = Quit"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Install D = Delete Partition F3 = Quit"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Size of new partition:"}, {STRING_CHOOSENEWPARTITION, - "You have chosen to create a new partition on"}, + "You have chosen to create a primary partition on"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Please enter the size of the new partition in megabytes."}, {STRING_CREATEPARTITION, @@ -1699,6 +1739,8 @@ MUI_STRING ltLTStrings[] = " Unpartitioned space %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "New (Unformatted)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/nl-NL.h b/reactos/base/setup/usetup/lang/nl-NL.h index f1814a11e58..011111d13d0 100644 --- a/reactos/base/setup/usetup/lang/nl-NL.h +++ b/reactos/base/setup/usetup/lang/nl-NL.h @@ -854,12 +854,19 @@ static MUI_ENTRY nlNLSelectPartitionEntries[] = { 8, 15, - "\x07 Druk op C om een nieuwe partitie aan te maken.", + "\x07 Press P to create a primary partition.", +// "\x07 Druk op C om een nieuwe partitie aan te maken.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Druk op D om een bestaande partitie te verwijderen.", TEXT_STYLE_NORMAL }, @@ -1319,6 +1326,10 @@ static MUI_ENTRY nlNLRegistryEntries[] = MUI_ERROR nlNLErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS is niet geheel ge\x8Bnstalleerd op uw\n" @@ -1533,6 +1544,32 @@ MUI_ERROR nlNLErrorEntries[] = " * Druk op een toets om door te gaan.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1645,13 +1682,19 @@ MUI_STRING nlNLStrings[] = {STRING_PLEASEWAIT, " Een ogenblik geduld..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Installeren C = Partitie aanmaken F3 = Afsluiten"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Installeren C = Partitie aanmaken F3 = Afsluiten"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Installeren D = Partitie verwijderen F3 = Afsluiten"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Grootte nieuwe partitie:"}, {STRING_CHOOSENEWPARTITION, - "U wilt een nieuwe partitie aanmaken op"}, + "You have chosen to create a primary partition on"}, +// "U wilt een nieuwe partitie aanmaken op"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Voert u de grootte van de nieuwe partitie in in megabytes."}, {STRING_CREATEPARTITION, @@ -1734,6 +1777,8 @@ MUI_STRING nlNLStrings[] = " Niet gepartitioneerde ruimte %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Nieuw (Ongeformatteerd)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/pl-PL.h b/reactos/base/setup/usetup/lang/pl-PL.h index 2cf3e6f8bfa..6ab8e361e8e 100644 --- a/reactos/base/setup/usetup/lang/pl-PL.h +++ b/reactos/base/setup/usetup/lang/pl-PL.h @@ -828,12 +828,19 @@ static MUI_ENTRY plPLSelectPartitionEntries[] = { 8, 15, - "\x07 Naci˜nij C, by stworzy† now¥ partycj©.", + "\x07 Press P to create a primary partition.", +// "\x07 Naci˜nij C, by stworzy† now¥ partycj©.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Naci˜nij D, by skasowa† istniej¥c¥ partycj©.", TEXT_STYLE_NORMAL }, @@ -1287,6 +1294,10 @@ static MUI_ENTRY plPLRegistryEntries[] = MUI_ERROR plPLErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS nie zostaˆ w peˆni zainstalowany na twoim\n" @@ -1497,6 +1508,32 @@ MUI_ERROR plPLErrorEntries[] = " * Naci˜nij dowolny klawisz, aby kontynuowa†.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1609,13 +1646,19 @@ MUI_STRING plPLStrings[] = {STRING_PLEASEWAIT, " Prosz© czeka†..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalacja C = Utworzenie Partycji F3 = Wyj˜cie"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalacja C = Utworzenie Partycji F3 = Wyj˜cie"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalacja D = Skasowanie Partycji F3 = Wyj˜cie"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Rozmiar nowej partycji:"}, {STRING_CHOOSENEWPARTITION, - "Wybrane: utworzenie nowej partycji na"}, + "You have chosen to create a primary partition on"}, +// "Wybrane: utworzenie nowej partycji na"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Prosz© wprowadzi† rozmiar nowej partycji w megabajtach."}, {STRING_CREATEPARTITION, diff --git a/reactos/base/setup/usetup/lang/pt-BR.h b/reactos/base/setup/usetup/lang/pt-BR.h index 1ee9c7f12f9..2837b8526f2 100644 --- a/reactos/base/setup/usetup/lang/pt-BR.h +++ b/reactos/base/setup/usetup/lang/pt-BR.h @@ -838,12 +838,19 @@ static MUI_ENTRY ptBRSelectPartitionEntries[] = { 8, 15, - "\x07 Para criar uma parti‡Æo no espa‡o nÆo particionado, pressione C.", + "\x07 Press P to create a primary partition.", +// "\x07 Para criar uma parti‡Æo no espa‡o nÆo particionado, pressione C.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Para excluir a parti‡Æo selecionada, pressione D.", TEXT_STYLE_NORMAL }, @@ -1315,6 +1322,10 @@ static MUI_ENTRY ptBRRegistryEntries[] = MUI_ERROR ptBRErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "O ReactOS nÆo est  completamente instalado no computador.\n" @@ -1525,6 +1536,32 @@ MUI_ERROR ptBRErrorEntries[] = " * Pressione qualquer tecla para continuar.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1636,13 +1673,19 @@ MUI_STRING ptBRStrings[] = {STRING_PLEASEWAIT, " Por favor, aguarde..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER=Instalar C=Criar parti‡Æo F3=Sair"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER=Instalar C=Criar parti‡Æo F3=Sair"}, {STRING_INSTALLDELETEPARTITION, " ENTER=Instalar D=Apagar parti‡Æo F3=Sair"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Tamanho da nova parti‡Æo:"}, {STRING_CHOOSENEWPARTITION, - "Vocˆ solicitou a cria‡Æo de uma nova parti‡Æo em"}, + "You have chosen to create a primary partition on"}, +// "Vocˆ solicitou a cria‡Æo de uma nova parti‡Æo em"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Por favor, insira o tamanho da nova parti‡Æo em megabytes (MB)."}, {STRING_CREATEPARTITION, @@ -1725,6 +1768,8 @@ MUI_STRING ptBRStrings[] = " Espa‡o nÆo particionado %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Novo (sem formato)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/ro-RO.h b/reactos/base/setup/usetup/lang/ro-RO.h index 38dee78cff5..b4973c86532 100644 --- a/reactos/base/setup/usetup/lang/ro-RO.h +++ b/reactos/base/setup/usetup/lang/ro-RO.h @@ -881,12 +881,19 @@ static MUI_ENTRY roROSelectPartitionEntries[] = { 8, 15, - "\x07 Tastaîi C pentru a crea o nouÇ partiîie.", + "\x07 Press P to create a primary partition.", +// "\x07 Tastaîi C pentru a crea o nouÇ partiîie.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Tastaîi D pentru a ­terge o partiîie existentÇ.", TEXT_STYLE_NORMAL }, @@ -1340,6 +1347,10 @@ static MUI_ENTRY roRORegistryEntries[] = MUI_ERROR roROErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS nu a fost instalat complet Œn calculatorul\n" @@ -1566,6 +1577,32 @@ MUI_ERROR roROErrorEntries[] = " * Tastaîi pentru a continua.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1677,13 +1714,19 @@ MUI_STRING roROStrings[] = {STRING_PLEASEWAIT, " A­teptaîi..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalare C = Creare partiîie F3 = Ie­ire"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalare C = Creare partiîie F3 = Ie­ire"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalare D = ¸tergere partiîie F3 = Ie­ire"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "MÇrimea noii partiîii:"}, {STRING_CHOOSENEWPARTITION, - "Aîi ales crearea unei noi partiîii pe"}, + "You have chosen to create a primary partition on"}, +// "Aîi ales crearea unei noi partiîii pe"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Introduceîi mÇrimea noii partiîii Œn megaocteîi."}, {STRING_CREATEPARTITION, @@ -1766,6 +1809,8 @@ MUI_STRING roROStrings[] = " Spaîiu nepartiîionat %6lu %s"}, {STRING_MAXSIZE, "Mo (max. %lu Mo)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Part. nouÇ (neformatatÇ)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/ru-RU.h b/reactos/base/setup/usetup/lang/ru-RU.h index bbfd631b414..c5376f6f8aa 100644 --- a/reactos/base/setup/usetup/lang/ru-RU.h +++ b/reactos/base/setup/usetup/lang/ru-RU.h @@ -820,12 +820,19 @@ static MUI_ENTRY ruRUSelectPartitionEntries[] = { 8, 15, - "\x07  ¦¬¨â¥ C ¤«ï á®§¤ ­¨ï ­®¢®£® à §¤¥« .", + "\x07 Press P to create a primary partition.", +// "\x07  ¦¬¨â¥ C ¤«ï á®§¤ ­¨ï ­®¢®£® à §¤¥« .", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07  ¦¬¨â¥ D ¤«ï 㤠«¥­¨ï áãé¥áâ¢ãî饣® à §¤¥« .", TEXT_STYLE_NORMAL }, @@ -1279,6 +1286,10 @@ static MUI_ENTRY ruRURegistryEntries[] = MUI_ERROR ruRUErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS ­¥ ¡ë« ¯®«­®áâìî ãáâ ­®¢«¥­ ­  ¢ è\n" @@ -1489,6 +1500,32 @@ MUI_ERROR ruRUErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1601,13 +1638,19 @@ MUI_STRING ruRUStrings[] = {STRING_PLEASEWAIT, " ®¦ «ã©áâ , ¯®¤®¦¤¨â¥..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = “áâ ­®¢¨âì C = ‘®§¤ âì à §¤¥« F3 = ‚ë室"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = “áâ ­®¢¨âì C = ‘®§¤ âì à §¤¥« F3 = ‚ë室"}, {STRING_INSTALLDELETEPARTITION, " ENTER = “áâ ­®¢¨âì D = “¤ «¨âì à §¤¥« F3 = ‚ë室"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, " §¬¥à ­®¢®£® à §¤¥« :"}, {STRING_CHOOSENEWPARTITION, - "‚ë å®â¨â¥ á®§¤ âì ­®¢ë© à §¤¥« ­ "}, + "You have chosen to create a primary partition on"}, +// "‚ë å®â¨â¥ á®§¤ âì ­®¢ë© à §¤¥« ­ "}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "®¦ «ã©áâ , ¢¢¥¤¨â¥ à §¬¥à ­®¢®£® à §¤¥«  ¢ ¬¥£ ¡ ©â å."}, {STRING_CREATEPARTITION, @@ -1690,6 +1733,8 @@ MUI_STRING ruRUStrings[] = " ¥à §¬¥ç¥­­®¥ ¯à®áâà ­á⢮ %6lu %s"}, {STRING_MAXSIZE, "Œ (¬ ªá. %lu Œ)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "®¢ë© (­¥®âä®à¬ â¨à®¢ ­­ë©)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/sk-SK.h b/reactos/base/setup/usetup/lang/sk-SK.h index 6c7bf3c1504..5ea527a917f 100644 --- a/reactos/base/setup/usetup/lang/sk-SK.h +++ b/reactos/base/setup/usetup/lang/sk-SK.h @@ -827,12 +827,19 @@ static MUI_ENTRY skSKSelectPartitionEntries[] = { 8, 15, - "\x07 StlaŸte C pre vytvorenie novej oblasti.", + "\x07 Press P to create a primary partition.", +// "\x07 StlaŸte C pre vytvorenie novej oblasti.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 StlaŸte D pre vymazanie existuj£cej oblasti.", TEXT_STYLE_NORMAL }, @@ -1286,6 +1293,10 @@ static MUI_ENTRY skSKRegistryEntries[] = MUI_ERROR skSKErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "Syst‚m ReactOS nie je kompletne nainçtalovanì na Vaçom\n" @@ -1499,6 +1510,32 @@ MUI_ERROR skSKErrorEntries[] = " * PokraŸujte stlaŸen¡m –ubovo–n‚ho kl vesu.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1611,13 +1648,19 @@ MUI_STRING skSKStrings[] = {STRING_PLEASEWAIT, " PoŸkajte, pros¡m ..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Inçtalovaœ C = Vytvoriœ oblasœ F3 = SkonŸiœ"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Inçtalovaœ C = Vytvoriœ oblasœ F3 = SkonŸiœ"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Inçtalovaœ D = Odstr niœ oblasœ F3 = SkonŸiœ"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Ve–kosœ novej oblasti:"}, {STRING_CHOOSENEWPARTITION, - "Zvolili ste vytvorenie novej oblasti na"}, + "You have chosen to create a primary partition on"}, +// "Zvolili ste vytvorenie novej oblasti na"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Zadajte, pros¡m, ve–kosœ novej oblasti v megabajtoch."}, {STRING_CREATEPARTITION, @@ -1700,6 +1743,8 @@ MUI_STRING skSKStrings[] = " Miesto bez oblast¡ %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Nov  (Nenaform tovan )"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/sq-AL.h b/reactos/base/setup/usetup/lang/sq-AL.h index f82c4a68b47..de67d4a7a22 100644 --- a/reactos/base/setup/usetup/lang/sq-AL.h +++ b/reactos/base/setup/usetup/lang/sq-AL.h @@ -823,12 +823,19 @@ static MUI_ENTRY sqALSelectPartitionEntries[] = { 8, 15, - "\x07 Kiko C p‰r t‰ krijuar nj‰ particion t‰ ri.", + "\x07 Press P to create a primary partition.", +// "\x07 Kiko C p‰r t‰ krijuar nj‰ particion t‰ ri.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Kliko D p‰r t‰ fshir‰ nj‰ particion ekzistues.", TEXT_STYLE_NORMAL }, @@ -1282,6 +1289,10 @@ static MUI_ENTRY sqALRegistryEntries[] = MUI_ERROR sqALErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS nuk ‰shte instaluar plotesisht ne kompjuterin\n" @@ -1492,6 +1503,32 @@ MUI_ERROR sqALErrorEntries[] = " * Shtypni nj‰ tast cfar‰do p‰r t‰ vazhduar.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1603,13 +1640,19 @@ MUI_STRING sqALStrings[] = {STRING_PLEASEWAIT, " Ju lutem prisni..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalo C = Krijo Particion F3 = Dil"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalo C = Krijo Particion F3 = Dil"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalo D = Fshi Particion F3 = Dil"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Madh‰sia e particionit t‰ ri:"}, {STRING_CHOOSENEWPARTITION, +// "You have chosen to create a primary partition on"}, "Ju keni zgjedhur p‰r t‰ krijuar nj‰ ndarje t‰ re n‰"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "Ju lutem, jepini madh‰sin‰ e particionit t‰ ri n‰ megabajt."}, {STRING_CREATEPARTITION, @@ -1692,6 +1735,8 @@ MUI_STRING sqALStrings[] = " Hap‰sire e papjesesezuar %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "I ri (papjesesezuar)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/sv-SE.h b/reactos/base/setup/usetup/lang/sv-SE.h index c0f8c13352a..fdb6377365d 100644 --- a/reactos/base/setup/usetup/lang/sv-SE.h +++ b/reactos/base/setup/usetup/lang/sv-SE.h @@ -826,12 +826,19 @@ static MUI_ENTRY svSESelectPartitionEntries[] = { 8, 15, - "\x07 Tryck C f”r att skapa en ny partition.", + "\x07 Press P to create a primary partition.", +// "\x07 Tryck C f”r att skapa en ny partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Tryck D f”r att ta bort en befintlig partititon.", TEXT_STYLE_NORMAL }, @@ -1285,6 +1292,10 @@ static MUI_ENTRY svSERegistryEntries[] = MUI_ERROR svSEErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS installerades inte fullst„ndigt p† din\n" @@ -1495,6 +1506,32 @@ MUI_ERROR svSEErrorEntries[] = " * Tryck valfri tangent f”r att forts„tta.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1606,13 +1643,19 @@ MUI_STRING svSEStrings[] = {STRING_PLEASEWAIT, " Var v„nlig v„nta..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Installera C = Skapa Partition F3 = Avsluta"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Installera C = Skapa Partition F3 = Avsluta"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Installera D = Ta bort Partition F3 = Avsluta"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Storlek p† den nya partitionen:"}, {STRING_CHOOSENEWPARTITION, - "Du har valt att skapa en ny partiton p†"}, + "You have chosen to create a primary partition on"}, +// "Du har valt att skapa en ny partiton p†"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "V„nligen skriv in storleken av den nya partitionen i megabytes."}, {STRING_CREATEPARTITION, @@ -1695,6 +1738,8 @@ MUI_STRING svSEStrings[] = " Opartitionerat utrymme %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Ny (Oformaterad)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/tr-TR.h b/reactos/base/setup/usetup/lang/tr-TR.h index 415329708a1..2afd98af27d 100644 --- a/reactos/base/setup/usetup/lang/tr-TR.h +++ b/reactos/base/setup/usetup/lang/tr-TR.h @@ -807,12 +807,19 @@ static MUI_ENTRY trTRSelectPartitionEntries[] = { 8, 15, - "\x07 Se‡ili boŸluktan yeni bir b”lm oluŸturmak i‡in C d§mesine basnz.", + "\x07 Press P to create a primary partition.", +// "\x07 Se‡ili boŸluktan yeni bir b”lm oluŸturmak i‡in C d§mesine basnz.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Se‡ili b”lm silmek i‡in D d§mesine basnz.", TEXT_STYLE_NORMAL }, @@ -1254,6 +1261,10 @@ static MUI_ENTRY trTRRegistryEntries[] = MUI_ERROR trTRErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS, bilgisayara btnyle kurulmad.\n" @@ -1463,6 +1474,32 @@ MUI_ERROR trTRErrorEntries[] = " * Srdrmek i‡in bir d§meye basnz.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1574,13 +1611,19 @@ MUI_STRING trTRStrings[] = {STRING_PLEASEWAIT, " Ltfen bekleyiniz..."}, {STRING_INSTALLCREATEPARTITION, - " GiriŸ = Kur C = B”lm OluŸtur F3 = €kŸ"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " GiriŸ = Kur C = B”lm OluŸtur F3 = €kŸ"}, {STRING_INSTALLDELETEPARTITION, " GiriŸ = Kur D = B”lm Sil F3 = €kŸ"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Bykl§ giriniz:"}, {STRING_CHOOSENEWPARTITION, - "Yeni bir b”lm oluŸturmay se‡tiniz."}, + "You have chosen to create a primary partition on"}, +// "Yeni bir b”lm oluŸturmay se‡tiniz."}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "OluŸturulacak b”lmn bykl§n mega‡oklu olarak giriniz."}, {STRING_CREATEPARTITION, @@ -1663,6 +1706,8 @@ MUI_STRING trTRStrings[] = " Kullanlmayan BoŸluk %6lu %s"}, {STRING_MAXSIZE, "MB (En ‡ok %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Yeni (Bi‡imlendirilmemiŸ)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/lang/uk-UA.h b/reactos/base/setup/usetup/lang/uk-UA.h index 10231d1448b..a3b39c23e77 100644 --- a/reactos/base/setup/usetup/lang/uk-UA.h +++ b/reactos/base/setup/usetup/lang/uk-UA.h @@ -825,12 +825,19 @@ static MUI_ENTRY ukUASelectPartitionEntries[] = { 8, 15, - "\x07  â¨á­iâì C 鮡 á⢮à¨â¨ ­®¢¨© à®§¤i«.", + "\x07 Press P to create a primary partition.", +// "\x07  â¨á­iâì C 鮡 á⢮à¨â¨ ­®¢¨© à®§¤i«.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07  â¨á­iâì D 鮡 ¢¨¤ «¨â¨ iá­ãî稩 à®§¤i«.", TEXT_STYLE_NORMAL }, @@ -1284,6 +1291,10 @@ static MUI_ENTRY ukUARegistryEntries[] = MUI_ERROR ukUAErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS ­¥ ¡ã¢ ¯®¢­iáâî ¢áâ ­®¢«¥­¨© ­  ‚ è\n" @@ -1495,6 +1506,32 @@ MUI_ERROR ukUAErrorEntries[] = " *  â¨á­iâì ¡ã¤ì-ïªã ª« ¢ièã ¤«ï ¯à®¤®¢¦¥­­ï.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1606,13 +1643,19 @@ MUI_STRING ukUAStrings[] = {STRING_PLEASEWAIT, " ã¤ì-« áª , § ç¥ª ©â¥..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = ‚áâ ­®¢¨â¨ C = ‘⢮à¨â¨ ®§¤i« F3 = ‚¨©â¨"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = ‚áâ ­®¢¨â¨ C = ‘⢮à¨â¨ ®§¤i« F3 = ‚¨©â¨"}, {STRING_INSTALLDELETEPARTITION, " ENTER = ‚áâ ­®¢¨â¨ D = ‚¨¤ «¨â¨ ®§¤i« F3 = ‚¨©â¨"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "®§¬ià ­®¢®£® à®§¤i«ã:"}, {STRING_CHOOSENEWPARTITION, - "‚¨ å®ç¥â¥ á⢮à¨â¨ ­®¢¨© à®§¤i« ­ "}, + "You have chosen to create a primary partition on"}, +// "‚¨ å®ç¥â¥ á⢮à¨â¨ ­®¢¨© à®§¤i« ­ "}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, {STRING_HDDSIZE, "ã¤ì-« áª , ¢¢¥¤iâì à®§¬ià ­®¢®£® à®§¤i«ã ¢ ¬¥£ ¡ ©â å."}, {STRING_CREATEPARTITION, @@ -1695,6 +1738,8 @@ MUI_STRING ukUAStrings[] = " ¥à®§¬i祭  ®¡« áâì %6lu %s"}, {STRING_MAXSIZE, "MB (¬ ªá. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "®¢¨© (¥ä®à¬ â®¢ ­¨©)"}, {STRING_FORMATUNUSED, diff --git a/reactos/base/setup/usetup/mui.h b/reactos/base/setup/usetup/mui.h index bf35835f792..48092c81ce4 100644 --- a/reactos/base/setup/usetup/mui.h +++ b/reactos/base/setup/usetup/mui.h @@ -100,8 +100,10 @@ MUIGetString( #define STRING_PLEASEWAIT 1 #define STRING_INSTALLCREATEPARTITION 2 #define STRING_INSTALLDELETEPARTITION 3 +#define STRING_DELETEPARTITION 59 #define STRING_PARTITIONSIZE 4 #define STRING_CHOOSENEWPARTITION 5 +#define STRING_CHOOSE_NEW_EXTENDED_PARTITION 57 #define STRING_HDDSIZE 6 #define STRING_CREATEPARTITION 7 #define STRING_PARTFORMAT 8 @@ -144,6 +146,7 @@ MUIGetString( #define STRING_UNPSPACE 48 #define STRING_MAXSIZE 49 #define STRING_UNFORMATTED 50 +#define STRING_EXTENDED_PARTITION 58 #define STRING_FORMATUNUSED 51 #define STRING_FORMATUNKNOWN 52 #define STRING_KB 53 diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index 3312e217c76..70c606027b9 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -1373,6 +1373,11 @@ PrintPartitionData( { PartType = "NTFS"; /* FIXME: Not quite correct! */ } + else if ((PartEntry->PartitionType == PARTITION_EXTENDED) || + (PartEntry->PartitionType == PARTITION_XINT13_EXTENDED)) + { + PartType = MUIGetString(STRING_EXTENDED_PARTITION); + } } PartSize.QuadPart = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; @@ -2095,7 +2100,7 @@ GetNextUnpartitionedEntry( VOID -CreateNewPartition( +CreatePrimaryPartition( PPARTLIST List, ULONGLONG SectorCount, BOOLEAN AutoCreate) @@ -2104,7 +2109,7 @@ CreateNewPartition( PPARTENTRY PartEntry; PPARTENTRY NewPartEntry; - DPRINT1("CreateNewPartition(%I64u)\n", SectorCount); + DPRINT1("CreatePrimaryPartition(%I64u)\n", SectorCount); if (List == NULL || List->CurrentDisk == NULL || @@ -2180,6 +2185,102 @@ DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); } +VOID +CreateExtendedPartition( + PPARTLIST List, + ULONGLONG SectorCount) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + PPARTENTRY NewPartEntry; + + DPRINT1("CreatePrimaryPartition(%I64u)\n", SectorCount); + + if (List == NULL || + List->CurrentDisk == NULL || + List->CurrentPartition == NULL || + List->CurrentPartition->IsPartitioned == TRUE) + { + return; + } + + DiskEntry = List->CurrentDisk; + PartEntry = List->CurrentPartition; + +DPRINT1("Current partition sector count: %I64u\n", PartEntry->SectorCount.QuadPart); + + if (Align(PartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - PartEntry->StartSector.QuadPart == PartEntry->SectorCount.QuadPart) + { +DPRINT1("Convert existing partition entry\n"); + /* Convert current entry to 'new (unformatted)' */ + PartEntry->IsPartitioned = TRUE; +// PartEntry->PartitionType = PARTITION_ENTRY_UNUSED; + PartEntry->FormatState = Formatted; + PartEntry->AutoCreate = FALSE; + PartEntry->New = FALSE; + PartEntry->BootIndicator = FALSE; /* FIXME */ + +DPRINT1("First Sector: %I64u\n", PartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", PartEntry->StartSector.QuadPart + PartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", PartEntry->SectorCount.QuadPart); + } + else + { +DPRINT1("Add new partition entry\n"); + + /* Insert and initialize a new partition entry */ + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + /* Insert the new entry into the list */ + InsertTailList(&PartEntry->ListEntry, + &NewPartEntry->ListEntry); + + NewPartEntry->DiskEntry = DiskEntry; + + NewPartEntry->IsPartitioned = TRUE; + NewPartEntry->StartSector.QuadPart = PartEntry->StartSector.QuadPart; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; + +// NewPartEntry->PartitionType = PARTITION_ENTRY_UNUSED; + +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->New = FALSE; + NewPartEntry->FormatState = Formatted; + NewPartEntry->BootIndicator = FALSE; /* FIXME */ + + PartEntry->StartSector.QuadPart = NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart; + PartEntry->SectorCount.QuadPart -= (PartEntry->StartSector.QuadPart - NewPartEntry->StartSector.QuadPart); + } + + if (NewPartEntry->StartSector.QuadPart < 1450560) + { + /* Partition starts below the 8.4GB boundary ==> CHS partition */ + NewPartEntry->PartitionType = PARTITION_EXTENDED; + } + else + { + /* Partition starts above the 8.4GB boundary ==> LBA partition */ + NewPartEntry->PartitionType = PARTITION_XINT13_EXTENDED; + } + + UpdateDiskLayout(DiskEntry); + + DiskEntry->Dirty = TRUE; + + UpdatePartitionNumbers(DiskEntry); + + AssignDriveLetters(List); +} + + VOID DeleteCurrentPartition( PPARTLIST List) @@ -2561,4 +2662,143 @@ SetMountedDeviceValues( return TRUE; } + +static +BOOLEAN +IsLastPrimaryPartiton( + IN PPARTENTRY PartEntry) +{ + return (PartEntry->ListEntry.Flink == &PartEntry->DiskEntry->PrimaryPartListHead); +} + + +static +BOOLEAN +IsPreviousPartitionExtended( + IN PPARTENTRY PartEntry, + IN PDISKENTRY DiskEntry) +{ + PPARTENTRY PrevPartEntry; + PLIST_ENTRY Entry; + + Entry = PartEntry->ListEntry.Blink; + + while (Entry != &DiskEntry->PrimaryPartListHead) + { + PrevPartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + + if (IsContainerPartition(PrevPartEntry->PartitionType)) + return TRUE; + + Entry = Entry->Blink; + } + + return FALSE; + +} + + +static +ULONG +GetPrimaryPartitionCount( + IN PDISKENTRY DiskEntry) +{ + PLIST_ENTRY Entry; + PPARTENTRY PartEntry; + UINT nCount = 0; + + Entry = DiskEntry->PrimaryPartListHead.Flink; + while (Entry != &DiskEntry->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + if (PartEntry->IsPartitioned == TRUE) + nCount++; + + Entry = Entry->Flink; + } + + return nCount; +} + + +static +ULONG +GetExtendedPartitionCount( + IN PDISKENTRY DiskEntry) +{ + PLIST_ENTRY Entry; + PPARTENTRY PartEntry; + UINT nCount = 0; + + Entry = DiskEntry->PrimaryPartListHead.Flink; + while (Entry != &DiskEntry->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + if (PartEntry->IsPartitioned == TRUE && + IsContainerPartition(PartEntry->PartitionType)) + nCount++; + + Entry = Entry->Flink; + } + + return nCount; +} + + +ULONG +PrimaryPartitionCreationChecks( + IN PPARTLIST List) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + + DiskEntry = List->CurrentDisk; + PartEntry = List->CurrentPartition; + + /* Fail if partition is already in use */ + if (PartEntry->IsPartitioned == TRUE) + return ERROR_NEW_PARTITION; + + /* Fail if there are more than 4 partitions in the list */ + if (GetPrimaryPartitionCount(DiskEntry) > 4) + return ERROR_PARTITION_TABLE_FULL; + + /* FIXME: Fail if this partiton is located behind an extended partition */ + if (IsPreviousPartitionExtended(PartEntry, DiskEntry)) + return ERROR_NOT_BEHIND_EXTENDED; + + return ERROR_SUCCESS; +} + + +ULONG +ExtendedPartitionCreationChecks( + IN PPARTLIST List) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + + DiskEntry = List->CurrentDisk; + PartEntry = List->CurrentPartition; + + /* Fail if partition is already in use */ + if (PartEntry->IsPartitioned == TRUE) + return ERROR_NEW_PARTITION; + + /* Fail if there are more than 4 partitions in the list */ + if (GetPrimaryPartitionCount(DiskEntry) > 4) + return ERROR_PARTITION_TABLE_FULL; + + /* Fail if there is another extended partition in the list */ + if (GetExtendedPartitionCount(DiskEntry) != 0) + return ERROR_ONLY_ONE_EXTENDED; + + /* Fail if the partition is not the last list entry */ + if (!IsLastPrimaryPartiton(PartEntry)) + return ERROR_EXTENDED_NOT_LAST; + + return ERROR_SUCCESS; +} + + /* EOF */ diff --git a/reactos/base/setup/usetup/partlist.h b/reactos/base/setup/usetup/partlist.h index 5cf1841602d..7d092044c2d 100644 --- a/reactos/base/setup/usetup/partlist.h +++ b/reactos/base/setup/usetup/partlist.h @@ -216,11 +216,16 @@ ScrollUpPartitionList( PPARTLIST List); VOID -CreateNewPartition( +CreatePrimaryPartition( PPARTLIST List, ULONGLONG PartitionSize, BOOLEAN AutoCreate); +VOID +CreateExtendedPartition( + PPARTLIST List, + ULONGLONG PartitionSize); + VOID DeleteCurrentPartition( PPARTLIST List); @@ -237,4 +242,12 @@ BOOLEAN WritePartitionsToDisk( PPARTLIST List); +ULONG +PrimaryPartitionCreationChecks( + IN PPARTLIST List); + +ULONG +ExtendedPartitionCreationChecks( + IN PPARTLIST List); + /* EOF */ diff --git a/reactos/base/setup/usetup/usetup.h b/reactos/base/setup/usetup/usetup.h index dd88ca8103b..0d4f587c965 100644 --- a/reactos/base/setup/usetup/usetup.h +++ b/reactos/base/setup/usetup/usetup.h @@ -128,7 +128,8 @@ typedef enum _PAGE_NUMBER LAYOUT_SETTINGS_PAGE, SELECT_PARTITION_PAGE, - CREATE_PARTITION_PAGE, + CREATE_PRIMARY_PARTITION_PAGE, + CREATE_EXTENDED_PARTITION_PAGE, DELETE_PARTITION_PAGE, SELECT_FILE_SYSTEM_PAGE, From 456a955d0b072a11a4f376ca56e0cd970cd08419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 21 May 2014 00:18:50 +0000 Subject: [PATCH 37/69] [USETUP]: French translation for extended partitions feature, see r63392. svn path=/trunk/; revision=63393 --- reactos/base/setup/usetup/lang/fr-FR.h | 51 ++++++++++++-------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/reactos/base/setup/usetup/lang/fr-FR.h b/reactos/base/setup/usetup/lang/fr-FR.h index 853bcf72acb..2fb6ed3338d 100644 --- a/reactos/base/setup/usetup/lang/fr-FR.h +++ b/reactos/base/setup/usetup/lang/fr-FR.h @@ -64,7 +64,7 @@ static MUI_ENTRY frFRWelcomePageEntries[] = { 6, 8, - "Bienvenue … l'installation de ReactOS", + "Bienvenue dans l'installation de ReactOS", TEXT_STYLE_HIGHLIGHT }, { @@ -140,7 +140,7 @@ static MUI_ENTRY frFRIntroPageEntries[] = { 6, 8, - "L'Installation de ReactOS est en phase de d‚veloppement.", + "L'installation de ReactOS est en phase de d‚veloppement.", TEXT_STYLE_NORMAL }, { @@ -457,7 +457,7 @@ static MUI_ENTRY frFRRepairPageEntries[] = { 6, 8, - "L'Installation de ReactOS est en phase de d‚veloppement.", + "L'installation de ReactOS est en phase de d‚veloppement.", TEXT_STYLE_NORMAL }, { @@ -814,13 +814,13 @@ static MUI_ENTRY frFRSelectPartitionEntries[] = { 6, 9, - "l'espace disque non utilise pour de nouvelles partitions.", + "l'espace disque non utilis‚ pour de nouvelles partitions.", TEXT_STYLE_NORMAL }, { 8, 11, - "\x07 Appuyer sur HAUT ou BAS pour s‚lectionner une entree de la liste.", + "\x07 Appuyer sur HAUT ou BAS pour s‚lectionner une entr‚e de la liste.", TEXT_STYLE_NORMAL }, { @@ -832,14 +832,13 @@ static MUI_ENTRY frFRSelectPartitionEntries[] = { 8, 15, - "\x07 Press P to create a primary partition.", -// "\x07 Appuyer sur C pour creer une nouvelle partition.", + "\x07 Appuyer sur P pour cr‚er une partition primaire.", TEXT_STYLE_NORMAL }, { 8, 17, - "\x07 Press E to create an extended partition.", + "\x07 Appuyer sur E pour cr‚er une partition ‚tendue.", TEXT_STYLE_NORMAL }, { @@ -1300,7 +1299,7 @@ MUI_ERROR frFRErrorEntries[] = { { // NOT_AN_ERROR - "Success\n" + "SuccŠs\n" }, { //ERROR_NOT_INSTALLED @@ -1509,34 +1508,34 @@ MUI_ERROR frFRErrorEntries[] = { //ERROR_INSUFFICIENT_DISKSPACE, "Pas assez d'espace libre dans la partition s‚lectionn‚e.\n" - " * Appuyez sur n'importe quelle touche pour continuer.", + " * Appuyer sur une touche pour continuer.", NULL }, { //ERROR_PARTITION_TABLE_FULL, - "You can not create a new primary or extended partition in the\n" - "partition table of this disk because the partition table is full.\n" + "Impossible de cr‚er une nouvelle partition primaire ou ‚tendue\n" + "sur ce disque parce que sa table de partition est pleine.\n" "\n" - " * Press any key to continue." + " * Appuyer sur une touche pour continuer." }, { //ERROR_ONLY_ONE_EXTENDED, - "You can not create more than one extended partition per disk.\n" + "Impossible de cr‚er plus d'une partition ‚tendue par disque.\n" "\n" - " * Press any key to continue." + " * Appuyer sur une touche pour continuer." }, { //ERROR_NOT_BEHIND_EXTENDED, - "You can not create a partition behind an extended partition.\n" + "Impossible de cr‚er une partition pr‚c‚dant une partition ‚tendue.\n" "\n" - " * Press any key to continue." + " * Appuyer sur une touche pour continuer." }, { //ERROR_EXTENDED_NOT_LAST, - "An extended partition must always be the last\n" - "partition in a partition table.\n" + "Une partition ‚tendue doit toujours être plac‚e en dernier\n" + "dans la table de partition.\n" "\n" - " * Press any key to continue." + " * Appuyer sur une touche pour continuer." }, { NULL, @@ -1650,19 +1649,17 @@ MUI_STRING frFRStrings[] = {STRING_PLEASEWAIT, " Veuillez patienter..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, -// " ENTRE = Installer C = Cr‚er Partition F3 = Quitter"}, + " ENTRE = Installer C = Cr‚er Partition Primaire E = Cr‚er Partition tendue F3 = Quitter"}, {STRING_INSTALLDELETEPARTITION, " ENTRE = Installer D = Supprimer Partition F3 = Quitter"}, {STRING_DELETEPARTITION, - " D = Delete Partition F3 = Quit"}, + " D = Supprimer Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Taille de la nouvelle partition :"}, {STRING_CHOOSENEWPARTITION, - "You have chosen to create a primary partition on"}, -// "Vous avez choisi de cr‚er une nouvelle partition sur"}, + "Vous avez choisi de cr‚er une partition primaire sur"}, {STRING_CHOOSE_NEW_EXTENDED_PARTITION, - "You have chosen to create an extended partition on"}, + "Vous avez choisi de cr‚er une partition ‚tendue sur"}, {STRING_HDDSIZE, "Veuillez entrer la taille de la nouvelle partition en m‚gaoctets."}, {STRING_CREATEPARTITION, @@ -1746,7 +1743,7 @@ MUI_STRING frFRStrings[] = {STRING_MAXSIZE, "Mo (max. %lu Mo)"}, {STRING_EXTENDED_PARTITION, - "Extended Partition"}, + "Partition tendue"}, {STRING_UNFORMATTED, "Nouveau (non format‚)"}, {STRING_FORMATUNUSED, From 4da2490a2d2ea2198395aa697296ef9b1b3c8889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 21 May 2014 00:22:05 +0000 Subject: [PATCH 38/69] Forgot this... svn path=/trunk/; revision=63394 --- reactos/base/setup/usetup/lang/fr-FR.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/setup/usetup/lang/fr-FR.h b/reactos/base/setup/usetup/lang/fr-FR.h index 2fb6ed3338d..5fc74fc8f8d 100644 --- a/reactos/base/setup/usetup/lang/fr-FR.h +++ b/reactos/base/setup/usetup/lang/fr-FR.h @@ -1653,7 +1653,7 @@ MUI_STRING frFRStrings[] = {STRING_INSTALLDELETEPARTITION, " ENTRE = Installer D = Supprimer Partition F3 = Quitter"}, {STRING_DELETEPARTITION, - " D = Supprimer Partition F3 = Quit"}, + " D = Supprimer Partition F3 = Quitter"}, {STRING_PARTITIONSIZE, "Taille de la nouvelle partition :"}, {STRING_CHOOSENEWPARTITION, From 110e942a46d4295b2345a36ff850c84f7f8aeb4b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 21 May 2014 09:44:41 +0000 Subject: [PATCH 39/69] [NTOSKRNL] Do not ASSERT, when an unimplemented, yet legal flag (MEM_RESERVE) is passed to NtMapViewOfSection. Instead fail gracefully. svn path=/trunk/; revision=63395 --- reactos/ntoskrnl/mm/ARM3/section.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/ARM3/section.c b/reactos/ntoskrnl/mm/ARM3/section.c index c69efc605ac..43274f93614 100644 --- a/reactos/ntoskrnl/mm/ARM3/section.c +++ b/reactos/ntoskrnl/mm/ARM3/section.c @@ -2655,9 +2655,15 @@ MmMapViewOfArm3Section(IN PVOID SectionObject, ASSERT(Section->u.Flags.Image == 0); ASSERT(Section->u.Flags.NoCache == 0); ASSERT(Section->u.Flags.WriteCombined == 0); - ASSERT((AllocationType & MEM_RESERVE) == 0); ASSERT(ControlArea->u.Flags.PhysicalMemory == 0); + /* FIXME */ + if ((AllocationType & MEM_RESERVE) != 0) + { + DPRINT1("MmMapViewOfArm3Section called with MEM_RESERVE, this is not implemented yet!!!\n"); + return STATUS_NOT_IMPLEMENTED; + } + /* Check if the mapping protection is compatible with the create */ if (!MiIsProtectionCompatible(Section->InitialPageProtection, Protect)) { From be2afdedf6edf86aac27f64457710aaf3a602cfc Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 21 May 2014 11:01:17 +0000 Subject: [PATCH 40/69] [USETUP] Display the proper partition type 'Extended Partiton' when an extended partition is going to be deleted. svn path=/trunk/; revision=63396 --- reactos/base/setup/usetup/interface/usetup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index af5e16fd99b..e2c394cf5ec 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -2137,6 +2137,10 @@ DeletePartitionPage(PINPUT_RECORD Ir) { PartType = "NTFS"; /* FIXME: Not quite correct! */ } + else if (IsContainerPartition(PartEntry->PartitionType)) + { + PartType = MUIGetString(STRING_EXTENDED_PARTITION); + } } PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; From 666f21e88f2a4099fc68489ee6f644e585af33c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 21 May 2014 12:23:04 +0000 Subject: [PATCH 41/69] [USETUP] - Fix a bit the translation of yesterday; - Use TEXT_PADDING_BIG instead of hardcoding 3 spaces in the status messages. svn path=/trunk/; revision=63398 --- reactos/base/setup/usetup/lang/fr-FR.h | 96 +++++++++++++------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/reactos/base/setup/usetup/lang/fr-FR.h b/reactos/base/setup/usetup/lang/fr-FR.h index 5fc74fc8f8d..9130cd1dde2 100644 --- a/reactos/base/setup/usetup/lang/fr-FR.h +++ b/reactos/base/setup/usetup/lang/fr-FR.h @@ -42,8 +42,8 @@ static MUI_ENTRY frFRLanguagePageEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -118,8 +118,8 @@ static MUI_ENTRY frFRWelcomePageEntries[] = { 0, 0, - " ENTRE = Continuer R = R‚parer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer R = R‚parer L = Licence F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -218,8 +218,8 @@ static MUI_ENTRY frFRIntroPageEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -342,8 +342,8 @@ static MUI_ENTRY frFRLicensePageEntries[] = { 0, 0, - " ENTRE = Retour", - TEXT_TYPE_STATUS + "ENTRE = Retour", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -435,8 +435,8 @@ static MUI_ENTRY frFRDevicePageEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -505,8 +505,8 @@ static MUI_ENTRY frFRRepairPageEntries[] = { 0, 0, - " CHAP = Page principale ENTRE = Red‚marrer", - TEXT_TYPE_STATUS + "CHAP = Page principale ENTRE = Red‚marrer", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -556,8 +556,8 @@ static MUI_ENTRY frFRComputerPageEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -596,8 +596,8 @@ static MUI_ENTRY frFRFlushPageEntries[] = { 0, 0, - " Vidage du cache", - TEXT_TYPE_STATUS + "Vidage du cache", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -642,8 +642,8 @@ static MUI_ENTRY frFRQuitPageEntries[] = { 0, 0, - " Veuillez attendre ...", - TEXT_TYPE_STATUS, + "Veuillez attendre ...", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -693,8 +693,8 @@ static MUI_ENTRY frFRDisplayPageEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -739,8 +739,8 @@ static MUI_ENTRY frFRSuccessPageEntries[] = { 0, 0, - " ENTRE = Red‚marrer l'ordinateur", - TEXT_TYPE_STATUS + "ENTRE = Red‚marrer l'ordinateur", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -785,8 +785,8 @@ static MUI_ENTRY frFRBootPageEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -850,8 +850,8 @@ static MUI_ENTRY frFRSelectPartitionEntries[] = { 0, 0, - " Patienter...", - TEXT_TYPE_STATUS + "Patienter...", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -884,8 +884,8 @@ static MUI_ENTRY frFRFormatPartitionEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -936,8 +936,8 @@ static MUI_ENTRY frFRInstallDirectoryEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1028,8 +1028,8 @@ static MUI_ENTRY frFRBootLoaderEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1068,7 +1068,7 @@ static MUI_ENTRY frFRKeyboardSettingsEntries[] = { 8, 13, - "\x07 Appuyez sur CHAP pour revenir a la page pr‚c‚dente sans changer", + "\x07 Appuyez sur CHAP pour revenir … la page pr‚c‚dente sans changer", TEXT_STYLE_NORMAL }, { @@ -1080,8 +1080,8 @@ static MUI_ENTRY frFRKeyboardSettingsEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1120,7 +1120,7 @@ static MUI_ENTRY frFRLayoutSettingsEntries[] = { 8, 13, - "\x07 Appuyez sur CHAP pour revenir a la page pr‚c‚dente sans changer", + "\x07 Appuyez sur CHAP pour revenir … la page pr‚c‚dente sans changer", TEXT_STYLE_NORMAL }, { @@ -1132,8 +1132,8 @@ static MUI_ENTRY frFRLayoutSettingsEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1161,8 +1161,8 @@ static MUI_ENTRY frFRPrepareCopyEntries[] = { 0, 0, - " Pr‚pare la liste de fichiers … copier...", - TEXT_TYPE_STATUS + "Pr‚pare la liste de fichiers … copier...", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1208,8 +1208,8 @@ static MUI_ENTRY frFRSelectFSEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { @@ -1255,8 +1255,8 @@ static MUI_ENTRY frFRDeletePartitionEntries[] = { 0, 0, - " D = Supprimer la Partition CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "D = Supprimer la Partition CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1283,8 +1283,8 @@ static MUI_ENTRY frFRRegistryEntries[] = { 0, 0, - " En train de cr‚er la base de registres...", - TEXT_TYPE_STATUS + "En train de cr‚er la base de registres...", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1532,7 +1532,7 @@ MUI_ERROR frFRErrorEntries[] = }, { //ERROR_EXTENDED_NOT_LAST, - "Une partition ‚tendue doit toujours être plac‚e en dernier\n" + "Une partition ‚tendue doit toujours ˆtre plac‚e en dernier\n" "dans la table de partition.\n" "\n" " * Appuyer sur une touche pour continuer." @@ -1649,7 +1649,7 @@ MUI_STRING frFRStrings[] = {STRING_PLEASEWAIT, " Veuillez patienter..."}, {STRING_INSTALLCREATEPARTITION, - " ENTRE = Installer C = Cr‚er Partition Primaire E = Cr‚er Partition tendue F3 = Quitter"}, + " ENTRE = Installer P/E = Cr‚er Partition Primaire/tendue F3 = Quitter"}, {STRING_INSTALLDELETEPARTITION, " ENTRE = Installer D = Supprimer Partition F3 = Quitter"}, {STRING_DELETEPARTITION, From be8085bec0fb4d46c9283efa4886540e08b25ded Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 21 May 2014 13:20:38 +0000 Subject: [PATCH 42/69] [MSVCRT_CRT_APITEST] * Don't reply on _set_errno() which shouldn't be exported. svn path=/trunk/; revision=63399 --- rostests/apitests/crt/mbstowcs_s.c | 38 +++++++++++++++--------------- rostests/apitests/crt/wcstombs_s.c | 38 +++++++++++++++--------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/rostests/apitests/crt/mbstowcs_s.c b/rostests/apitests/crt/mbstowcs_s.c index 3976fd6a3f7..ba65a98e4be 100644 --- a/rostests/apitests/crt/mbstowcs_s.c +++ b/rostests/apitests/crt/mbstowcs_s.c @@ -54,7 +54,7 @@ START_TEST(mbstowcs_s) size_t cchConverted; wchar_t widechar[10]; - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; widechar[5] = 0xFF; ret = mbstowcs_s(&cchConverted, widechar, 6, "hallo", 5); @@ -64,7 +64,7 @@ START_TEST(mbstowcs_s) ok_wstr(widechar, L"hallo"); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; widechar[0] = 0xFF; ret = mbstowcs_s(&cchConverted, widechar, 1, "", 0); @@ -73,7 +73,7 @@ START_TEST(mbstowcs_s) ok_wchar(widechar[0], 0); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; widechar[0] = 0xFF; widechar[1] = 0xFF; @@ -92,7 +92,7 @@ START_TEST(mbstowcs_s) ok_wchar(widechar[0], 0); ok_errno(ERANGE); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; widechar[0] = 0xFF; widechar[1] = 0xFF; @@ -111,64 +111,64 @@ START_TEST(mbstowcs_s) ok_wchar(widechar[0], 0); ok_errno(ERANGE); - _set_errno(0); + *_errno() = 0; ret = mbstowcs_s(0, 0, 0, 0, 0); ok_long(ret, EINVAL); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, 0, 0, 0, 0); ok_long(ret, EINVAL); ok_size_t(cchConverted, 0); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; widechar[0] = L'x'; ret = mbstowcs_s(0, widechar, 0, 0, 0); ok_long(ret, EINVAL); ok_wchar(widechar[0], L'x'); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; ret = mbstowcs_s(0, widechar, 10, "hallo", 5); ok_long(ret, 0); ok_errno(0); - _set_errno(0); + *_errno() = 0; ret = mbstowcs_s(0, widechar, 0, "hallo", 5); ok_long(ret, EINVAL); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, 0, 10, "hallo", 5); ok_long(ret, EINVAL); ok_size_t(cchConverted, 0xf00bac); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, 0, 0, "hallo", 5); ok_long(ret, 0); ok_size_t(cchConverted, 6); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, widechar, 10, 0, 5); ok_long(ret, EINVAL); ok_size_t(cchConverted, 0); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, widechar, 10, "hallo", 0); ok_long(ret, 0); ok_size_t(cchConverted, 1); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; widechar[0] = 0xABCD; widechar[1] = 0xABCD; @@ -187,28 +187,28 @@ START_TEST(mbstowcs_s) ok_wchar(widechar[0], L'h'); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, widechar, 10, 0, 0); ok_long(ret, 0); ok_size_t(cchConverted, 1); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, widechar, 10, "hallo", 7); ok_long(ret, 0); ok_size_t(cchConverted, 6); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, 0, 0, "hallo", 7); ok_long(ret, 0); ok_size_t(cchConverted, 6); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; widechar[0] = 0xABCD; widechar[1] = 0xABCD; @@ -227,7 +227,7 @@ START_TEST(mbstowcs_s) ok_wchar(widechar[0], L'h'); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = mbstowcs_s(&cchConverted, widechar, 10, "hallo", -1); ok_long(ret, 0); diff --git a/rostests/apitests/crt/wcstombs_s.c b/rostests/apitests/crt/wcstombs_s.c index 324de4468c3..d16468b0ceb 100644 --- a/rostests/apitests/crt/wcstombs_s.c +++ b/rostests/apitests/crt/wcstombs_s.c @@ -36,7 +36,7 @@ START_TEST(wcstombs_s) size_t cchConverted; char mbsbuffer[10]; - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; mbsbuffer[5] = 0xFF; ret = wcstombs_s(&cchConverted, mbsbuffer, 6, L"hallo", 5); @@ -46,7 +46,7 @@ START_TEST(wcstombs_s) ok_str(mbsbuffer, "hallo"); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; mbsbuffer[0] = 0xFF; ret = wcstombs_s(&cchConverted, mbsbuffer, 1, L"", 0); @@ -55,7 +55,7 @@ START_TEST(wcstombs_s) ok_wchar(mbsbuffer[0], 0); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; mbsbuffer[0] = 0xFF; mbsbuffer[1] = 0xFF; @@ -74,7 +74,7 @@ START_TEST(wcstombs_s) ok_char(mbsbuffer[0], 0); ok_errno(ERANGE); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; mbsbuffer[0] = 0xFF; mbsbuffer[1] = 0xFF; @@ -93,64 +93,64 @@ START_TEST(wcstombs_s) ok_char(mbsbuffer[0], 0); ok_errno(ERANGE); - _set_errno(0); + *_errno() = 0; ret = wcstombs_s(0, 0, 0, 0, 0); ok_long(ret, EINVAL); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, 0, 0, 0, 0); ok_long(ret, EINVAL); ok_size_t(cchConverted, 0); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; mbsbuffer[0] = L'x'; ret = wcstombs_s(0, mbsbuffer, 0, 0, 0); ok_long(ret, EINVAL); ok_char(mbsbuffer[0], L'x'); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; ret = wcstombs_s(0, mbsbuffer, 10, L"hallo", 5); ok_long(ret, 0); ok_errno(0); - _set_errno(0); + *_errno() = 0; ret = wcstombs_s(0, mbsbuffer, 0, L"hallo", 5); ok_long(ret, EINVAL); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, 0, 10, L"hallo", 5); ok_long(ret, EINVAL); ok_size_t(cchConverted, 0xf00bac); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, 0, 0, L"hallo", 5); ok_long(ret, 0); ok_size_t(cchConverted, 6); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, mbsbuffer, 10, 0, 5); ok_long(ret, EINVAL); ok_size_t(cchConverted, 0); ok_errno(EINVAL); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, mbsbuffer, 10, L"hallo", 0); ok_long(ret, 0); ok_size_t(cchConverted, 1); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; mbsbuffer[0] = 0xAB; mbsbuffer[1] = 0xCD; @@ -169,28 +169,28 @@ START_TEST(wcstombs_s) ok_char(mbsbuffer[0], L'h'); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, mbsbuffer, 10, 0, 0); ok_long(ret, 0); ok_size_t(cchConverted, 1); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, mbsbuffer, 10, L"hallo", 7); ok_long(ret, 0); ok_size_t(cchConverted, 6); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, 0, 0, L"hallo", 7); ok_long(ret, 0); ok_size_t(cchConverted, 6); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; mbsbuffer[0] = 0xAB; mbsbuffer[1] = 0xCD; @@ -209,7 +209,7 @@ START_TEST(wcstombs_s) ok_char(mbsbuffer[0], L'h'); ok_errno(0); - _set_errno(0); + *_errno() = 0; cchConverted = 0xf00bac; ret = wcstombs_s(&cchConverted, mbsbuffer, 10, L"hallo", -1); ok_long(ret, 0); From b5adad7bfa7b73a205c2c2ca602bce5db43ebd04 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 21 May 2014 13:30:26 +0000 Subject: [PATCH 43/69] [MSVCRT_CRT_APITEST] * Don't enable mbstowcs_s() tests (it shouldn't be exported). CORE-7889 svn path=/trunk/; revision=63400 --- rostests/apitests/crt/msvcrt_crt_apitest.cmake | 2 +- rostests/apitests/crt/testlist.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rostests/apitests/crt/msvcrt_crt_apitest.cmake b/rostests/apitests/crt/msvcrt_crt_apitest.cmake index b9ec8eb63aa..40f59c956d0 100644 --- a/rostests/apitests/crt/msvcrt_crt_apitest.cmake +++ b/rostests/apitests/crt/msvcrt_crt_apitest.cmake @@ -1118,7 +1118,7 @@ list(APPEND SOURCE_MSVCRT # mbsrtowcs # mbsrtowcs_s # mbstowcs.c - mbstowcs_s +# mbstowcs_s Not exported in 2k3 Sp1 # mbtowc.c # memchr.c # memcmp.c diff --git a/rostests/apitests/crt/testlist.c b/rostests/apitests/crt/testlist.c index 12532923837..765857d783f 100644 --- a/rostests/apitests/crt/testlist.c +++ b/rostests/apitests/crt/testlist.c @@ -4,7 +4,6 @@ #include #if defined(TEST_MSVCRT) -extern void func_mbstowcs_s(void); extern void func_wcstombs_s(void); extern void func__vscprintf(void); extern void func__vscwprintf(void); @@ -31,7 +30,6 @@ const struct test winetest_testlist[] = #endif #if defined(TEST_STATIC_CRT) #elif defined(TEST_MSVCRT) - { "mbstowcs_s", func_mbstowcs_s }, { "wcstombs_s", func_wcstombs_s }, { "_vscprintf", func__vscprintf }, { "_vscwprintf", func__vscwprintf }, From 934a5546ea25a579bdb3f49ec2a6671ba0ee208c Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 21 May 2014 14:26:20 +0000 Subject: [PATCH 44/69] [MSVCRT_CRT_APITEST] * Don't enable wcstombs_s() tests (it shouldn't be exported). CORE-7889 svn path=/trunk/; revision=63401 --- rostests/apitests/crt/msvcrt_crt_apitest.cmake | 2 +- rostests/apitests/crt/testlist.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rostests/apitests/crt/msvcrt_crt_apitest.cmake b/rostests/apitests/crt/msvcrt_crt_apitest.cmake index 40f59c956d0..6da1664fe35 100644 --- a/rostests/apitests/crt/msvcrt_crt_apitest.cmake +++ b/rostests/apitests/crt/msvcrt_crt_apitest.cmake @@ -1251,7 +1251,7 @@ list(APPEND SOURCE_MSVCRT # wcstok_s.c # wcstol.c # wcstombs.c - wcstombs_s.c +# wcstombs_s.c Not exported in 2k3 Sp1 # wcstoul.c # wcsxfrm.c # wctob diff --git a/rostests/apitests/crt/testlist.c b/rostests/apitests/crt/testlist.c index 765857d783f..13670f0200a 100644 --- a/rostests/apitests/crt/testlist.c +++ b/rostests/apitests/crt/testlist.c @@ -4,7 +4,6 @@ #include #if defined(TEST_MSVCRT) -extern void func_wcstombs_s(void); extern void func__vscprintf(void); extern void func__vscwprintf(void); #endif @@ -30,7 +29,6 @@ const struct test winetest_testlist[] = #endif #if defined(TEST_STATIC_CRT) #elif defined(TEST_MSVCRT) - { "wcstombs_s", func_wcstombs_s }, { "_vscprintf", func__vscprintf }, { "_vscwprintf", func__vscwprintf }, #elif defined(TEST_NTDLL) From 10af5eafdfde36e6ec3e9f5e9bfb9150c9cb1dbb Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 21 May 2014 18:02:48 +0000 Subject: [PATCH 45/69] [MSVCRT] * Don't export mbstowcs_s(). CORE-7889 svn path=/trunk/; revision=63402 --- reactos/dll/win32/msvcrt/msvcrt.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/dll/win32/msvcrt/msvcrt.spec b/reactos/dll/win32/msvcrt/msvcrt.spec index 8587c0d9e66..2008a214d26 100644 --- a/reactos/dll/win32/msvcrt/msvcrt.spec +++ b/reactos/dll/win32/msvcrt/msvcrt.spec @@ -1304,7 +1304,6 @@ # stub mbsrtowcs # stub mbsrtowcs_s @ cdecl mbstowcs(ptr str long) -@ cdecl mbstowcs_s(ptr ptr long str long) @ cdecl mbtowc(wstr str long) @ cdecl memchr(ptr long long) @ cdecl memcmp(ptr ptr long) From a5b59586d31dce3eb70e9e9fa430120b2378820f Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 21 May 2014 20:20:18 +0000 Subject: [PATCH 46/69] [USETUP] Display logical partitions. They cannot be selected or modified yet. svn path=/trunk/; revision=63403 --- reactos/base/setup/usetup/lang/bg-BG.h | 4 +- reactos/base/setup/usetup/lang/cs-CZ.h | 4 +- reactos/base/setup/usetup/lang/de-DE.h | 4 +- reactos/base/setup/usetup/lang/el-GR.h | 4 +- reactos/base/setup/usetup/lang/en-US.h | 4 +- reactos/base/setup/usetup/lang/es-ES.h | 4 +- reactos/base/setup/usetup/lang/et-EE.h | 4 +- reactos/base/setup/usetup/lang/fr-FR.h | 4 +- reactos/base/setup/usetup/lang/he-IL.h | 4 +- reactos/base/setup/usetup/lang/it-IT.h | 4 +- reactos/base/setup/usetup/lang/ja-JP.h | 4 +- reactos/base/setup/usetup/lang/lt-LT.h | 4 +- reactos/base/setup/usetup/lang/nl-NL.h | 4 +- reactos/base/setup/usetup/lang/pl-PL.h | 4 +- reactos/base/setup/usetup/lang/pt-BR.h | 4 +- reactos/base/setup/usetup/lang/ro-RO.h | 4 +- reactos/base/setup/usetup/lang/ru-RU.h | 4 +- reactos/base/setup/usetup/lang/sk-SK.h | 4 +- reactos/base/setup/usetup/lang/sq-AL.h | 4 +- reactos/base/setup/usetup/lang/sv-SE.h | 4 +- reactos/base/setup/usetup/lang/tr-TR.h | 4 +- reactos/base/setup/usetup/lang/uk-UA.h | 4 +- reactos/base/setup/usetup/partlist.c | 77 +++++++++++++++++--------- reactos/base/setup/usetup/partlist.h | 2 + 24 files changed, 96 insertions(+), 71 deletions(-) diff --git a/reactos/base/setup/usetup/lang/bg-BG.h b/reactos/base/setup/usetup/lang/bg-BG.h index 742c323ac08..8e5e61f3730 100644 --- a/reactos/base/setup/usetup/lang/bg-BG.h +++ b/reactos/base/setup/usetup/lang/bg-BG.h @@ -1733,7 +1733,7 @@ MUI_STRING bgBGStrings[] = {STRING_HDINFOPARTEXISTS, "­  â¢êठ¤¨áª %lu (%I64u %s), ˆ§¢®¤=%hu, ˜¨­ =%hu, Ž“=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c ¢¨¤ %-3u %6lu %s"}, + "%c%c %s¢¨¤ %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s â¢êठ¤¨áª %lu (ˆ§¢®¤=%hu, ˜¨­ =%hu, Ž“=%hu) ­  %S"}, {STRING_HDDINFOUNK6, @@ -1741,7 +1741,7 @@ MUI_STRING bgBGStrings[] = {STRING_NEWPARTITION, "¥ áꧤ ¤¥­ ­®¢ ¤ï« ­ "}, {STRING_UNPSPACE, - " ¥à §¯à¥¤¥«¥­® ¬ïáâ® %6lu %s"}, + " %s¥à §¯à¥¤¥«¥­® ¬ïáâ®%s %6lu %s"}, {STRING_MAXSIZE, "Œ (¤® %lu Œ)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/cs-CZ.h b/reactos/base/setup/usetup/lang/cs-CZ.h index 79b4e78f7b8..319c8e026b1 100644 --- a/reactos/base/setup/usetup/lang/cs-CZ.h +++ b/reactos/base/setup/usetup/lang/cs-CZ.h @@ -1729,7 +1729,7 @@ MUI_STRING csCZStrings[] = {STRING_HDINFOPARTEXISTS, "na harddisku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Typ %-3u %6lu %s"}, + "%c%c %sTyp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) na %S"}, {STRING_HDDINFOUNK6, @@ -1737,7 +1737,7 @@ MUI_STRING csCZStrings[] = {STRING_NEWPARTITION, "Instalace vytvoýila novì odd¡l na"}, {STRING_UNPSPACE, - " M¡sto bez odd¡l… %6lu %s"}, + " %sM¡sto bez odd¡l…%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/de-DE.h b/reactos/base/setup/usetup/lang/de-DE.h index 3df2aa17968..c0a2703fb27 100644 --- a/reactos/base/setup/usetup/lang/de-DE.h +++ b/reactos/base/setup/usetup/lang/de-DE.h @@ -1723,7 +1723,7 @@ MUI_STRING deDEStrings[] = {STRING_HDINFOPARTEXISTS, "auf Festplatte %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Typ %-3u %6lu %s"}, + "%c%c %sTyp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Festplatte %lu (Port=%hu, Bus=%hu, Id=%hu) auf %S"}, {STRING_HDDINFOUNK6, @@ -1731,7 +1731,7 @@ MUI_STRING deDEStrings[] = {STRING_NEWPARTITION, "Setup erstellte eine neue Partition auf"}, {STRING_UNPSPACE, - " Unpartitionierter Speicher %6lu %s"}, + " %sUnpartitionierter Speicher%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/el-GR.h b/reactos/base/setup/usetup/lang/el-GR.h index 15c5dcbde38..790b375e606 100644 --- a/reactos/base/setup/usetup/lang/el-GR.h +++ b/reactos/base/setup/usetup/lang/el-GR.h @@ -1745,7 +1745,7 @@ MUI_STRING elGRStrings[] = {STRING_HDINFOPARTEXISTS, "©«¦ ©¡¢ž¨æ ›å©¡¦ %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s ‘¡¢ž¨æª ›å©¡¦ª %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1753,7 +1753,7 @@ MUI_STRING elGRStrings[] = {STRING_NEWPARTITION, "† œš¡˜«á©«˜©ž ›ž£ ¦ç¨šž©œ ⤘ ¤â¦ partition ©«¦"}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (£œš. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/en-US.h b/reactos/base/setup/usetup/lang/en-US.h index 10374175549..6788c36bfb2 100644 --- a/reactos/base/setup/usetup/lang/en-US.h +++ b/reactos/base/setup/usetup/lang/en-US.h @@ -1717,7 +1717,7 @@ MUI_STRING enUSStrings[] = {STRING_HDINFOPARTEXISTS, "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1725,7 +1725,7 @@ MUI_STRING enUSStrings[] = {STRING_NEWPARTITION, "Setup created a new partition on"}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/es-ES.h b/reactos/base/setup/usetup/lang/es-ES.h index 277304abee7..8d6dd1d6aa6 100644 --- a/reactos/base/setup/usetup/lang/es-ES.h +++ b/reactos/base/setup/usetup/lang/es-ES.h @@ -1727,7 +1727,7 @@ MUI_STRING esESStrings[] = {STRING_HDINFOPARTEXISTS, "en Disco duro %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tipo %-3u %6lu %s"}, + "%c%c %sTipo %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Disco duro %lu (Port=%hu, Bus=%hu, Id=%hu) en %S"}, {STRING_HDDINFOUNK6, @@ -1735,7 +1735,7 @@ MUI_STRING esESStrings[] = {STRING_NEWPARTITION, "El instalador a creado una nueva partici¢n en"}, {STRING_UNPSPACE, - " Espacio sin particionar %6lu %s"}, + " %sEspacio sin particionar%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/et-EE.h b/reactos/base/setup/usetup/lang/et-EE.h index f07a67cf78f..08666686476 100644 --- a/reactos/base/setup/usetup/lang/et-EE.h +++ b/reactos/base/setup/usetup/lang/et-EE.h @@ -1718,7 +1718,7 @@ MUI_STRING etEEStrings[] = {STRING_HDINFOPARTEXISTS, "Kävaketas %lu (%I64u %s), Port=%hu, Siin=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tp %-3u %6lu %s"}, + "%c%c %sTp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Kävaketas %lu (Port=%hu, Siin=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1726,7 +1726,7 @@ MUI_STRING etEEStrings[] = {STRING_NEWPARTITION, "Loodi uus partitsioon"}, {STRING_UNPSPACE, - " Kasutamata kettaruum %6lu %s"}, + " %sKasutamata kettaruum%s %6lu %s"}, {STRING_MAXSIZE, "MB (maks. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/fr-FR.h b/reactos/base/setup/usetup/lang/fr-FR.h index 9130cd1dde2..379815f3750 100644 --- a/reactos/base/setup/usetup/lang/fr-FR.h +++ b/reactos/base/setup/usetup/lang/fr-FR.h @@ -1731,7 +1731,7 @@ MUI_STRING frFRStrings[] = {STRING_HDINFOPARTEXISTS, "sur Disque dur %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Disque dur %lu (Port=%hu, Bus=%hu, Id=%hu) sur %S"}, {STRING_HDDINFOUNK6, @@ -1739,7 +1739,7 @@ MUI_STRING frFRStrings[] = {STRING_NEWPARTITION, "Setup a cr‚‚ une nouvelle partition sur"}, {STRING_UNPSPACE, - " Espace non partitionn‚ %6lu %s"}, + " %sEspace non partitionn‚%s %6lu %s"}, {STRING_MAXSIZE, "Mo (max. %lu Mo)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/he-IL.h b/reactos/base/setup/usetup/lang/he-IL.h index d3734c0a235..5279790ae76 100644 --- a/reactos/base/setup/usetup/lang/he-IL.h +++ b/reactos/base/setup/usetup/lang/he-IL.h @@ -1719,7 +1719,7 @@ MUI_STRING heILStrings[] = {STRING_HDINFOPARTEXISTS, "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1727,7 +1727,7 @@ MUI_STRING heILStrings[] = {STRING_NEWPARTITION, "Setup created a new partition on"}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/it-IT.h b/reactos/base/setup/usetup/lang/it-IT.h index 1561841e9a6..bb27717aac1 100644 --- a/reactos/base/setup/usetup/lang/it-IT.h +++ b/reactos/base/setup/usetup/lang/it-IT.h @@ -1722,7 +1722,7 @@ MUI_STRING itITStrings[] = {STRING_HDINFOPARTEXISTS, "su Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tipo %-3u %6lu %s"}, + "%c%c %sTipo %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) su %S"}, {STRING_HDDINFOUNK6, @@ -1730,7 +1730,7 @@ MUI_STRING itITStrings[] = {STRING_NEWPARTITION, "Setup ha creato una nuova partizione su"}, {STRING_UNPSPACE, - " Spazio non partizionato %6lu %s"}, + " %sSpazio non partizionato%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_UNFORMATTED, diff --git a/reactos/base/setup/usetup/lang/ja-JP.h b/reactos/base/setup/usetup/lang/ja-JP.h index 83685cdc1ee..d0842ba028e 100644 --- a/reactos/base/setup/usetup/lang/ja-JP.h +++ b/reactos/base/setup/usetup/lang/ja-JP.h @@ -1721,7 +1721,7 @@ MUI_STRING jaJPStrings[] = {STRING_HDINFOPARTEXISTS, "on ʰÄÞÃÞ¨½¸ %lu (%I64u %s), Îß°Ä=%hu, ÊÞ½=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c ¼­Ù² %-3u %6lu %s"}, + "%c%c %s¼­Ù² %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s ʰÄÞÃÞ¨½¸ %lu (Îß°Ä=%hu, ÊÞ½=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1729,7 +1729,7 @@ MUI_STRING jaJPStrings[] = {STRING_NEWPARTITION, "¾¯Ä±¯ÌßÊ ±À×¼² Ê߰輮ݦ Â·ÞÆ »¸¾²¼Ï¼À:"}, {STRING_UNPSPACE, - " ÐÌÞݶÂÉ ½Íß°½ %6lu %s"}, + " %sÐÌÞݶÂÉ ½Íß°½%s %6lu %s"}, {STRING_MAXSIZE, "MB (»²ÀÞ². %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/lt-LT.h b/reactos/base/setup/usetup/lang/lt-LT.h index a02554a5186..b2bbf911100 100644 --- a/reactos/base/setup/usetup/lang/lt-LT.h +++ b/reactos/base/setup/usetup/lang/lt-LT.h @@ -1728,7 +1728,7 @@ MUI_STRING ltLTStrings[] = {STRING_HDINFOPARTEXISTS, "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1736,7 +1736,7 @@ MUI_STRING ltLTStrings[] = {STRING_NEWPARTITION, "Setup created a new partition on"}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/nl-NL.h b/reactos/base/setup/usetup/lang/nl-NL.h index 011111d13d0..47ac10dd4da 100644 --- a/reactos/base/setup/usetup/lang/nl-NL.h +++ b/reactos/base/setup/usetup/lang/nl-NL.h @@ -1766,7 +1766,7 @@ MUI_STRING nlNLStrings[] = {STRING_HDINFOPARTEXISTS, "op Schijf %lu (%I64u %s), Poort=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Schijf %lu (Poort=%hu, Bus=%hu, Id=%hu) op %S"}, {STRING_HDDINFOUNK6, @@ -1774,7 +1774,7 @@ MUI_STRING nlNLStrings[] = {STRING_NEWPARTITION, "Setup heeft een nieuwe partitie aangemaakt op"}, {STRING_UNPSPACE, - " Niet gepartitioneerde ruimte %6lu %s"}, + " %sNiet gepartitioneerde ruimte%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/pl-PL.h b/reactos/base/setup/usetup/lang/pl-PL.h index 6ab8e361e8e..f03915b3bc2 100644 --- a/reactos/base/setup/usetup/lang/pl-PL.h +++ b/reactos/base/setup/usetup/lang/pl-PL.h @@ -1730,7 +1730,7 @@ MUI_STRING plPLStrings[] = {STRING_HDINFOPARTEXISTS, "na Dysku Twardym %lu (%I64u %s), Port=%hu, Szyna=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c 09Typ %-3u %6lu %s"}, + "%c%c %s09Typ %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Dysk Twardy %lu (Port=%hu, Szyna=%hu, Id=%hu) na %S"}, {STRING_HDDINFOUNK6, @@ -1738,7 +1738,7 @@ MUI_STRING plPLStrings[] = {STRING_NEWPARTITION, "Instalator utworzyˆ now¥ partycj©"}, {STRING_UNPSPACE, - " Miejsce poza partycjami %6lu %s"}, + " %sMiejsce poza partycjami%s %6lu %s"}, {STRING_MAXSIZE, "MB (maks. %lu MB)"}, {STRING_UNFORMATTED, diff --git a/reactos/base/setup/usetup/lang/pt-BR.h b/reactos/base/setup/usetup/lang/pt-BR.h index 2837b8526f2..e4839862082 100644 --- a/reactos/base/setup/usetup/lang/pt-BR.h +++ b/reactos/base/setup/usetup/lang/pt-BR.h @@ -1757,7 +1757,7 @@ MUI_STRING ptBRStrings[] = {STRING_HDINFOPARTEXISTS, "em Disco %lu (%I64u %s), Porta=%hu, Barramento=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tipo %-3u %6lu %s"}, + "%c%c %sTipo %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Disco %lu (Porta=%hu, Barramento=%hu, Id=%hu) em %S"}, {STRING_HDDINFOUNK6, @@ -1765,7 +1765,7 @@ MUI_STRING ptBRStrings[] = {STRING_NEWPARTITION, "O instalador criou uma nova parti‡Æo em"}, {STRING_UNPSPACE, - " Espa‡o nÆo particionado %6lu %s"}, + " %sEspa‡o nÆo particionado%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/ro-RO.h b/reactos/base/setup/usetup/lang/ro-RO.h index b4973c86532..ac0a0f50ccf 100644 --- a/reactos/base/setup/usetup/lang/ro-RO.h +++ b/reactos/base/setup/usetup/lang/ro-RO.h @@ -1798,7 +1798,7 @@ MUI_STRING roROStrings[] = {STRING_HDINFOPARTEXISTS, "de pe Discul %lu (%I64u %s), Port=%hu, Magistrala=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tip %-3u %6lu %s"}, + "%c%c %sTip %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Discul %lu (Port=%hu, Magistrala=%hu, Id=%hu) de tip %S"}, {STRING_HDDINFOUNK6, @@ -1806,7 +1806,7 @@ MUI_STRING roROStrings[] = {STRING_NEWPARTITION, "O nouÇ partiîie a fost creatÇ Œn"}, {STRING_UNPSPACE, - " Spaîiu nepartiîionat %6lu %s"}, + " %sSpaîiu nepartiîionat%s %6lu %s"}, {STRING_MAXSIZE, "Mo (max. %lu Mo)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/ru-RU.h b/reactos/base/setup/usetup/lang/ru-RU.h index c5376f6f8aa..4a0c38a4b50 100644 --- a/reactos/base/setup/usetup/lang/ru-RU.h +++ b/reactos/base/setup/usetup/lang/ru-RU.h @@ -1722,7 +1722,7 @@ MUI_STRING ruRUStrings[] = {STRING_HDINFOPARTEXISTS, "­  ¦¥á⪮¬ ¤¨áª¥ %lu (%I64u %s), ®àâ=%hu, ˜¨­ =%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c ‡ ¯¨áì %-3u %6lu %s"}, + "%c%c %s‡ ¯¨áì %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s †¥á⪨© ¤¨áª %lu (®àâ=%hu, ˜¨­ =%hu, Id=%hu) ­  %S"}, {STRING_HDDINFOUNK6, @@ -1730,7 +1730,7 @@ MUI_STRING ruRUStrings[] = {STRING_NEWPARTITION, "ணࠬ¬  ãáâ ­®¢ª¨ á®§¤ «  ­®¢ë© à §¤¥« ­ :"}, {STRING_UNPSPACE, - " ¥à §¬¥ç¥­­®¥ ¯à®áâà ­á⢮ %6lu %s"}, + " %s¥à §¬¥ç¥­­®¥ ¯à®áâà ­á⢮%s %6lu %s"}, {STRING_MAXSIZE, "Œ (¬ ªá. %lu Œ)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/sk-SK.h b/reactos/base/setup/usetup/lang/sk-SK.h index 5ea527a917f..4572b00ae41 100644 --- a/reactos/base/setup/usetup/lang/sk-SK.h +++ b/reactos/base/setup/usetup/lang/sk-SK.h @@ -1732,7 +1732,7 @@ MUI_STRING skSKStrings[] = {STRING_HDINFOPARTEXISTS, "na pevnom disku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c typ %-3u %6lu %s"}, + "%c%c %styp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s pevnì disk %lu (Port=%hu, Bus=%hu, Id=%hu) na %S"}, {STRING_HDDINFOUNK6, @@ -1740,7 +1740,7 @@ MUI_STRING skSKStrings[] = {STRING_NEWPARTITION, "Inçtal tor vytvoril nov£ oblasœ na"}, {STRING_UNPSPACE, - " Miesto bez oblast¡ %6lu %s"}, + " %sMiesto bez oblast¡%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/sq-AL.h b/reactos/base/setup/usetup/lang/sq-AL.h index de67d4a7a22..e746fb25a97 100644 --- a/reactos/base/setup/usetup/lang/sq-AL.h +++ b/reactos/base/setup/usetup/lang/sq-AL.h @@ -1724,7 +1724,7 @@ MUI_STRING sqALStrings[] = {STRING_HDINFOPARTEXISTS, "on Harddisku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tipi %-3u %6lu %s"}, + "%c%c %sTipi %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisku %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1732,7 +1732,7 @@ MUI_STRING sqALStrings[] = {STRING_NEWPARTITION, "Instalimi krijoj nj‰ particion t‰ ri n‰"}, {STRING_UNPSPACE, - " Hap‰sire e papjesesezuar %6lu %s"}, + " %sHap‰sire e papjesesezuar%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/sv-SE.h b/reactos/base/setup/usetup/lang/sv-SE.h index fdb6377365d..7559e6c4cdd 100644 --- a/reactos/base/setup/usetup/lang/sv-SE.h +++ b/reactos/base/setup/usetup/lang/sv-SE.h @@ -1727,7 +1727,7 @@ MUI_STRING svSEStrings[] = {STRING_HDINFOPARTEXISTS, "p† H†rddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Typ %-3u %6lu %s"}, + "%c%c %sTyp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s H†rddisk %lu (Port=%hu, Bus=%hu, Id=%hu) p† %S"}, {STRING_HDDINFOUNK6, @@ -1735,7 +1735,7 @@ MUI_STRING svSEStrings[] = {STRING_NEWPARTITION, "Setup skapade en ny partition p†"}, {STRING_UNPSPACE, - " Opartitionerat utrymme %6lu %s"}, + " %sOpartitionerat utrymme%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/tr-TR.h b/reactos/base/setup/usetup/lang/tr-TR.h index 2afd98af27d..bb86584510d 100644 --- a/reactos/base/setup/usetup/lang/tr-TR.h +++ b/reactos/base/setup/usetup/lang/tr-TR.h @@ -1695,7 +1695,7 @@ MUI_STRING trTRStrings[] = {STRING_HDINFOPARTEXISTS, "šzerinde: Disk %lu (%I64u %s), GiriŸ=%hu, Veri Yolu=%hu, Kimlik=%hu, %wZ zerinde."}, {STRING_HDDINFOUNK5, - "%c%c Tr %-3u %6lu %s"}, + "%c%c %sTr %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Disk %lu (GiriŸ=%hu, Veri Yolu=%hu, Kimlik=%hu), %S zerinde"}, {STRING_HDDINFOUNK6, @@ -1703,7 +1703,7 @@ MUI_STRING trTRStrings[] = {STRING_NEWPARTITION, "Kur, Ÿu b”lm oluŸturdu:"}, {STRING_UNPSPACE, - " Kullanlmayan BoŸluk %6lu %s"}, + " %sKullanlmayan BoŸluk%s %6lu %s"}, {STRING_MAXSIZE, "MB (En ‡ok %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/lang/uk-UA.h b/reactos/base/setup/usetup/lang/uk-UA.h index a3b39c23e77..93c68772985 100644 --- a/reactos/base/setup/usetup/lang/uk-UA.h +++ b/reactos/base/setup/usetup/lang/uk-UA.h @@ -1727,7 +1727,7 @@ MUI_STRING ukUAStrings[] = {STRING_HDINFOPARTEXISTS, "­  †®àá⪮¬ã ¤¨áªã %lu (%I64u %s), ®àâ=%hu, ˜¨­ =%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s †®àá⪨© ¤¨áª %lu (®àâ=%hu, ˜¨­ =%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1735,7 +1735,7 @@ MUI_STRING ukUAStrings[] = {STRING_NEWPARTITION, "‚áâ ­®¢«î¢ ç á⢮ਢ ­®¢¨© à®§¤i« ­ "}, {STRING_UNPSPACE, - " ¥à®§¬i祭  ®¡« áâì %6lu %s"}, + " %s¥à®§¬i祭  ®¡« áâì%s %6lu %s"}, {STRING_MAXSIZE, "MB (¬ ªá. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index 70c606027b9..eef02c1f367 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -520,15 +520,18 @@ EnumerateBiosDiskEntries( static VOID -AddPrimaryPartitionToDisk( +AddPartitionToDisk( ULONG DiskNumber, PDISKENTRY DiskEntry, - ULONG PartitionIndex) + ULONG PartitionIndex, + BOOLEAN ExtendedPartition) { PPARTITION_INFORMATION PartitionInfo; PPARTENTRY PartEntry; PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[PartitionIndex]; + if (PartitionInfo->PartitionType == 0) + return; PartEntry = RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, @@ -545,6 +548,7 @@ AddPrimaryPartitionToDisk( PartEntry->PartitionType = PartitionInfo->PartitionType; PartEntry->HiddenSectors = PartitionInfo->HiddenSectors; + PartEntry->ExtendedPartition = ExtendedPartition; PartEntry->IsPartitioned = TRUE; PartEntry->PartitionNumber = PartitionInfo->PartitionNumber; PartEntry->PartitionIndex = PartitionIndex; @@ -609,8 +613,12 @@ AddPrimaryPartitionToDisk( PartEntry->FormatState = UnknownFormat; } - InsertTailList(&DiskEntry->PrimaryPartListHead, - &PartEntry->ListEntry); + if (ExtendedPartition) + InsertTailList(&DiskEntry->ExtendedPartListHead, + &PartEntry->ListEntry); + else + InsertTailList(&DiskEntry->PrimaryPartListHead, + &PartEntry->ListEntry); } @@ -1055,24 +1063,18 @@ AddDiskToList( { for (i = 0; i < 4; i++) { - if (DiskEntry->LayoutBuffer->PartitionEntry[i].PartitionType != 0) - { - AddPrimaryPartitionToDisk(DiskNumber, - DiskEntry, - i); - } + AddPartitionToDisk(DiskNumber, + DiskEntry, + i, + FALSE); } - for (i = 4; i < DiskEntry->LayoutBuffer->PartitionCount; i++) + for (i = 4; i < DiskEntry->LayoutBuffer->PartitionCount; i += 4) { - if (DiskEntry->LayoutBuffer->PartitionEntry[i].PartitionType != 0) - { -#if 0 - AddExtendedPartitionToDisk(DiskNumber, - DiskEntry, - i); -#endif - } + AddPartitionToDisk(DiskNumber, + DiskEntry, + i, + TRUE); } } } @@ -1340,6 +1342,8 @@ PrintPartitionData( sprintf(LineBuffer, MUIGetString(STRING_UNPSPACE), + PartEntry->ExtendedPartition ? " " : "", + PartEntry->ExtendedPartition ? "" : " ", PartSize.u.LowPart, Unit); } @@ -1406,17 +1410,21 @@ PrintPartitionData( MUIGetString(STRING_HDDINFOUNK5), (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, (PartEntry->DriveLetter == 0) ? '-' : ':', + PartEntry->ExtendedPartition ? " " : "", PartEntry->PartitionType, + PartEntry->ExtendedPartition ? "" : " ", PartSize.u.LowPart, Unit); } else { sprintf(LineBuffer, - "%c%c %-24s %6lu %s", + "%c%c %s%-24s%s %6lu %s", (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, (PartEntry->DriveLetter == 0) ? '-' : ':', + PartEntry->ExtendedPartition ? " " : "", PartType, + PartEntry->ExtendedPartition ? "" : " ", PartSize.u.LowPart, Unit); } @@ -1466,8 +1474,8 @@ PrintDiskData( PPARTLIST List, PDISKENTRY DiskEntry) { - PPARTENTRY PartEntry; - PLIST_ENTRY Entry; + PPARTENTRY PrimaryPartEntry, ExtendedPartEntry; + PLIST_ENTRY PrimaryEntry, ExtendedEntry; CHAR LineBuffer[128]; COORD coPos; DWORD Written; @@ -1551,16 +1559,31 @@ PrintDiskData( PrintEmptyLine(List); /* Print partition lines*/ - Entry = DiskEntry->PrimaryPartListHead.Flink; - while (Entry != &DiskEntry->PrimaryPartListHead) + PrimaryEntry = DiskEntry->PrimaryPartListHead.Flink; + while (PrimaryEntry != &DiskEntry->PrimaryPartListHead) { - PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + PrimaryPartEntry = CONTAINING_RECORD(PrimaryEntry, PARTENTRY, ListEntry); PrintPartitionData(List, DiskEntry, - PartEntry); + PrimaryPartEntry); - Entry = Entry->Flink; + if (IsContainerPartition(PrimaryPartEntry->PartitionType)) + { + ExtendedEntry = DiskEntry->ExtendedPartListHead.Flink; + while (ExtendedEntry != &DiskEntry->ExtendedPartListHead) + { + ExtendedPartEntry = CONTAINING_RECORD(ExtendedEntry, PARTENTRY, ListEntry); + + PrintPartitionData(List, + DiskEntry, + ExtendedPartEntry); + + ExtendedEntry = ExtendedEntry->Flink; + } + } + + PrimaryEntry = PrimaryEntry->Flink; } /* Print separator line */ diff --git a/reactos/base/setup/usetup/partlist.h b/reactos/base/setup/usetup/partlist.h index 7d092044c2d..40022f4b800 100644 --- a/reactos/base/setup/usetup/partlist.h +++ b/reactos/base/setup/usetup/partlist.h @@ -57,6 +57,8 @@ typedef struct _PARTENTRY CHAR VolumeLabel[17]; CHAR FileSystemName[9]; + BOOLEAN ExtendedPartition; + /* Partition is partitioned disk space */ BOOLEAN IsPartitioned; From 16a52a9e08f037897ad431370966ee2e5bc279a2 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Thu, 22 May 2014 09:33:29 +0000 Subject: [PATCH 47/69] [WIN32K] - make DIB_XXBPP_StretchBlt work with top down bitmaps - fixes missing icons in the taskbar in explorer new (32bpp) svn path=/trunk/; revision=63404 --- reactos/win32ss/gdi/dib/stretchblt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/gdi/dib/stretchblt.c b/reactos/win32ss/gdi/dib/stretchblt.c index f8272aadb58..55f80575942 100644 --- a/reactos/win32ss/gdi/dib/stretchblt.c +++ b/reactos/win32ss/gdi/dib/stretchblt.c @@ -29,6 +29,8 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma LONG DstWidth; LONG SrcHeight; LONG SrcWidth; + LONG MaskCy; + LONG SourceCy; ULONG Color; ULONG Dest, Source = 0, Pattern = 0; @@ -56,6 +58,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma if (UsesSource) { + SourceCy = abs(SourceSurf->sizlBitmap.cy); fnSource_GetPixel = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat].DIB_GetPixel; DPRINT("Source BPP: %u, srcRect: (%d,%d)-(%d,%d)\n", BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom); @@ -64,6 +67,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma if (MaskSurf) { fnMask_GetPixel = DibFunctionsForBitmapFormat[MaskSurf->iBitmapFormat].DIB_GetPixel; + MaskCy = abs(MaskSurf->sizlBitmap.cy); } DstHeight = DestRect->bottom - DestRect->top; @@ -124,7 +128,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma { sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth; if (sx < 0 || sy < 0 || - MaskSurf->sizlBitmap.cx < sx || MaskSurf->sizlBitmap.cy < sy || + MaskSurf->sizlBitmap.cx < sx || MaskCy < sy || fnMask_GetPixel(MaskSurf, sx, sy) != 0) { CanDraw = FALSE; @@ -135,7 +139,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma { sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth; if (sx >= 0 && sy >= 0 && - SourceSurf->sizlBitmap.cx > sx && SourceSurf->sizlBitmap.cy > sy) + SourceSurf->sizlBitmap.cx > sx && SourceCy > sy) { Source = XLATEOBJ_iXlate(ColorTranslation, fnSource_GetPixel(SourceSurf, sx, sy)); } From bbbef82de905b495512f3371764f759a996c8eca Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 22 May 2014 10:08:44 +0000 Subject: [PATCH 48/69] [NTOSKRNL] - Do not align the size of a memory area to the allocation granularity, but to PAGE_SIZE. Fixes OllyDbg regression from r61108. CORE-8168 #resolve - Clarify the size calculation in MmCreateMemoryArea - Silence a few DPRINTs svn path=/trunk/; revision=63405 --- reactos/ntoskrnl/mm/ARM3/miarm.h | 4 ++-- reactos/ntoskrnl/mm/ARM3/virtual.c | 8 ++++---- reactos/ntoskrnl/mm/marea.c | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/miarm.h b/reactos/ntoskrnl/mm/ARM3/miarm.h index d1cfbb4a24d..6e803aeb7d0 100644 --- a/reactos/ntoskrnl/mm/ARM3/miarm.h +++ b/reactos/ntoskrnl/mm/ARM3/miarm.h @@ -1100,11 +1100,11 @@ MI_WS_OWNER(IN PEPROCESS Process) /* Check if this process is the owner, and that the thread owns the WS */ if (PsGetCurrentThread()->OwnsProcessWorkingSetExclusive == 0) { - DPRINT1("Thread: %p is not an owner\n", PsGetCurrentThread()); + DPRINT("Thread: %p is not an owner\n", PsGetCurrentThread()); } if (KeGetCurrentThread()->ApcState.Process != &Process->Pcb) { - DPRINT1("Current thread %p is attached to another process %p\n", PsGetCurrentThread(), Process); + DPRINT("Current thread %p is attached to another process %p\n", PsGetCurrentThread(), Process); } return ((KeGetCurrentThread()->ApcState.Process == &Process->Pcb) && ((PsGetCurrentThread()->OwnsProcessWorkingSetExclusive) || diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index 3eef793fcd9..f82aedb9c9f 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -1291,10 +1291,10 @@ MiGetPageProtection(IN PMMPTE PointerPte) } /* This is software PTE */ - DPRINT1("Prototype PTE: %lx %p\n", TempPte.u.Hard.PageFrameNumber, Pfn); - DPRINT1("VA: %p\n", MiPteToAddress(&TempPte)); - DPRINT1("Mask: %lx\n", TempPte.u.Soft.Protection); - DPRINT1("Mask2: %lx\n", Pfn->OriginalPte.u.Soft.Protection); + DPRINT("Prototype PTE: %lx %p\n", TempPte.u.Hard.PageFrameNumber, Pfn); + DPRINT("VA: %p\n", MiPteToAddress(&TempPte)); + DPRINT("Mask: %lx\n", TempPte.u.Soft.Protection); + DPRINT("Mask2: %lx\n", Pfn->OriginalPte.u.Soft.Protection); return MmProtectToValue[TempPte.u.Soft.Protection]; } diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 5deec1abb9b..6ea4db48075 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -988,6 +988,7 @@ MmCreateMemoryArea(PMMSUPPORT AddressSpace, { ULONG_PTR tmpLength; PMEMORY_AREA MemoryArea; + ULONG_PTR EndingAddress; DPRINT("MmCreateMemoryArea(Type 0x%lx, BaseAddress %p, " "*BaseAddress %p, Length %p, AllocationFlags %x, " @@ -997,7 +998,7 @@ MmCreateMemoryArea(PMMSUPPORT AddressSpace, if ((*BaseAddress) == 0 && !FixedAddress) { - tmpLength = (ULONG_PTR)MM_ROUND_UP(Length, Granularity); + tmpLength = (ULONG_PTR)MM_ROUND_UP(Length, PAGE_SIZE); *BaseAddress = MmFindGap(AddressSpace, tmpLength, Granularity, @@ -1010,10 +1011,9 @@ MmCreateMemoryArea(PMMSUPPORT AddressSpace, } else { - tmpLength = Length + ((ULONG_PTR) *BaseAddress - - (ULONG_PTR) MM_ROUND_DOWN(*BaseAddress, Granularity)); - tmpLength = (ULONG_PTR)MM_ROUND_UP(tmpLength, Granularity); - *BaseAddress = MM_ROUND_DOWN(*BaseAddress, Granularity); + EndingAddress = ((ULONG_PTR)*BaseAddress + Length - 1) | (PAGE_SIZE - 1); + *BaseAddress = ALIGN_DOWN_POINTER_BY(*BaseAddress, Granularity); + tmpLength = EndingAddress + 1 - (ULONG_PTR)*BaseAddress; if (!MmGetAddressSpaceOwner(AddressSpace) && *BaseAddress < MmSystemRangeStart) { From 3369bd4f94ce90ce90dfedf7889be488d0308541 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 22 May 2014 10:18:22 +0000 Subject: [PATCH 49/69] =?UTF-8?q?[NTOSKRNL]=20Pass=20process=20id=20to=20D?= =?UTF-8?q?bgUnLoadImageSymbols=20instead=20of=20ZwCurrentProcess()=20or?= =?UTF-8?q?=20a=20PEPROCESS.=20Patch=20by=20J=C3=A9r=C3=B4me=20Gardou=20=20CORE-8253=20#resolve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=63406 --- reactos/ntoskrnl/ex/init.c | 2 +- reactos/ntoskrnl/kd64/kdinit.c | 2 +- reactos/ntoskrnl/mm/ARM3/section.c | 2 +- reactos/ntoskrnl/mm/ARM3/sysldr.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 1d5b644247f..04f8e785d10 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -846,7 +846,7 @@ ExpLoadBootSymbols(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Load the symbols */ DbgLoadImageSymbols(&SymbolString, LdrEntry->DllBase, - (ULONG_PTR)ZwCurrentProcess()); + (ULONG_PTR)PsGetCurrentProcessId()); } } diff --git a/reactos/ntoskrnl/kd64/kdinit.c b/reactos/ntoskrnl/kd64/kdinit.c index 723a18ca323..18ea337ee36 100644 --- a/reactos/ntoskrnl/kd64/kdinit.c +++ b/reactos/ntoskrnl/kd64/kdinit.c @@ -356,7 +356,7 @@ KdInitSystem(IN ULONG BootPhase, RtlInitString(&ImageName, NameBuffer); DbgLoadImageSymbols(&ImageName, LdrEntry->DllBase, - (ULONG_PTR)ZwCurrentProcess()); + (ULONG_PTR)PsGetCurrentProcessId()); /* Go to the next entry */ NextEntry = NextEntry->Flink; diff --git a/reactos/ntoskrnl/mm/ARM3/section.c b/reactos/ntoskrnl/mm/ARM3/section.c index 43274f93614..f8ae660db29 100644 --- a/reactos/ntoskrnl/mm/ARM3/section.c +++ b/reactos/ntoskrnl/mm/ARM3/section.c @@ -1185,7 +1185,7 @@ MiLoadUserSymbols(IN PCONTROL_AREA ControlArea, Status = RtlUnicodeStringToAnsiString(&FileNameA, FileName, TRUE); if (NT_SUCCESS(Status)) { - DbgLoadImageSymbols(&FileNameA, BaseAddress, (ULONG_PTR)Process); + DbgLoadImageSymbols(&FileNameA, BaseAddress, (ULONG_PTR)Process->UniqueProcessId); RtlFreeAnsiString(&FileNameA); } } diff --git a/reactos/ntoskrnl/mm/ARM3/sysldr.c b/reactos/ntoskrnl/mm/ARM3/sysldr.c index 3175b0330cb..de123958b22 100644 --- a/reactos/ntoskrnl/mm/ARM3/sysldr.c +++ b/reactos/ntoskrnl/mm/ARM3/sysldr.c @@ -928,7 +928,7 @@ MmUnloadSystemImage(IN PVOID ImageHandle) /* Unload the symbols */ DbgUnLoadImageSymbols(&TempName, BaseAddress, - (ULONG_PTR)ZwCurrentProcess()); + (ULONG_PTR)PsGetCurrentProcessId()); RtlFreeAnsiString(&TempName); } } @@ -3309,7 +3309,7 @@ LoaderScan: /* Notify the debugger */ DbgLoadImageSymbols(&AnsiTemp, LdrEntry->DllBase, - (ULONG_PTR)ZwCurrentProcess()); + (ULONG_PTR)PsGetCurrentProcessId()); LdrEntry->Flags |= LDRP_DEBUG_SYMBOLS_LOADED; } From c52bfa77a861f57c558d296076222089e77f05a6 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 22 May 2014 11:42:45 +0000 Subject: [PATCH 50/69] [MSVCRT] * Don't export wcstombs_s(). CORE-8174 svn path=/trunk/; revision=63407 --- reactos/dll/win32/msvcrt/msvcrt.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/dll/win32/msvcrt/msvcrt.spec b/reactos/dll/win32/msvcrt/msvcrt.spec index 2008a214d26..4212aac86e7 100644 --- a/reactos/dll/win32/msvcrt/msvcrt.spec +++ b/reactos/dll/win32/msvcrt/msvcrt.spec @@ -1439,7 +1439,6 @@ @ cdecl wcstok_s(ptr wstr ptr) @ cdecl wcstol(wstr ptr long) @ cdecl wcstombs(ptr ptr long) -@ cdecl wcstombs_s(ptr ptr long wstr long) @ cdecl wcstoul(wstr ptr long) @ cdecl wcsxfrm(ptr wstr long) # stub wctob From 02851fb0e2f73daa2952fc6e51af5fc3d7f8ea99 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 22 May 2014 11:45:53 +0000 Subject: [PATCH 51/69] [WIN32K] Make all GDI object cleanup functions return VOID instead of BOOL. CORE-6870 #resolve svn path=/trunk/; revision=63408 --- reactos/win32ss/gdi/eng/driverobj.c | 9 +-- reactos/win32ss/gdi/eng/driverobj.h | 2 +- reactos/win32ss/gdi/eng/surface.c | 6 +- reactos/win32ss/gdi/eng/surface.h | 4 +- reactos/win32ss/gdi/ntgdi/brush.c | 6 +- reactos/win32ss/gdi/ntgdi/brush.h | 2 +- reactos/win32ss/gdi/ntgdi/dc.h | 2 +- reactos/win32ss/gdi/ntgdi/dclife.c | 6 +- reactos/win32ss/gdi/ntgdi/gdiobj.c | 73 ++++++++++--------- reactos/win32ss/gdi/ntgdi/gdiobj.h | 2 +- reactos/win32ss/gdi/ntgdi/palette.c | 20 +++-- reactos/win32ss/gdi/ntgdi/palette.h | 4 +- reactos/win32ss/gdi/ntgdi/region.c | 5 +- reactos/win32ss/gdi/ntgdi/region.h | 2 +- reactos/win32ss/user/user32/windows/mdi.c | 24 +++--- reactos/win32ss/user/user32/windows/message.c | 28 +++---- 16 files changed, 93 insertions(+), 102 deletions(-) diff --git a/reactos/win32ss/gdi/eng/driverobj.c b/reactos/win32ss/gdi/eng/driverobj.c index db2e8e3e39a..fff1ddad1b9 100644 --- a/reactos/win32ss/gdi/eng/driverobj.c +++ b/reactos/win32ss/gdi/eng/driverobj.c @@ -19,8 +19,9 @@ /*! * \brief DRIVEROBJ cleanup function */ -BOOL NTAPI -DRIVEROBJ_Cleanup(PVOID pObject) +VOID +NTAPI +DRIVEROBJ_vCleanup(PVOID pObject) { PEDRIVEROBJ pedo = pObject; FREEOBJPROC pFreeProc; @@ -28,10 +29,8 @@ DRIVEROBJ_Cleanup(PVOID pObject) pFreeProc = pedo->drvobj.pFreeProc; if (pFreeProc) { - return pFreeProc(pedo->drvobj.pvObj); + NT_VERIFY(pFreeProc(pedo->drvobj.pvObj)); } - - return TRUE; } /** Public interface **********************************************************/ diff --git a/reactos/win32ss/gdi/eng/driverobj.h b/reactos/win32ss/gdi/eng/driverobj.h index 25961e461ad..254a0cfec30 100644 --- a/reactos/win32ss/gdi/eng/driverobj.h +++ b/reactos/win32ss/gdi/eng/driverobj.h @@ -11,7 +11,7 @@ typedef struct _EDRIVEROBJ typedef DRIVEROBJ *PDRIVEROBJ; /* Cleanup function */ -BOOL NTAPI DRIVEROBJ_Cleanup(PVOID pObject); +VOID NTAPI DRIVEROBJ_vCleanup(PVOID pObject); #define DRIVEROBJ_AllocObjectWithHandle() ((PEDRIVEROBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_DRIVEROBJ, sizeof(EDRIVEROBJ))) diff --git a/reactos/win32ss/gdi/eng/surface.c b/reactos/win32ss/gdi/eng/surface.c index 364fa226e9c..4f34a616898 100644 --- a/reactos/win32ss/gdi/eng/surface.c +++ b/reactos/win32ss/gdi/eng/surface.c @@ -62,9 +62,9 @@ BitmapFormat(ULONG cBits, ULONG iCompression) } } -BOOL +VOID NTAPI -SURFACE_Cleanup(PVOID ObjectBody) +SURFACE_vCleanup(PVOID ObjectBody) { PSURFACE psurf = (PSURFACE)ObjectBody; PVOID pvBits = psurf->SurfObj.pvBits; @@ -108,8 +108,6 @@ SURFACE_Cleanup(PVOID ObjectBody) { PALETTE_ShareUnlockPalette(psurf->ppal); } - - return TRUE; } diff --git a/reactos/win32ss/gdi/eng/surface.h b/reactos/win32ss/gdi/eng/surface.h index 2ab6037f947..99c70e723c8 100644 --- a/reactos/win32ss/gdi/eng/surface.h +++ b/reactos/win32ss/gdi/eng/surface.h @@ -111,9 +111,9 @@ ULONG FASTCALL BitmapFormat(ULONG cBits, ULONG iCompression); -BOOL +VOID NTAPI -SURFACE_Cleanup(PVOID ObjectBody); +SURFACE_vCleanup(PVOID ObjectBody); PSURFACE NTAPI diff --git a/reactos/win32ss/gdi/ntgdi/brush.c b/reactos/win32ss/gdi/ntgdi/brush.c index ec40791e08e..b079a288046 100644 --- a/reactos/win32ss/gdi/ntgdi/brush.c +++ b/reactos/win32ss/gdi/ntgdi/brush.c @@ -114,9 +114,9 @@ BRUSH_vFreeBrushAttr(PBRUSH pbr) pbr->pBrushAttr = &pbr->BrushAttr; } -BOOL +VOID NTAPI -BRUSH_Cleanup(PVOID ObjectBody) +BRUSH_vCleanup(PVOID ObjectBody) { PBRUSH pbrush = (PBRUSH)ObjectBody; if (pbrush->hbmPattern) @@ -136,8 +136,6 @@ BRUSH_Cleanup(PVOID ObjectBody) { ExFreePool(pbrush->pStyle); } - - return TRUE; } INT diff --git a/reactos/win32ss/gdi/ntgdi/brush.h b/reactos/win32ss/gdi/ntgdi/brush.h index 79a2e0edf83..fe6cf34082c 100644 --- a/reactos/win32ss/gdi/ntgdi/brush.h +++ b/reactos/win32ss/gdi/ntgdi/brush.h @@ -94,7 +94,7 @@ typedef struct _EBRUSHOBJ #define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush) INT FASTCALL BRUSH_GetObject (PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer); -BOOL NTAPI BRUSH_Cleanup(PVOID ObjectBody); +VOID NTAPI BRUSH_vCleanup(PVOID ObjectBody); extern HSURF gahsurfHatch[HS_DDI_MAX]; diff --git a/reactos/win32ss/gdi/ntgdi/dc.h b/reactos/win32ss/gdi/ntgdi/dc.h index a1a11701cf9..a65e7a3d64c 100644 --- a/reactos/win32ss/gdi/ntgdi/dc.h +++ b/reactos/win32ss/gdi/ntgdi/dc.h @@ -194,7 +194,7 @@ INIT_FUNCTION NTSTATUS NTAPI InitDcImpl(VOID); PPDEVOBJ FASTCALL IntEnumHDev(VOID); PDC NTAPI DC_AllocDcWithHandle(VOID); BOOL NTAPI DC_bAllocDcAttr(PDC pdc); -BOOL NTAPI DC_Cleanup(PVOID ObjectBody); +VOID NTAPI DC_vCleanup(PVOID ObjectBody); BOOL FASTCALL IntGdiDeleteDC(HDC, BOOL); BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest); diff --git a/reactos/win32ss/gdi/ntgdi/dclife.c b/reactos/win32ss/gdi/ntgdi/dclife.c index 16a628a4998..3a8a35954db 100644 --- a/reactos/win32ss/gdi/ntgdi/dclife.c +++ b/reactos/win32ss/gdi/ntgdi/dclife.c @@ -344,9 +344,9 @@ DC_vInitDc( } } -BOOL +VOID NTAPI -DC_Cleanup(PVOID ObjectBody) +DC_vCleanup(PVOID ObjectBody) { PDC pdc = (PDC)ObjectBody; @@ -391,8 +391,6 @@ DC_Cleanup(PVOID ObjectBody) SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface); PDEVOBJ_vRelease(pdc->ppdev) ; - - return TRUE; } VOID diff --git a/reactos/win32ss/gdi/ntgdi/gdiobj.c b/reactos/win32ss/gdi/ntgdi/gdiobj.c index 2958a186dd5..2273dfda8f8 100644 --- a/reactos/win32ss/gdi/ntgdi/gdiobj.c +++ b/reactos/win32ss/gdi/ntgdi/gdiobj.c @@ -87,53 +87,54 @@ ULONG gulFirstFree; ULONG gulFirstUnused; static PPAGED_LOOKASIDE_LIST gpaLookasideList; -static BOOL NTAPI GDIOBJ_Cleanup(PVOID ObjectBody); +static VOID NTAPI GDIOBJ_vCleanup(PVOID ObjectBody); static const GDICLEANUPPROC apfnCleanup[] = { - NULL, /* 00 GDIObjType_DEF_TYPE */ - DC_Cleanup, /* 01 GDIObjType_DC_TYPE */ - NULL, /* 02 GDIObjType_UNUSED1_TYPE */ - NULL, /* 03 GDIObjType_UNUSED2_TYPE */ - REGION_Cleanup, /* 04 GDIObjType_RGN_TYPE */ - SURFACE_Cleanup, /* 05 GDIObjType_SURF_TYPE */ - GDIOBJ_Cleanup, /* 06 GDIObjType_CLIENTOBJ_TYPE */ - GDIOBJ_Cleanup, /* 07 GDIObjType_PATH_TYPE */ - PALETTE_Cleanup, /* 08 GDIObjType_PAL_TYPE */ - GDIOBJ_Cleanup, /* 09 GDIObjType_ICMLCS_TYPE */ - GDIOBJ_Cleanup, /* 0a GDIObjType_LFONT_TYPE */ - NULL, /* 0b GDIObjType_RFONT_TYPE, unused */ - NULL, /* 0c GDIObjType_PFE_TYPE, unused */ - NULL, /* 0d GDIObjType_PFT_TYPE, unused */ - GDIOBJ_Cleanup, /* 0e GDIObjType_ICMCXF_TYPE */ - NULL, /* 0f GDIObjType_SPRITE_TYPE, unused */ - BRUSH_Cleanup, /* 10 GDIObjType_BRUSH_TYPE, BRUSH, PEN, EXTPEN */ - NULL, /* 11 GDIObjType_UMPD_TYPE, unused */ - NULL, /* 12 GDIObjType_UNUSED4_TYPE */ - NULL, /* 13 GDIObjType_SPACE_TYPE, unused */ - NULL, /* 14 GDIObjType_UNUSED5_TYPE */ - NULL, /* 15 GDIObjType_META_TYPE, unused */ - NULL, /* 16 GDIObjType_EFSTATE_TYPE, unused */ - NULL, /* 17 GDIObjType_BMFD_TYPE, unused */ - NULL, /* 18 GDIObjType_VTFD_TYPE, unused */ - NULL, /* 19 GDIObjType_TTFD_TYPE, unused */ - NULL, /* 1a GDIObjType_RC_TYPE, unused */ - NULL, /* 1b GDIObjType_TEMP_TYPE, unused */ - DRIVEROBJ_Cleanup,/* 1c GDIObjType_DRVOBJ_TYPE */ - NULL, /* 1d GDIObjType_DCIOBJ_TYPE, unused */ - NULL, /* 1e GDIObjType_SPOOL_TYPE, unused */ - NULL, /* 1f reserved entry */ + NULL, /* 00 GDIObjType_DEF_TYPE */ + DC_vCleanup, /* 01 GDIObjType_DC_TYPE */ + NULL, /* 02 GDIObjType_UNUSED1_TYPE */ + NULL, /* 03 GDIObjType_UNUSED2_TYPE */ + REGION_vCleanup, /* 04 GDIObjType_RGN_TYPE */ + SURFACE_vCleanup, /* 05 GDIObjType_SURF_TYPE */ + GDIOBJ_vCleanup, /* 06 GDIObjType_CLIENTOBJ_TYPE */ + GDIOBJ_vCleanup, /* 07 GDIObjType_PATH_TYPE */ + PALETTE_vCleanup, /* 08 GDIObjType_PAL_TYPE */ + GDIOBJ_vCleanup, /* 09 GDIObjType_ICMLCS_TYPE */ + GDIOBJ_vCleanup, /* 0a GDIObjType_LFONT_TYPE */ + NULL, /* 0b GDIObjType_RFONT_TYPE, unused */ + NULL, /* 0c GDIObjType_PFE_TYPE, unused */ + NULL, /* 0d GDIObjType_PFT_TYPE, unused */ + GDIOBJ_vCleanup, /* 0e GDIObjType_ICMCXF_TYPE */ + NULL, /* 0f GDIObjType_SPRITE_TYPE, unused */ + BRUSH_vCleanup, /* 10 GDIObjType_BRUSH_TYPE, BRUSH, PEN, EXTPEN */ + NULL, /* 11 GDIObjType_UMPD_TYPE, unused */ + NULL, /* 12 GDIObjType_UNUSED4_TYPE */ + NULL, /* 13 GDIObjType_SPACE_TYPE, unused */ + NULL, /* 14 GDIObjType_UNUSED5_TYPE */ + NULL, /* 15 GDIObjType_META_TYPE, unused */ + NULL, /* 16 GDIObjType_EFSTATE_TYPE, unused */ + NULL, /* 17 GDIObjType_BMFD_TYPE, unused */ + NULL, /* 18 GDIObjType_VTFD_TYPE, unused */ + NULL, /* 19 GDIObjType_TTFD_TYPE, unused */ + NULL, /* 1a GDIObjType_RC_TYPE, unused */ + NULL, /* 1b GDIObjType_TEMP_TYPE, unused */ + DRIVEROBJ_vCleanup,/* 1c GDIObjType_DRVOBJ_TYPE */ + NULL, /* 1d GDIObjType_DCIOBJ_TYPE, unused */ + NULL, /* 1e GDIObjType_SPOOL_TYPE, unused */ + NULL, /* 1f reserved entry */ }; /* INTERNAL FUNCTIONS ********************************************************/ static -BOOL NTAPI -GDIOBJ_Cleanup(PVOID ObjectBody) +VOID +NTAPI +GDIOBJ_vCleanup(PVOID ObjectBody) { - return TRUE; + /* Nothing to do */ } static diff --git a/reactos/win32ss/gdi/ntgdi/gdiobj.h b/reactos/win32ss/gdi/ntgdi/gdiobj.h index b049ff5d801..d2f13ad8c52 100644 --- a/reactos/win32ss/gdi/ntgdi/gdiobj.h +++ b/reactos/win32ss/gdi/ntgdi/gdiobj.h @@ -28,7 +28,7 @@ extern PGDI_HANDLE_TABLE GdiHandleTable; typedef PVOID PGDIOBJ; -typedef BOOL (NTAPI *GDICLEANUPPROC)(PVOID ObjectBody); +typedef VOID (NTAPI *GDICLEANUPPROC)(PVOID ObjectBody); /* Every GDI Object must have this standard type of header. * It's for thread locking. */ diff --git a/reactos/win32ss/gdi/ntgdi/palette.c b/reactos/win32ss/gdi/ntgdi/palette.c index 73b4832ac2c..7fef04ea4f2 100644 --- a/reactos/win32ss/gdi/ntgdi/palette.c +++ b/reactos/win32ss/gdi/ntgdi/palette.c @@ -230,17 +230,15 @@ PALETTE_AllocPalWithHandle( return ppal; } -BOOL +VOID NTAPI -PALETTE_Cleanup(PVOID ObjectBody) +PALETTE_vCleanup(PVOID ObjectBody) { PPALETTE pPal = (PPALETTE)ObjectBody; if (pPal->IndexedColors && pPal->IndexedColors != pPal->apalColors) { ExFreePoolWithTag(pPal->IndexedColors, TAG_PALETTE); } - - return TRUE; } INT @@ -702,15 +700,15 @@ NtGdiGetNearestColor( EngSetLastError(ERROR_INVALID_HANDLE); return CLR_INVALID; } - + if(dc->dclevel.pSurface == NULL) ppal = gppalMono; else ppal = dc->dclevel.pSurface->ppal; - + /* Translate the color to the DC format */ Color = TranslateCOLORREF(dc, Color); - + /* XLATE it back to RGB color space */ EXLATEOBJ_vInitialize(&exlo, ppal, @@ -718,11 +716,11 @@ NtGdiGetNearestColor( 0, RGB(0xff, 0xff, 0xff), RGB(0, 0, 0)); - + nearest = XLATEOBJ_iXlate(&exlo.xlo, Color); - + EXLATEOBJ_vCleanup(&exlo); - + /* We're done */ DC_UnlockDc(dc); @@ -771,7 +769,7 @@ IntGdiRealizePalette(HDC hDC) { goto cleanup; } - + if(pdc->dctype == DCTYPE_DIRECT) { UNIMPLEMENTED; diff --git a/reactos/win32ss/gdi/ntgdi/palette.h b/reactos/win32ss/gdi/ntgdi/palette.h index 3dd16dbb271..4dd591d80db 100644 --- a/reactos/win32ss/gdi/ntgdi/palette.h +++ b/reactos/win32ss/gdi/ntgdi/palette.h @@ -117,9 +117,9 @@ PALETTE_vGetBitMasks( PPALETTE ppal, PULONG pulColors); -BOOL +VOID NTAPI -PALETTE_Cleanup(PVOID ObjectBody); +PALETTE_vCleanup(PVOID ObjectBody); FORCEINLINE ULONG diff --git a/reactos/win32ss/gdi/ntgdi/region.c b/reactos/win32ss/gdi/ntgdi/region.c index d1cf0671f13..ce79722837c 100644 --- a/reactos/win32ss/gdi/ntgdi/region.c +++ b/reactos/win32ss/gdi/ntgdi/region.c @@ -2275,8 +2275,8 @@ IntSysCreateRectRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect) return hrgn; } -BOOL NTAPI -REGION_Cleanup(PVOID ObjectBody) +VOID NTAPI +REGION_vCleanup(PVOID ObjectBody) { PROSRGNDATA pRgn = (PROSRGNDATA)ObjectBody; PPROCESSINFO ppi = PsGetCurrentProcessWin32Process(); @@ -2288,7 +2288,6 @@ REGION_Cleanup(PVOID ObjectBody) if (pRgn->Buffer && pRgn->Buffer != &pRgn->rdh.rcBound) ExFreePoolWithTag(pRgn->Buffer, TAG_REGION); - return TRUE; } VOID FASTCALL diff --git a/reactos/win32ss/gdi/ntgdi/region.h b/reactos/win32ss/gdi/ntgdi/region.h index 778dd294d91..b11f31da8ee 100644 --- a/reactos/win32ss/gdi/ntgdi/region.h +++ b/reactos/win32ss/gdi/ntgdi/region.h @@ -29,7 +29,7 @@ INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, RECTL *pRect); BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, const RECTL *rc); BOOL FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc, const RECTL *rect, const POINT *off); VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect); -BOOL NTAPI REGION_Cleanup(PVOID ObjectBody); +VOID NTAPI REGION_vCleanup(PVOID ObjectBody); extern PROSRGNDATA prgnDefault; extern HRGN hrgnDefault; diff --git a/reactos/win32ss/user/user32/windows/mdi.c b/reactos/win32ss/user/user32/windows/mdi.c index ae867416199..7fdfee0c734 100644 --- a/reactos/win32ss/user/user32/windows/mdi.c +++ b/reactos/win32ss/user/user32/windows/mdi.c @@ -860,8 +860,8 @@ static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam ) for (r = 1; r <= rows && *pWnd; r++, i++) { LONG posOptions = SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER; - LONG style = GetWindowLongW(win_array[i], GWL_STYLE); - if (!(style & WS_SIZEBOX)) posOptions |= SWP_NOSIZE; + LONG style = GetWindowLongW(win_array[i], GWL_STYLE); + if (!(style & WS_SIZEBOX)) posOptions |= SWP_NOSIZE; SetWindowPos(*pWnd, 0, x, y, xsize, ysize, posOptions); y += ysize; @@ -1091,9 +1091,9 @@ static void MDI_UpdateFrameText( HWND frame, HWND hClient, BOOL repaint, LPCWSTR DefWindowProcW( frame, WM_SETTEXT, 0, (LPARAM)lpBuffer ); - if (repaint) - SetWindowPos( frame, 0,0,0,0,0, SWP_FRAMECHANGED | - SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); + if (repaint) + SetWindowPos( frame, 0,0,0,0,0, SWP_FRAMECHANGED | + SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); } @@ -1830,7 +1830,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) return; } - ERR("CalcChildScroll 1\n"); + TRACE("CalcChildScroll 1\n"); if ((list = WIN_ListChildren( hwnd ))) { int i; @@ -1851,14 +1851,14 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) OffsetRect(&rect, -WindowInfo.rcClient.left, -WindowInfo.rcClient.top); //WIN_GetRectangles( list[i], COORDS_PARENT, &rect, NULL ); - ERR("CalcChildScroll L\n"); + TRACE("CalcChildScroll L\n"); UnionRect( &childRect, &rect, &childRect ); } } HeapFree( GetProcessHeap(), 0, list ); } UnionRect( &childRect, &clientRect, &childRect ); - ERR("CalcChildScroll 3\n"); + TRACE("CalcChildScroll 3\n"); /* set common info values */ info.cbSize = sizeof(info); info.fMask = SIF_POS | SIF_RANGE | SIF_PAGE; @@ -1883,12 +1883,12 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) SetScrollInfo(hwnd, SB_HORZ, &info, TRUE); if (scroll == SB_HORZ) { - ERR("CalcChildScroll H\n"); + TRACE("CalcChildScroll H\n"); break; } else { - ERR("CalcChildScroll B\n"); + TRACE("CalcChildScroll B\n"); } /* fall through */ case SB_VERT: @@ -1898,7 +1898,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) info.nPage = 1 + clientRect.bottom - clientRect.top; //info.nMax = childRect.bottom - clientRect.bottom; //info.nPos = clientRect.top - childRect.top; - ERR("CalcChildScroll V\n"); + TRACE("CalcChildScroll V\n"); if (ci->initialStyle & WS_VSCROLL) SetScrollInfo(hwnd, SB_VERT, &info, TRUE); break; @@ -2029,7 +2029,7 @@ TileWindows (HWND hwndParent, UINT wFlags, LPCRECT lpRect, * TileChildWindows (USER32.@) */ WORD WINAPI TileChildWindows( HWND parent, UINT flags ) -{ +{ return TileWindows( parent, flags, NULL, 0, NULL ); } diff --git a/reactos/win32ss/user/user32/windows/message.c b/reactos/win32ss/user/user32/windows/message.c index f3a729155cb..2e7a737c72d 100644 --- a/reactos/win32ss/user/user32/windows/message.c +++ b/reactos/win32ss/user/user32/windows/message.c @@ -245,7 +245,7 @@ DWORD FASTCALL get_input_codepage( void ) if (!ret) cp = CP_ACP; return cp; } - + static WPARAM FASTCALL map_wparam_char_WtoA( WPARAM wParam, DWORD len ) { WCHAR wch = wParam; @@ -253,7 +253,7 @@ static WPARAM FASTCALL map_wparam_char_WtoA( WPARAM wParam, DWORD len ) DWORD cp = get_input_codepage(); len = WideCharToMultiByte( cp, 0, &wch, 1, (LPSTR)ch, len, NULL, NULL ); - if (len == 2) + if (len == 2) return MAKEWPARAM( (ch[0] << 8) | ch[1], HIWORD(wParam) ); else return MAKEWPARAM( ch[0], HIWORD(wParam) ); @@ -743,9 +743,9 @@ MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg) case WM_CHARTOITEM: case WM_MENUCHAR: - case WM_CHAR: + case WM_CHAR: case WM_DEADCHAR: - case WM_SYSCHAR: + case WM_SYSCHAR: case WM_SYSDEADCHAR: case EM_SETPASSWORDCHAR: case WM_IME_CHAR: @@ -1139,14 +1139,14 @@ MsgiUnicodeToAnsiMessage(HWND hwnd, LPMSG AnsiMsg, LPMSG UnicodeMsg) } case WM_GETDLGCODE: - if (UnicodeMsg->lParam) + if (UnicodeMsg->lParam) { MSG newmsg = *(MSG *)UnicodeMsg->lParam; switch(newmsg.message) { case WM_CHAR: case WM_DEADCHAR: - case WM_SYSCHAR: + case WM_SYSCHAR: case WM_SYSDEADCHAR: newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 1 ); break; @@ -1169,9 +1169,9 @@ MsgiUnicodeToAnsiMessage(HWND hwnd, LPMSG AnsiMsg, LPMSG UnicodeMsg) break; case WM_CHARTOITEM: - case WM_MENUCHAR: - case WM_DEADCHAR: - case WM_SYSCHAR: + case WM_MENUCHAR: + case WM_DEADCHAR: + case WM_SYSCHAR: case WM_SYSDEADCHAR: case EM_SETPASSWORDCHAR: AnsiMsg->wParam = map_wparam_char_WtoA(UnicodeMsg->wParam,1); @@ -1303,7 +1303,7 @@ MsgiUnicodeToAnsiReply(LPMSG AnsiMsg, LPMSG UnicodeMsg, LRESULT *Result) { DWORD len = AnsiMsg->wParam;// * 2; if (len) - { + { if (*Result) { RtlMultiByteToUnicodeN( UBuffer, AnsiMsg->wParam*sizeof(WCHAR), &len, Buffer, strlen(Buffer)+1 ); @@ -2404,7 +2404,7 @@ SendMessageW(HWND Wnd, if ( Window != NULL && Window->head.pti == ti && - !ISITHOOKED(WH_CALLWNDPROC) && + !ISITHOOKED(WH_CALLWNDPROC) && !ISITHOOKED(WH_CALLWNDPROCRET) && !(Window->state & WNDS_SERVERSIDEWINDOWPROC) ) { @@ -2468,7 +2468,7 @@ SendMessageA(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam) if ( Window != NULL && Window->head.pti == ti && - !ISITHOOKED(WH_CALLWNDPROC) && + !ISITHOOKED(WH_CALLWNDPROC) && !ISITHOOKED(WH_CALLWNDPROCRET) && !(Window->state & WNDS_SERVERSIDEWINDOWPROC) ) { @@ -2935,7 +2935,7 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength) case WM_SIZING: { PRECT prect = (PRECT) KMMsg.lParam; - ERR("WM_SIZING 1 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); + TRACE("WM_SIZING 1 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); break; } default: @@ -2983,7 +2983,7 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength) case WM_SIZING: { PRECT prect = (PRECT) KMMsg.lParam; - ERR("WM_SIZING 2 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); + TRACE("WM_SIZING 2 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); break; } default: From 17be1062a29492ed641c68c0b33de999f8501bac Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 22 May 2014 13:40:23 +0000 Subject: [PATCH 52/69] [WIN32K] Don't access the object header of a kernel object from win32k. Instead get the desktop name from the desktop info structure. CORE-6818 #resolve svn path=/trunk/; revision=63409 --- reactos/win32ss/user/ntuser/desktop.c | 59 +++++++++++++-------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/reactos/win32ss/user/ntuser/desktop.c b/reactos/win32ss/user/ntuser/desktop.c index 384b47780fb..ff2e1de5837 100644 --- a/reactos/win32ss/user/ntuser/desktop.c +++ b/reactos/win32ss/user/ntuser/desktop.c @@ -51,7 +51,7 @@ IntDesktopObjectParse(IN PVOID ParseObject, OBJECT_ATTRIBUTES ObjectAttributes; PLIST_ENTRY NextEntry, ListHead; PWINSTATION_OBJECT WinStaObject = (PWINSTATION_OBJECT)ParseObject; - PUNICODE_STRING DesktopName; + UNICODE_STRING DesktopName; PBOOLEAN pContext = (PBOOLEAN) Context; if(pContext) @@ -65,43 +65,40 @@ IntDesktopObjectParse(IN PVOID ParseObject, /* Get the current desktop */ Desktop = CONTAINING_RECORD(NextEntry, DESKTOP, ListEntry); - /// @todo Don't mess around with the object headers! - /* Get its name */ - _PRAGMA_WARNING_SUPPRESS(__WARNING_DEREF_NULL_PTR) - DesktopName = GET_DESKTOP_NAME(Desktop); - if (DesktopName) + /* Get the desktop name */ + ASSERT(Desktop->pDeskInfo != NULL); + RtlInitUnicodeString(&DesktopName, Desktop->pDeskInfo->szDesktopName); + + /* Compare the name */ + if (RtlEqualUnicodeString(RemainingName, + &DesktopName, + (Attributes & OBJ_CASE_INSENSITIVE))) { - /* Compare the name */ - if (RtlEqualUnicodeString(RemainingName, - DesktopName, - (Attributes & OBJ_CASE_INSENSITIVE))) + /* We found a match. Did this come from a create? */ + if (Context) { - /* We found a match. Did this come from a create? */ - if (Context) + /* Unless OPEN_IF was given, fail with an error */ + if (!(Attributes & OBJ_OPENIF)) { - /* Unless OPEN_IF was given, fail with an error */ - if (!(Attributes & OBJ_OPENIF)) - { - /* Name collision */ - return STATUS_OBJECT_NAME_COLLISION; - } - else - { - /* Otherwise, return with a warning only */ - Status = STATUS_OBJECT_NAME_EXISTS; - } + /* Name collision */ + return STATUS_OBJECT_NAME_COLLISION; } else { - /* This was a real open, so this is OK */ - Status = STATUS_SUCCESS; + /* Otherwise, return with a warning only */ + Status = STATUS_OBJECT_NAME_EXISTS; } - - /* Reference the desktop and return it */ - ObReferenceObject(Desktop); - *Object = Desktop; - return Status; } + else + { + /* This was a real open, so this is OK */ + Status = STATUS_SUCCESS; + } + + /* Reference the desktop and return it */ + ObReferenceObject(Desktop); + *Object = Desktop; + return Status; } /* Go to the next desktop */ @@ -522,7 +519,7 @@ IntSetFocusMessageQueue(PUSER_MESSAGE_QUEUE NewQueue) { gpqForeground = pdo->ActiveMessageQueue; } - else + else { gpqForeground = NULL; ERR("ptiLastInput is CLEARED!!\n"); From e849ca97bc8c62b5af993a9055657020042fdf83 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 22 May 2014 14:10:49 +0000 Subject: [PATCH 53/69] [CRT] * Update fgetpos(). CORE-8080 svn path=/trunk/; revision=63410 --- reactos/lib/sdk/crt/stdio/file.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index 299e2ddf7ab..150d61b9006 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -3416,34 +3416,9 @@ LONG CDECL ftell(FILE* file) */ int CDECL fgetpos(FILE* file, fpos_t *pos) { - int off=0; - - _lock_file(file); - *pos = _lseeki64(file->_file,0,SEEK_CUR); - if(*pos == -1) { - _unlock_file(file); + *pos = _ftelli64(file); + if(*pos == -1) return -1; - } - if(file->_bufsiz) { - if( file->_flag & _IOWRT ) { - off = file->_ptr - file->_base; - } else { - off = -file->_cnt; - if (get_ioinfo(file->_file)->wxflag & WX_TEXT) { - /* Black magic correction for CR removal */ - int i; - for (i=0; i_cnt; i++) { - if (file->_ptr[i] == '\n') - off--; - } - /* Black magic when reading CR at buffer boundary*/ - if(get_ioinfo(file->_file)->wxflag & WX_READCR) - off--; - } - } - } - *pos += off; - _unlock_file(file); return 0; } From f537d6e8e4ac18f739a76d69e26cf626abb588a1 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Thu, 22 May 2014 14:55:04 +0000 Subject: [PATCH 54/69] [USETUP] - Fix a failed partition type assignment, when unpartitioned disk space is converted to an extended partition. - Rename the extended partition list to logical partition list. - Add a pointer to an extended partition to the disk entries. And keep it up-to-date when the primary partition list is built or modified. - Add the 'Unpartitioned space' partiton entry to the logical partition list when an extended partition has been created. - Remove all logical partition entries when the coresponding extended partition will be deleted. svn path=/trunk/; revision=63411 --- reactos/base/setup/usetup/partlist.c | 178 +++++++++++++++++---------- reactos/base/setup/usetup/partlist.h | 6 +- 2 files changed, 114 insertions(+), 70 deletions(-) diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index eef02c1f367..051d02c5b7f 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -524,7 +524,7 @@ AddPartitionToDisk( ULONG DiskNumber, PDISKENTRY DiskEntry, ULONG PartitionIndex, - BOOLEAN ExtendedPartition) + BOOLEAN LogicalPartition) { PPARTITION_INFORMATION PartitionInfo; PPARTENTRY PartEntry; @@ -548,7 +548,7 @@ AddPartitionToDisk( PartEntry->PartitionType = PartitionInfo->PartitionType; PartEntry->HiddenSectors = PartitionInfo->HiddenSectors; - PartEntry->ExtendedPartition = ExtendedPartition; + PartEntry->LogicalPartition = LogicalPartition; PartEntry->IsPartitioned = TRUE; PartEntry->PartitionNumber = PartitionInfo->PartitionNumber; PartEntry->PartitionIndex = PartitionIndex; @@ -556,6 +556,9 @@ AddPartitionToDisk( if (IsContainerPartition(PartEntry->PartitionType)) { PartEntry->FormatState = Unformatted; + + if (LogicalPartition == FALSE && DiskEntry->ExtendedPartition == NULL) + DiskEntry->ExtendedPartition = PartEntry; } else if ((PartEntry->PartitionType == PARTITION_FAT_12) || (PartEntry->PartitionType == PARTITION_FAT_16) || @@ -613,8 +616,8 @@ AddPartitionToDisk( PartEntry->FormatState = UnknownFormat; } - if (ExtendedPartition) - InsertTailList(&DiskEntry->ExtendedPartListHead, + if (LogicalPartition) + InsertTailList(&DiskEntry->LogicalPartListHead, &PartEntry->ListEntry); else InsertTailList(&DiskEntry->PrimaryPartListHead, @@ -991,7 +994,7 @@ AddDiskToList( } InitializeListHead(&DiskEntry->PrimaryPartListHead); - InitializeListHead(&DiskEntry->ExtendedPartListHead); + InitializeListHead(&DiskEntry->LogicalPartListHead); DiskEntry->Cylinders = DiskGeometry.Cylinders.QuadPart; DiskEntry->TracksPerCylinder = DiskGeometry.TracksPerCylinder; @@ -1009,8 +1012,8 @@ AddDiskToList( DiskEntry->SectorAlignment = DiskGeometry.SectorsPerTrack; - DPRINT("SectorCount %I64u\n", DiskEntry->SectorCount); - DPRINT("SectorAlignment %lu\n", DiskEntry->SectorAlignment); + DPRINT1("SectorCount %I64u\n", DiskEntry->SectorCount); + DPRINT1("SectorAlignment %lu\n", DiskEntry->SectorAlignment); DiskEntry->DiskNumber = DiskNumber; DiskEntry->Port = ScsiAddress.PortNumber; @@ -1228,10 +1231,10 @@ DestroyPartitionList( RtlFreeHeap(ProcessHeap, 0, PartEntry); } - /* Release extended partition list */ - while (!IsListEmpty(&DiskEntry->ExtendedPartListHead)) + /* Release logical partition list */ + while (!IsListEmpty(&DiskEntry->LogicalPartListHead)) { - Entry = RemoveHeadList(&DiskEntry->ExtendedPartListHead); + Entry = RemoveHeadList(&DiskEntry->LogicalPartListHead); PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); RtlFreeHeap(ProcessHeap, 0, PartEntry); @@ -1342,8 +1345,8 @@ PrintPartitionData( sprintf(LineBuffer, MUIGetString(STRING_UNPSPACE), - PartEntry->ExtendedPartition ? " " : "", - PartEntry->ExtendedPartition ? "" : " ", + PartEntry->LogicalPartition ? " " : "", + PartEntry->LogicalPartition ? "" : " ", PartSize.u.LowPart, Unit); } @@ -1410,9 +1413,9 @@ PrintPartitionData( MUIGetString(STRING_HDDINFOUNK5), (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, (PartEntry->DriveLetter == 0) ? '-' : ':', - PartEntry->ExtendedPartition ? " " : "", + PartEntry->LogicalPartition ? " " : "", PartEntry->PartitionType, - PartEntry->ExtendedPartition ? "" : " ", + PartEntry->LogicalPartition ? "" : " ", PartSize.u.LowPart, Unit); } @@ -1422,9 +1425,9 @@ PrintPartitionData( "%c%c %s%-24s%s %6lu %s", (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, (PartEntry->DriveLetter == 0) ? '-' : ':', - PartEntry->ExtendedPartition ? " " : "", + PartEntry->LogicalPartition ? " " : "", PartType, - PartEntry->ExtendedPartition ? "" : " ", + PartEntry->LogicalPartition ? "" : " ", PartSize.u.LowPart, Unit); } @@ -1474,8 +1477,8 @@ PrintDiskData( PPARTLIST List, PDISKENTRY DiskEntry) { - PPARTENTRY PrimaryPartEntry, ExtendedPartEntry; - PLIST_ENTRY PrimaryEntry, ExtendedEntry; + PPARTENTRY PrimaryPartEntry, LogicalPartEntry; + PLIST_ENTRY PrimaryEntry, LogicalEntry; CHAR LineBuffer[128]; COORD coPos; DWORD Written; @@ -1570,16 +1573,16 @@ PrintDiskData( if (IsContainerPartition(PrimaryPartEntry->PartitionType)) { - ExtendedEntry = DiskEntry->ExtendedPartListHead.Flink; - while (ExtendedEntry != &DiskEntry->ExtendedPartListHead) + LogicalEntry = DiskEntry->LogicalPartListHead.Flink; + while (LogicalEntry != &DiskEntry->LogicalPartListHead) { - ExtendedPartEntry = CONTAINING_RECORD(ExtendedEntry, PARTENTRY, ListEntry); + LogicalPartEntry = CONTAINING_RECORD(LogicalEntry, PARTENTRY, ListEntry); PrintPartitionData(List, DiskEntry, - ExtendedPartEntry); + LogicalPartEntry); - ExtendedEntry = ExtendedEntry->Flink; + LogicalEntry = LogicalEntry->Flink; } } @@ -2208,6 +2211,40 @@ DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); } +static +VOID +AddLogicalDiskSpace( + PDISKENTRY DiskEntry) +{ + PPARTENTRY NewPartEntry; + + DPRINT1("AddLogicalDiskSpace()\n"); + + /* Create a partition table entry that represents the empty space in the container partition */ + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + NewPartEntry->LogicalPartition = TRUE; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = DiskEntry->ExtendedPartition->StartSector.QuadPart + (ULONGLONG)DiskEntry->SectorsPerTrack; + NewPartEntry->SectorCount.QuadPart = DiskEntry->ExtendedPartition->SectorCount.QuadPart - (ULONGLONG)DiskEntry->SectorsPerTrack; + + DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); + DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); + DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + InsertTailList(&DiskEntry->LogicalPartListHead, + &NewPartEntry->ListEntry); +} + + VOID CreateExtendedPartition( PPARTLIST List, @@ -2217,7 +2254,7 @@ CreateExtendedPartition( PPARTENTRY PartEntry; PPARTENTRY NewPartEntry; - DPRINT1("CreatePrimaryPartition(%I64u)\n", SectorCount); + DPRINT1("CreateExtendedPartition(%I64u)\n", SectorCount); if (List == NULL || List->CurrentDisk == NULL || @@ -2237,12 +2274,24 @@ DPRINT1("Current partition sector count: %I64u\n", PartEntry->SectorCount.QuadPa DPRINT1("Convert existing partition entry\n"); /* Convert current entry to 'new (unformatted)' */ PartEntry->IsPartitioned = TRUE; -// PartEntry->PartitionType = PARTITION_ENTRY_UNUSED; PartEntry->FormatState = Formatted; PartEntry->AutoCreate = FALSE; PartEntry->New = FALSE; PartEntry->BootIndicator = FALSE; /* FIXME */ + if (PartEntry->StartSector.QuadPart < 1450560) + { + /* Partition starts below the 8.4GB boundary ==> CHS partition */ + PartEntry->PartitionType = PARTITION_EXTENDED; + } + else + { + /* Partition starts above the 8.4GB boundary ==> LBA partition */ + PartEntry->PartitionType = PARTITION_XINT13_EXTENDED; + } + + DiskEntry->ExtendedPartition = PartEntry; + DPRINT1("First Sector: %I64u\n", PartEntry->StartSector.QuadPart); DPRINT1("Last Sector: %I64u\n", PartEntry->StartSector.QuadPart + PartEntry->SectorCount.QuadPart - 1); DPRINT1("Total Sectors: %I64u\n", PartEntry->SectorCount.QuadPart); @@ -2269,30 +2318,32 @@ DPRINT1("Add new partition entry\n"); NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - NewPartEntry->StartSector.QuadPart; -// NewPartEntry->PartitionType = PARTITION_ENTRY_UNUSED; - -DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); -DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); -DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); - NewPartEntry->New = FALSE; NewPartEntry->FormatState = Formatted; NewPartEntry->BootIndicator = FALSE; /* FIXME */ + if (NewPartEntry->StartSector.QuadPart < 1450560) + { + /* Partition starts below the 8.4GB boundary ==> CHS partition */ + NewPartEntry->PartitionType = PARTITION_EXTENDED; + } + else + { + /* Partition starts above the 8.4GB boundary ==> LBA partition */ + NewPartEntry->PartitionType = PARTITION_XINT13_EXTENDED; + } + + DiskEntry->ExtendedPartition = NewPartEntry; + PartEntry->StartSector.QuadPart = NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart; PartEntry->SectorCount.QuadPart -= (PartEntry->StartSector.QuadPart - NewPartEntry->StartSector.QuadPart); + +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); } - if (NewPartEntry->StartSector.QuadPart < 1450560) - { - /* Partition starts below the 8.4GB boundary ==> CHS partition */ - NewPartEntry->PartitionType = PARTITION_EXTENDED; - } - else - { - /* Partition starts above the 8.4GB boundary ==> LBA partition */ - NewPartEntry->PartitionType = PARTITION_XINT13_EXTENDED; - } + AddLogicalDiskSpace(DiskEntry); UpdateDiskLayout(DiskEntry); @@ -2312,6 +2363,8 @@ DeleteCurrentPartition( PPARTENTRY PartEntry; PPARTENTRY PrevPartEntry; PPARTENTRY NextPartEntry; + PPARTENTRY LogicalPartEntry; + PLIST_ENTRY Entry; if (List == NULL || List->CurrentDisk == NULL || @@ -2324,6 +2377,20 @@ DeleteCurrentPartition( DiskEntry = List->CurrentDisk; PartEntry = List->CurrentPartition; + /* Delete all logical partiton entries if an extended partition will be deleted */ + if (DiskEntry->ExtendedPartition == PartEntry) + { + while (!IsListEmpty(&DiskEntry->LogicalPartListHead)) + { + Entry = RemoveHeadList(&DiskEntry->LogicalPartListHead); + LogicalPartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + + RtlFreeHeap(ProcessHeap, 0, LogicalPartEntry); + } + + DiskEntry->ExtendedPartition = NULL; + } + /* Adjust unpartitioned disk space entries */ /* Get pointer to previous and next unpartitioned entries */ @@ -2744,30 +2811,6 @@ GetPrimaryPartitionCount( } -static -ULONG -GetExtendedPartitionCount( - IN PDISKENTRY DiskEntry) -{ - PLIST_ENTRY Entry; - PPARTENTRY PartEntry; - UINT nCount = 0; - - Entry = DiskEntry->PrimaryPartListHead.Flink; - while (Entry != &DiskEntry->PrimaryPartListHead) - { - PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); - if (PartEntry->IsPartitioned == TRUE && - IsContainerPartition(PartEntry->PartitionType)) - nCount++; - - Entry = Entry->Flink; - } - - return nCount; -} - - ULONG PrimaryPartitionCreationChecks( IN PPARTLIST List) @@ -2786,7 +2829,7 @@ PrimaryPartitionCreationChecks( if (GetPrimaryPartitionCount(DiskEntry) > 4) return ERROR_PARTITION_TABLE_FULL; - /* FIXME: Fail if this partiton is located behind an extended partition */ + /* Fail if this partiton is located behind an extended partition */ if (IsPreviousPartitionExtended(PartEntry, DiskEntry)) return ERROR_NOT_BEHIND_EXTENDED; @@ -2813,7 +2856,7 @@ ExtendedPartitionCreationChecks( return ERROR_PARTITION_TABLE_FULL; /* Fail if there is another extended partition in the list */ - if (GetExtendedPartitionCount(DiskEntry) != 0) + if (DiskEntry->ExtendedPartition != NULL) return ERROR_ONLY_ONE_EXTENDED; /* Fail if the partition is not the last list entry */ @@ -2823,5 +2866,4 @@ ExtendedPartitionCreationChecks( return ERROR_SUCCESS; } - /* EOF */ diff --git a/reactos/base/setup/usetup/partlist.h b/reactos/base/setup/usetup/partlist.h index 40022f4b800..b276ef3ec81 100644 --- a/reactos/base/setup/usetup/partlist.h +++ b/reactos/base/setup/usetup/partlist.h @@ -57,7 +57,7 @@ typedef struct _PARTENTRY CHAR VolumeLabel[17]; CHAR FileSystemName[9]; - BOOLEAN ExtendedPartition; + BOOLEAN LogicalPartition; /* Partition is partitioned disk space */ BOOLEAN IsPartitioned; @@ -117,8 +117,10 @@ typedef struct _DISKENTRY PDRIVE_LAYOUT_INFORMATION LayoutBuffer; + PPARTENTRY ExtendedPartition; + LIST_ENTRY PrimaryPartListHead; - LIST_ENTRY ExtendedPartListHead; + LIST_ENTRY LogicalPartListHead; } DISKENTRY, *PDISKENTRY; From 292420e2afa0a2c63d7bd551541f393773f9730c Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 22 May 2014 16:13:44 +0000 Subject: [PATCH 55/69] [CRT] * Update fputs(). CORE-8080 svn path=/trunk/; revision=63412 --- reactos/lib/sdk/crt/stdio/file.c | 47 ++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index 150d61b9006..254bf1feaf1 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -553,6 +553,29 @@ int CDECL _isatty(int fd) return TRUE; } +/* INTERNAL: Allocate temporary buffer for stdout and stderr */ +static BOOL add_std_buffer(FILE *file) +{ + static char buffers[2][BUFSIZ]; + + if((file->_file!=STDOUT_FILENO && file->_file!=STDERR_FILENO) + || !_isatty(file->_file) || file->_bufsiz) + return FALSE; + + file->_ptr = file->_base = buffers[file->_file == STDOUT_FILENO ? 0 : 1]; + file->_bufsiz = file->_cnt = BUFSIZ; + return TRUE; +} + +/* INTERNAL: Removes temporary buffer from stdout or stderr */ +/* Only call this function when add_std_buffer returned TRUE */ +static void remove_std_buffer(FILE *file) +{ + flush_buffer(file); + file->_ptr = file->_base = NULL; + file->_bufsiz = file->_cnt = 0; +} + /* INTERNAL: Convert integer to base32 string (0-9a-v), 0 becomes "" */ static int int_to_base32(int num, char *str) { @@ -3427,23 +3450,13 @@ int CDECL fgetpos(FILE* file, fpos_t *pos) */ int CDECL fputs(const char *s, FILE* file) { - size_t i, len = strlen(s); + size_t len = strlen(s); int ret; _lock_file(file); - if (!(get_ioinfo(file->_file)->wxflag & WX_TEXT)) { - ret = fwrite(s,sizeof(*s),len,file) == len ? 0 : EOF; - _unlock_file(file); - return ret; - } - for (i=0; i Date: Thu, 22 May 2014 16:15:48 +0000 Subject: [PATCH 56/69] [BMFD] Fix inverted use of scaling factors. Patch by Victor Martinez. CORE-8165 #resolve svn path=/trunk/; revision=63413 --- reactos/win32ss/drivers/font/bmfd/glyph.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/drivers/font/bmfd/glyph.c b/reactos/win32ss/drivers/font/bmfd/glyph.c index da4642a0c82..ebc5f06e824 100644 --- a/reactos/win32ss/drivers/font/bmfd/glyph.c +++ b/reactos/win32ss/drivers/font/bmfd/glyph.c @@ -118,8 +118,8 @@ BmfdQueryGlyphAndBitmap( } else { - cxDst = cxSrc * yScale; - cyDst = cySrc * xScale; + cxDst = cxSrc * xScale; + cyDst = cySrc * yScale; } cjDstRow = (cxDst + 7) / 8; @@ -154,7 +154,7 @@ BmfdQueryGlyphAndBitmap( } /* Fill GLYPHBITS structure */ - pgb->ptlOrigin.x = yScale * pface->wA; + pgb->ptlOrigin.x = xScale * pface->wA; pgb->ptlOrigin.y = - yScale * pface->wAscent; pgb->sizlBitmap.cx = cxDst; pgb->sizlBitmap.cy = cyDst; From ce7e55def93a24d7878ab0e53361ba838967d0a1 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Thu, 22 May 2014 18:53:44 +0000 Subject: [PATCH 57/69] [shell32] Import some changes from Wine to shlexec.cpp patch by Ivan Rodionov see CORE-8196 svn path=/trunk/; revision=63414 --- reactos/dll/win32/shell32/classes.cpp | 10 +- reactos/dll/win32/shell32/shell32_main.cpp | 2 +- reactos/dll/win32/shell32/shell32_main.h | 6 - reactos/dll/win32/shell32/shlexec.cpp | 329 +++++++++++++-------- 4 files changed, 216 insertions(+), 131 deletions(-) diff --git a/reactos/dll/win32/shell32/classes.cpp b/reactos/dll/win32/shell32/classes.cpp index 5b232a2c9a7..5d7d92f037d 100644 --- a/reactos/dll/win32/shell32/classes.cpp +++ b/reactos/dll/win32/shell32/classes.cpp @@ -34,7 +34,7 @@ BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL /* added because we do not want to have double dots */ if (szExtension[0] == '.') - bPrependDot = 0; + bPrependDot = FALSE; if (bPrependDot) szTemp[0] = '.'; @@ -66,7 +66,7 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bP /* added because we do not want to have double dots */ if (szExtension[0] == '.') - bPrependDot = 0; + bPrependDot = FALSE; if (bPrependDot) szTemp[0] = '.'; @@ -109,7 +109,7 @@ BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD le TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest); - if (szVerb) + if (szVerb && *szVerb) { lstrcpynW(szDest, szVerb, len); return TRUE; @@ -173,7 +173,7 @@ BOOL HCR_GetExecuteCommandW(HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPW return FALSE; ret = FALSE; - if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb))) + if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0]))) { WCHAR sTemp[MAX_PATH]; wcscpy(sTemp, swShell); @@ -420,7 +420,7 @@ BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len) } } - TRACE("-- %s\n", szDest); + TRACE("-- (%s)\n", szDest); return ret; } diff --git a/reactos/dll/win32/shell32/shell32_main.cpp b/reactos/dll/win32/shell32/shell32_main.cpp index aa2d299cffa..a38ef84521e 100644 --- a/reactos/dll/win32/shell32/shell32_main.cpp +++ b/reactos/dll/win32/shell32/shell32_main.cpp @@ -1075,7 +1075,7 @@ INT_PTR CALLBACK AboutAuthorsDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM /************************************************************************* * AboutDlgProc (internal) */ -INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) +static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { static DWORD cxLogoBmp; static DWORD cyLogoBmp; diff --git a/reactos/dll/win32/shell32/shell32_main.h b/reactos/dll/win32/shell32/shell32_main.h index 7c6d8643c60..d3274f17515 100644 --- a/reactos/dll/win32/shell32/shell32_main.h +++ b/reactos/dll/win32/shell32/shell32_main.h @@ -53,7 +53,6 @@ BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int* pi BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len); BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD dwAttributes); -INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM); DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len); DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len); @@ -173,11 +172,6 @@ static LPWSTR __inline __SHCloneStrAtoW(WCHAR **target, const char *source) #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16)) #define HINSTANCE_16(h32) (LOWORD(h32)) -typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, - const SHELLEXECUTEINFOW *sei, LPSHELLEXECUTEINFOW sei_out); - -BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc); - extern WCHAR swShell32Name[MAX_PATH]; BOOL UNIXFS_is_rooted_at_desktop(void); diff --git a/reactos/dll/win32/shell32/shlexec.cpp b/reactos/dll/win32/shell32/shlexec.cpp index 7adbd0d0e03..76929844d6a 100644 --- a/reactos/dll/win32/shell32/shlexec.cpp +++ b/reactos/dll/win32/shell32/shlexec.cpp @@ -28,6 +28,9 @@ static const WCHAR wszExe[] = L".exe"; #define SEE_MASK_CLASSALL (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY) +typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, + const SHELLEXECUTEINFOW *sei, LPSHELLEXECUTEINFOW sei_out); + static void ParseNoTildeEffect(PWSTR &res, LPCWSTR &args, DWORD &len, DWORD &used, int argNum) { bool firstCharQuote = false; @@ -382,7 +385,12 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* } } - *res = '\0'; + used++; + if (res - out < static_cast(len)) + *res = '\0'; + else + out[len-1] = '\0'; + TRACE("used %i of %i space\n", used, len); if (out_len) *out_len = used; @@ -451,7 +459,7 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = psei->nShow; dwCreationFlags = CREATE_UNICODE_ENVIRONMENT; - if (psei->fMask & SEE_MASK_NO_CONSOLE) + if (!(psei->fMask & SEE_MASK_NO_CONSOLE)) dwCreationFlags |= CREATE_NEW_CONSOLE; startup.lpTitle = (LPWSTR)(psei->fMask & (SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE) ? psei->lpClass : NULL); @@ -589,28 +597,46 @@ end: return found; } -static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPWSTR filetype, LPWSTR command, LONG commandlen) +/************************************************************************* + * SHELL_FindExecutableByVerb [Internal] + * + * called from SHELL_FindExecutable or SHELL_execute_class + * in/out: + * classname a buffer, big enough, to get the key name to do actually the + * command "WordPad.Document.1\\shell\\open\\command" + * passed as "WordPad.Document.1" + * in: + * lpVerb the operation on it (open) + * commandlen the size of command buffer (in bytes) + * out: + * command a buffer, to store the command to do the + * operation on the file + * key a buffer, big enough, to get the key name to do actually the + * command "WordPad.Document.1\\shell\\open\\command" + * Can be NULL + */ +static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classname, LPWSTR command, LONG commandlen) { static const WCHAR wCommand[] = L"\\command"; HKEY hkeyClass; WCHAR verb[MAX_PATH]; - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, filetype, 0, 0x02000000, &hkeyClass)) + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, classname, 0, 0x02000000, &hkeyClass)) return SE_ERR_NOASSOC; - if (!HCR_GetDefaultVerbW(hkeyClass, lpOperation, verb, sizeof(verb) / sizeof(verb[0]))) + if (!HCR_GetDefaultVerbW(hkeyClass, lpVerb, verb, sizeof(verb) / sizeof(verb[0]))) return SE_ERR_NOASSOC; RegCloseKey(hkeyClass); /* Looking for ...buffer\shell\\command */ - wcscat(filetype, L"\\shell\\"); - wcscat(filetype, verb); - wcscat(filetype, wCommand); + wcscat(classname, L"\\shell\\"); + wcscat(classname, verb); + wcscat(classname, wCommand); - if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, command, + if (RegQueryValueW(HKEY_CLASSES_ROOT, classname, command, &commandlen) == ERROR_SUCCESS) { commandlen /= sizeof(WCHAR); - if (key) wcscpy(key, filetype); + if (key) wcscpy(key, classname); #if 0 LPWSTR tmp; WCHAR param[256]; @@ -624,10 +650,10 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW */ /* Get the parameters needed by the application from the associated ddeexec key */ - tmp = strstrW(filetype, wCommand); + tmp = strstrW(classname, wCommand); tmp[0] = '\0'; - wcscat(filetype, wDdeexec); - if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, param, + wcscat(classname, wDdeexec); + if (RegQueryValueW(HKEY_CLASSES_ROOT, classname, param, ¶mlen) == ERROR_SUCCESS) { paramlen /= sizeof(WCHAR); @@ -651,7 +677,7 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW * Utility for code sharing between FindExecutable and ShellExecute * in: * lpFile the name of a file - * lpOperation the operation on it (open) + * lpVerb the operation on it (open) * out: * lpResult a buffer, big enough :-(, to store the command to do the * operation on the file @@ -659,12 +685,12 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW * command (it'll be used afterwards for more information * on the operation) */ -static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, +static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, LPWSTR lpResult, DWORD resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args) { WCHAR *extension = NULL; /* pointer to file extension */ - WCHAR filetype[256]; /* registry name for this filetype */ - LONG filetypelen = sizeof(filetype); /* length of above */ + WCHAR classname[256]; /* registry name for this file type */ + LONG classnamelen = sizeof(classname); /* length of above */ WCHAR command[1024]; /* command from registry */ WCHAR wBuffer[256]; /* Used to GetProfileString */ UINT retval = SE_ERR_NOASSOC; @@ -699,7 +725,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; - /* Hey, isn't this value ignored? Why make this call? Shouldn't we return here? --dank*/ + /* The file was found in the application-supplied default directory (or the system search path) */ } else if (lpPath && SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL)) { @@ -711,8 +737,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera attribs = GetFileAttributesW(lpFile); if (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY)) { - wcscpy(filetype, L"Folder"); - filetypelen = 6; /* strlen("Folder") */ + wcscpy(classname, L"Folder"); } else { @@ -736,7 +761,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera /* Three places to check: */ /* 1. win.ini, [windows], programs (NB no leading '.') */ - /* 2. Registry, HKEY_CLASS_ROOT\\shell\open\command */ + /* 2. Registry, HKEY_CLASS_ROOT\\shell\open\command */ /* 3. win.ini, [extensions], extension (NB no leading '.' */ /* All I know of the order is that registry is checked before */ /* extensions; however, it'd make sense to check the programs */ @@ -773,28 +798,26 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera } /* Check registry */ - if (RegQueryValueW(HKEY_CLASSES_ROOT, extension, filetype, - &filetypelen) == ERROR_SUCCESS) + if (RegQueryValueW(HKEY_CLASSES_ROOT, extension, classname, + &classnamelen) == ERROR_SUCCESS) { - filetypelen /= sizeof(WCHAR); - if (filetypelen == sizeof(filetype) / sizeof(WCHAR)) - filetypelen--; + classnamelen /= sizeof(WCHAR); + if (classnamelen == sizeof(classname) / sizeof(WCHAR)) + classnamelen--; - filetype[filetypelen] = '\0'; - TRACE("File type: %s\n", debugstr_w(filetype)); + classname[classnamelen] = '\0'; + TRACE("File type: %s\n", debugstr_w(classname)); } else { - *filetype = '\0'; - filetypelen = 0; + *classname = '\0'; } } - if (*filetype) + if (*classname) { - /* pass the operation string to SHELL_FindExecutableByOperation() */ - filetype[filetypelen] = '\0'; - retval = SHELL_FindExecutableByOperation(lpOperation, key, filetype, command, sizeof(command)); + /* pass the verb string to SHELL_FindExecutableByVerb() */ + retval = SHELL_FindExecutableByVerb(lpVerb, key, classname, command, sizeof(command)); if (retval > 32) { @@ -882,20 +905,34 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec { WCHAR regkey[256]; WCHAR * endkey = regkey + wcslen(key); - WCHAR app[256], topic[256], ifexec[256], res[256]; + WCHAR app[256], topic[256], ifexec[256], static_res[256]; + WCHAR * dynamic_res=NULL; + WCHAR * res; LONG applen, topiclen, ifexeclen; WCHAR * exec; DWORD ddeInst = 0; DWORD tid; - DWORD resultLen; + DWORD resultLen, endkeyLen; HSZ hszApp, hszTopic; HCONV hConv; HDDEDATA hDdeData; unsigned ret = SE_ERR_NOASSOC; BOOL unicode = !(GetVersion() & 0x80000000); + if (strlenW(key) + 1 > sizeof(regkey) / sizeof(regkey[0])) + { + FIXME("input parameter %s larger than buffer\n", debugstr_w(key)); + return 2; + } wcscpy(regkey, key); - wcscpy(endkey, L"\\application"); + static const WCHAR wApplication[] = L"\\application"; + endkeyLen = sizeof(regkey) / sizeof(regkey[0]) - (endkey - regkey); + if (strlenW(wApplication) + 1 > endkeyLen) + { + FIXME("endkey %s overruns buffer\n", debugstr_w(wApplication)); + return 2; + } + wcscpy(endkey, wApplication); applen = sizeof(app); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, app, &applen) != ERROR_SUCCESS) { @@ -908,6 +945,12 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec /* Get application command from start string and find filename of application */ if (*start == '"') { + if (strlenW(start + 1) + 1 > sizeof(command) / sizeof(command[0])) + { + FIXME("size of input parameter %s larger than buffer\n", + debugstr_w(start + 1)); + return 2; + } wcscpy(command, start + 1); if ((ptr = wcschr(command, '"'))) * ptr = 0; @@ -915,8 +958,9 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec } else { - LPWSTR p, space; - for (p = (LPWSTR)start; (space = const_cast(strchrW(p, ' '))); p = space + 1) + LPCWSTR p; + LPWSTR space; + for (p = start; (space = const_cast(strchrW(p, ' '))); p = space + 1) { int idx = space - start; memcpy(command, start, idx * sizeof(WCHAR)); @@ -933,6 +977,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec ERR("Unable to find application path for command %s\n", debugstr_w(start)); return ERROR_ACCESS_DENIED; } + if (strlenW(ptr) + 1 > sizeof(app) / sizeof(app[0])) + { + FIXME("size of found path %s larger than buffer\n", debugstr_w(ptr)); + return 2; + } wcscpy(app, ptr); /* Remove extensions (including .so) */ @@ -945,8 +994,14 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec assert(ptr); *ptr = 0; } - - wcscpy(endkey, L"\\topic"); + + static const WCHAR wTopic[] = L"\\topic"; + if (strlenW(wTopic) + 1 > endkeyLen) + { + FIXME("endkey %s overruns buffer\n", debugstr_w(wTopic)); + return 2; + } + wcscpy(endkey, wTopic); topiclen = sizeof(topic); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, topic, &topiclen) != ERROR_SUCCESS) { @@ -986,7 +1041,13 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec SetLastError(ERROR_DDE_FAIL); return 30; /* whatever */ } - strcpyW(endkey, L"\\ifexec"); + static const WCHAR wIfexec[] = L"\\ifexec"; + if (strlenW(wIfexec) + 1 > endkeyLen) + { + FIXME("endkey %s overruns buffer\n", debugstr_w(wIfexec)); + return 2; + } + strcpyW(endkey, wIfexec); ifexeclen = sizeof(ifexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, ifexec, &ifexeclen) == ERROR_SUCCESS) { @@ -994,9 +1055,14 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec } } - SHELL_ArgifyW(res, sizeof(res) / sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen); - if (resultLen > sizeof(res) / sizeof(WCHAR)) - ERR("Argify buffer not large enough, truncated\n"); + SHELL_ArgifyW(static_res, sizeof(static_res)/sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen); + if (resultLen > sizeof(static_res)/sizeof(WCHAR)) + { + res = dynamic_res = static_cast(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR))); + SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL); + } + else + res = static_res; TRACE("%s %s => %s\n", debugstr_w(exec), debugstr_w(lpFile), debugstr_w(res)); /* It's documented in the KB 330337 that IE has a bug and returns @@ -1019,6 +1085,8 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec WARN("DdeClientTransaction failed with error %04x\n", DdeGetLastError(ddeInst)); ret = 33; + HeapFree(GetProcessHeap(), 0, dynamic_res); + DdeDisconnect(hConv); error: @@ -1296,7 +1364,7 @@ static HRESULT shellex_run_context_menu_default(IShellExtInit *obj, memset(&ici, 0, sizeof ici); ici.cbSize = sizeof ici; - ici.fMask = CMIC_MASK_UNICODE | (sei->fMask & (SEE_MASK_NOASYNC | SEE_MASK_ASYNCOK | SEE_MASK_FLAG_NO_UI)); + ici.fMask = CMIC_MASK_UNICODE | (sei->fMask & (SEE_MASK_NO_CONSOLE | SEE_MASK_NOASYNC | SEE_MASK_ASYNCOK | SEE_MASK_FLAG_NO_UI)); ici.nShow = sei->nShow; ici.lpVerb = MAKEINTRESOURCEA(def); ici.hwnd = sei->hwnd; @@ -1411,34 +1479,61 @@ static LONG ShellExecute_FromContextMenu( LPSHELLEXECUTEINFOW sei ) return r; } +static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR lpstrProtocol, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc); + static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) { - WCHAR execCmd[1024], wcmd[1024]; + WCHAR execCmd[1024], classname[1024]; /* launch a document by fileclass like 'WordPad.Document.1' */ /* the Commandline contains 'c:\Path\wordpad.exe "%1"' */ /* FIXME: wcmd should not be of a fixed size. Fixed to 1024, MAX_PATH is way too short! */ ULONG cmask = (psei->fMask & SEE_MASK_CLASSALL); DWORD resultLen; BOOL done; - - HCR_GetExecuteCommandW((cmask == SEE_MASK_CLASSKEY) ? psei->hkeyClass : NULL, - (cmask == SEE_MASK_CLASSNAME) ? psei->lpClass : NULL, - psei->lpVerb, - execCmd, sizeof(execCmd)); - - /* FIXME: get the extension of lpFile, check if it fits to the lpClass */ - TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName)); - - wcmd[0] = '\0'; - done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen); - if (!done && wszApplicationName[0]) + UINT_PTR rslt; + + /* FIXME: remove following block when SHELL_quote_and_execute supports hkeyClass parameter */ + if (cmask != SEE_MASK_CLASSNAME) { - strcatW(wcmd, L" "); - strcatW(wcmd, wszApplicationName); + WCHAR wcmd[1024]; + HCR_GetExecuteCommandW((cmask == SEE_MASK_CLASSKEY) ? psei->hkeyClass : NULL, + (cmask == SEE_MASK_CLASSNAME) ? psei->lpClass : NULL, + psei->lpVerb, + execCmd, sizeof(execCmd)); + + /* FIXME: get the extension of lpFile, check if it fits to the lpClass */ + TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName)); + + wcmd[0] = '\0'; + done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen); + if (!done && wszApplicationName[0]) + { + strcatW(wcmd, L" "); + if (*wszApplicationName != '"') + { + strcatW(wcmd, L"\""); + strcatW(wcmd, wszApplicationName); + strcatW(wcmd, L"\""); + } + else + strcatW(wcmd, wszApplicationName); + } + if (resultLen > sizeof(wcmd) / sizeof(WCHAR)) + ERR("Argify buffer not large enough... truncating\n"); + return execfunc(wcmd, NULL, FALSE, psei, psei_out); } - if (resultLen > sizeof(wcmd) / sizeof(WCHAR)) - ERR("Argify buffer not large enough... truncating\n"); - return execfunc(wcmd, NULL, FALSE, psei, psei_out); + + strcpyW(classname, psei->lpClass); + rslt = SHELL_FindExecutableByVerb(psei->lpVerb, NULL, classname, execCmd, sizeof(execCmd)); + + TRACE("SHELL_FindExecutableByVerb returned %u (%s, %s)\n", (unsigned int)rslt, debugstr_w(classname), debugstr_w(execCmd)); + if (33 > rslt) + return rslt; + rslt = SHELL_quote_and_execute( execCmd, L"", classname, + wszApplicationName, NULL, psei, + psei_out, execfunc ); + return rslt; + } static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters, DWORD parametersLen, LPWSTR wszApplicationName, DWORD dwApplicationNameLen) @@ -1448,7 +1543,7 @@ static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters BOOL appKnownSingular = FALSE; /* last chance to translate IDList: now also allow CLSID paths */ - if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, sizeof(buffer)))) { + if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, sizeof(buffer)/sizeof(WCHAR)))) { if (buffer[0] == ':' && buffer[1] == ':') { /* open shell folder for the specified class GUID */ if (strlenW(buffer) + 1 > parametersLen) @@ -1487,7 +1582,7 @@ static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters return appKnownSingular; } -static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR lpstrProtocol, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) +static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR wszKeyname, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) { UINT_PTR retval; DWORD len; @@ -1513,17 +1608,17 @@ static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPC strcatW(wszQuotedCmd, wszParameters); } - TRACE("%s/%s => %s/%s\n", debugstr_w(wszApplicationName), debugstr_w(psei->lpVerb), debugstr_w(wszQuotedCmd), debugstr_w(lpstrProtocol)); + TRACE("%s/%s => %s/%s\n", debugstr_w(wszApplicationName), debugstr_w(psei->lpVerb), debugstr_w(wszQuotedCmd), debugstr_w(wszKeyname)); - if (*lpstrProtocol) - retval = execute_from_key(lpstrProtocol, wszApplicationName, env, psei->lpParameters, wcmd, execfunc, psei, psei_out); + if (*wszKeyname) + retval = execute_from_key(wszKeyname, wszApplicationName, env, psei->lpParameters, wcmd, execfunc, psei, psei_out); else retval = execfunc(wszQuotedCmd, env, FALSE, psei, psei_out); HeapFree(GetProcessHeap(), 0, wszQuotedCmd); return retval; } -static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) +static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) { static const WCHAR wShell[] = L"\\shell\\"; static const WCHAR wCommand[] = L"\\command"; @@ -1540,9 +1635,9 @@ static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, L iSize = strlenW(lpFile); TRACE("Got URL: %s\n", debugstr_w(lpFile)); - /* Looking for ...protocol\shell\lpOperation\command */ + /* Looking for ...\shell\\command */ len = iSize + lstrlenW(wShell) + lstrlenW(wCommand) + 1; - if (psei->lpVerb) + if (psei->lpVerb && *psei->lpVerb) len += lstrlenW(psei->lpVerb); else len += lstrlenW(wszOpen); @@ -1550,23 +1645,16 @@ static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, L memcpy(lpstrProtocol, lpFile, iSize * sizeof(WCHAR)); lpstrProtocol[iSize] = '\0'; strcatW(lpstrProtocol, wShell); - strcatW(lpstrProtocol, psei->lpVerb ? psei->lpVerb : wszOpen); + strcatW(lpstrProtocol, psei->lpVerb && *psei->lpVerb ? psei->lpVerb : wszOpen); strcatW(lpstrProtocol, wCommand); - /* Remove File Protocol from lpFile */ - /* In the case file://path/file */ - if (!strncmpiW(lpFile, wFile, iSize)) - { - lpFile += iSize; - while (*lpFile == ':') lpFile++; - } retval = execute_from_key(lpstrProtocol, lpFile, NULL, psei->lpParameters, wcmd, execfunc, psei, psei_out); HeapFree(GetProcessHeap(), 0, lpstrProtocol); return retval; } -void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) +static void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) { WCHAR msg[2048]; DWORD_PTR msgArguments[3] = { (DWORD_PTR)filename, 0, 0 }; @@ -1591,7 +1679,7 @@ void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) /************************************************************************* * SHELL_execute [Internal] */ -BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) +static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) { static const DWORD unsupportedFlags = SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY | @@ -1608,7 +1696,7 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) SHELLEXECUTEINFOW sei_tmp; /* modifiable copy of SHELLEXECUTEINFO struct */ WCHAR wfileName[MAX_PATH]; WCHAR *env; - WCHAR lpstrProtocol[256]; + WCHAR wszKeyname[256]; LPCWSTR lpFile; UINT_PTR retval = SE_ERR_NOASSOC; BOOL appKnownSingular = FALSE; @@ -1766,36 +1854,40 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) dwApplicationNameLen ); } - /* expand environment strings */ - len = ExpandEnvironmentStringsW(sei_tmp.lpFile, NULL, 0); - if (len > 0) + /* convert file URLs */ + if (UrlIsFileUrlW(sei_tmp.lpFile)) { LPWSTR buf; - buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); + DWORD size; + + size = MAX_PATH; + buf = static_cast(HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR))); + if (!buf || FAILED(PathCreateFromUrlW(sei_tmp.lpFile, buf, &size, 0))) + { + HeapFree(GetProcessHeap(), 0, buf); + return SE_ERR_OOM; + } - ExpandEnvironmentStringsW(sei_tmp.lpFile, buf, len + 1); HeapFree(GetProcessHeap(), 0, wszApplicationName); - dwApplicationNameLen = len + 1; + dwApplicationNameLen = lstrlenW(buf) + 1; wszApplicationName = buf; - /* appKnownSingular unmodified */ - sei_tmp.lpFile = wszApplicationName; } - - if (*sei_tmp.lpParameters) + else /* or expand environment strings (not both!) */ { - len = ExpandEnvironmentStringsW(sei_tmp.lpParameters, NULL, 0); + len = ExpandEnvironmentStringsW(sei_tmp.lpFile, NULL, 0); if (len > 0) { LPWSTR buf; - len++; - buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - ExpandEnvironmentStringsW(sei_tmp.lpParameters, buf, len); - if (wszParameters != parametersBuffer) - HeapFree(GetProcessHeap(), 0, wszParameters); - wszParameters = buf; - parametersLen = len; - sei_tmp.lpParameters = wszParameters; + buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); + + ExpandEnvironmentStringsW(sei_tmp.lpFile, buf, len + 1); + HeapFree(GetProcessHeap(), 0, wszApplicationName); + dwApplicationNameLen = len + 1; + wszApplicationName = buf; + /* appKnownSingular unmodified */ + + sei_tmp.lpFile = wszApplicationName; } } @@ -1849,6 +1941,7 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) /* terminate previous command string after the quote character */ *end = L'\0'; + lpFile = wfileName; } else { @@ -1880,13 +1973,11 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) } } - lstrcpynW(wfileName, sei_tmp.lpFile, sizeof(wfileName) / sizeof(WCHAR)); + lpFile = sei_tmp.lpFile; } } else - lstrcpynW(wfileName, sei_tmp.lpFile, sizeof(wfileName) / sizeof(WCHAR)); - - lpFile = wfileName; + lpFile = sei_tmp.lpFile; wcmd = wcmdBuffer; len = lstrlenW(wszApplicationName) + 3; @@ -1919,10 +2010,10 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) /* Else, try to find the executable */ wcmd[0] = L'\0'; - retval = SHELL_FindExecutable(sei_tmp.lpDirectory, lpFile, sei_tmp.lpVerb, wcmd, wcmdLen, lpstrProtocol, &env, (LPITEMIDLIST)sei_tmp.lpIDList, sei_tmp.lpParameters); + retval = SHELL_FindExecutable(sei_tmp.lpDirectory, lpFile, sei_tmp.lpVerb, wcmd, wcmdLen, wszKeyname, &env, (LPITEMIDLIST)sei_tmp.lpIDList, sei_tmp.lpParameters); if (retval > 32) /* Found */ { - retval = SHELL_quote_and_execute(wcmd, wszParameters, lpstrProtocol, + retval = SHELL_quote_and_execute(wcmd, wszParameters, wszKeyname, wszApplicationName, env, &sei_tmp, sei, execfunc); HeapFree(GetProcessHeap(), 0, env); @@ -1941,7 +2032,7 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) { swprintf(lpQuotedFile, L"\"%s\"", lpFile); retval = SHELL_quote_and_execute(wExec, lpQuotedFile, - lpstrProtocol, + wszKeyname, wszApplicationName, env, &sei_tmp, sei, execfunc); HeapFree(GetProcessHeap(), 0, env); @@ -1953,12 +2044,12 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) } else if (PathIsURLW(lpFile)) /* File not found, check for URL */ { - retval = SHELL_execute_url(lpFile, L"file", wcmd, &sei_tmp, sei, execfunc ); + retval = SHELL_execute_url(lpFile, wcmd, &sei_tmp, sei, execfunc ); } /* Check if file specified is in the form www.??????.*** */ else if (!strncmpiW(lpFile, L"www", 3)) { - /* if so, append lpFile http:// and call ShellExecute */ + /* if so, prefix lpFile with http:// and call ShellExecute */ WCHAR lpstrTmpFile[256]; strcpyW(lpstrTmpFile, L"http://"); strcatW(lpstrTmpFile, lpFile); @@ -1998,19 +2089,19 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) /************************************************************************* * ShellExecuteA [SHELL32.290] */ -HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, +HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpVerb, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT iShowCmd) { SHELLEXECUTEINFOA sei; TRACE("%p,%s,%s,%s,%s,%d\n", - hWnd, debugstr_a(lpOperation), debugstr_a(lpFile), + hWnd, debugstr_a(lpVerb), debugstr_a(lpFile), debugstr_a(lpParameters), debugstr_a(lpDirectory), iShowCmd); sei.cbSize = sizeof(sei); sei.fMask = SEE_MASK_FLAG_NO_UI; sei.hwnd = hWnd; - sei.lpVerb = lpOperation; + sei.lpVerb = lpVerb; sei.lpFile = lpFile; sei.lpParameters = lpParameters; sei.lpDirectory = lpDirectory; @@ -2090,10 +2181,10 @@ ShellExecuteExW(LPSHELLEXECUTEINFOW sei) /************************************************************************* * ShellExecuteW [SHELL32.294] * from shellapi.h - * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, + * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd); */ -HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, +HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd) { SHELLEXECUTEINFOW sei; @@ -2102,7 +2193,7 @@ HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, sei.cbSize = sizeof(sei); sei.fMask = SEE_MASK_FLAG_NO_UI; sei.hwnd = hwnd; - sei.lpVerb = lpOperation; + sei.lpVerb = lpVerb; sei.lpFile = lpFile; sei.lpParameters = lpParameters; sei.lpDirectory = lpDirectory; @@ -2122,14 +2213,14 @@ HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, * * FIXME: the callback function most likely doesn't work the same way on Windows. */ -EXTERN_C HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, +EXTERN_C HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR lpVerb, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT iShowCmd, void *callback) { SHELLEXECUTEINFOW seiW; WCHAR *wVerb = NULL, *wFile = NULL, *wParameters = NULL, *wDirectory = NULL; HANDLE hProcess = 0; - seiW.lpVerb = lpOperation ? __SHCloneStrAtoW(&wVerb, lpOperation) : NULL; + seiW.lpVerb = lpVerb ? __SHCloneStrAtoW(&wVerb, lpVerb) : NULL; seiW.lpFile = lpFile ? __SHCloneStrAtoW(&wFile, lpFile) : NULL; seiW.lpParameters = lpParameters ? __SHCloneStrAtoW(&wParameters, lpParameters) : NULL; seiW.lpDirectory = lpDirectory ? __SHCloneStrAtoW(&wDirectory, lpDirectory) : NULL; From ea89346b76ed8277fc08c37a702564965f402eb8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 22 May 2014 19:15:40 +0000 Subject: [PATCH 58/69] [WIN32K] Amendment to r63409. Zap remaining kernel object header access from win32k. Noticed by Hermes. svn path=/trunk/; revision=63416 --- reactos/win32ss/user/ntuser/desktop.h | 5 ----- reactos/win32ss/user/ntuser/winsta.c | 15 ++++++--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/reactos/win32ss/user/ntuser/desktop.h b/reactos/win32ss/user/ntuser/desktop.h index 56c721ae212..2dbcaa385fa 100644 --- a/reactos/win32ss/user/ntuser/desktop.h +++ b/reactos/win32ss/user/ntuser/desktop.h @@ -174,11 +174,6 @@ HDC FASTCALL UserGetDesktopDC(ULONG,BOOL,BOOL); #define IntIsActiveDesktop(Desktop) \ ((Desktop)->rpwinstaParent->ActiveDesktop == (Desktop)) -#define GET_DESKTOP_NAME(d) \ - OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(d)) ? \ - &(OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(d))->Name) : \ - NULL - HWND FASTCALL IntGetMessageWindow(VOID); PWND FASTCALL UserGetMessageWindow(VOID); diff --git a/reactos/win32ss/user/ntuser/winsta.c b/reactos/win32ss/user/ntuser/winsta.c index f4fe81a017e..908da59be63 100644 --- a/reactos/win32ss/user/ntuser/winsta.c +++ b/reactos/win32ss/user/ntuser/winsta.c @@ -1210,7 +1210,7 @@ BuildDesktopNameList( DWORD EntryCount; ULONG ReturnLength; WCHAR NullWchar; - PUNICODE_STRING DesktopName; + UNICODE_STRING DesktopName; Status = IntValidateWindowStationHandle(hWindowStation, KernelMode, @@ -1233,8 +1233,8 @@ BuildDesktopNameList( DesktopEntry = DesktopEntry->Flink) { DesktopObject = CONTAINING_RECORD(DesktopEntry, DESKTOP, ListEntry); - DesktopName = GET_DESKTOP_NAME(DesktopObject); - if (DesktopName) ReturnLength += DesktopName->Length + sizeof(WCHAR); + RtlInitUnicodeString(&DesktopName, DesktopObject->pDeskInfo->szDesktopName); + ReturnLength += DesktopName.Length + sizeof(WCHAR); EntryCount++; } TRACE("Required size: %lu Entry count: %lu\n", ReturnLength, EntryCount); @@ -1277,18 +1277,15 @@ BuildDesktopNameList( DesktopEntry = DesktopEntry->Flink) { DesktopObject = CONTAINING_RECORD(DesktopEntry, DESKTOP, ListEntry); - _PRAGMA_WARNING_SUPPRESS(__WARNING_DEREF_NULL_PTR) - DesktopName = GET_DESKTOP_NAME(DesktopObject);/// @todo Don't mess around with the object headers! - if (!DesktopName) continue; - - Status = MmCopyToCaller(lpBuffer, DesktopName->Buffer, DesktopName->Length); + RtlInitUnicodeString(&DesktopName, DesktopObject->pDeskInfo->szDesktopName); + Status = MmCopyToCaller(lpBuffer, DesktopName.Buffer, DesktopName.Length); if (! NT_SUCCESS(Status)) { KeReleaseSpinLock(&WindowStation->Lock, OldLevel); ObDereferenceObject(WindowStation); return Status; } - lpBuffer = (PVOID) ((PCHAR)lpBuffer + DesktopName->Length); + lpBuffer = (PVOID) ((PCHAR)lpBuffer + DesktopName.Length); Status = MmCopyToCaller(lpBuffer, &NullWchar, sizeof(WCHAR)); if (! NT_SUCCESS(Status)) { From 6314cbc84d54ff9ef714d5bb476ac378cd1c5275 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 22 May 2014 20:59:46 +0000 Subject: [PATCH 59/69] [CRT] * Update _wtmpnam() and tmpnam(). CORE-8080 svn path=/trunk/; revision=63417 --- reactos/lib/sdk/crt/stdio/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index 254bf1feaf1..36a01098482 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -3718,6 +3718,7 @@ char * CDECL tmpnam(char *s) { size = int_to_base32(tmpnam_unique++, tmpstr); memcpy(p, tmpstr, size); + p[size] = '\0'; if (GetFileAttributesA(s) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND) break; @@ -3749,6 +3750,7 @@ wchar_t * CDECL _wtmpnam(wchar_t *s) { size = int_to_base32_w(tmpnam_unique++, tmpstr); memcpy(p, tmpstr, size*sizeof(wchar_t)); + p[size] = '\0'; if (GetFileAttributesW(s) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND) break; From ccd49a5b8a17ffa2eae3cfa178f128a316c67679 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 22 May 2014 21:10:16 +0000 Subject: [PATCH 60/69] [CRT] * Update ungetwc(). CORE-8080 svn path=/trunk/; revision=63418 --- reactos/lib/sdk/crt/stdio/file.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index 36a01098482..0debf16feaf 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -3824,15 +3824,39 @@ int CDECL ungetc(int c, FILE * file) wint_t CDECL ungetwc(wint_t wc, FILE * file) { wchar_t mwc = wc; - char * pp = (char *)&mwc; - int i; + + if (wc == WEOF) + return WEOF; _lock_file(file); - for(i=sizeof(wchar_t)-1;i>=0;i--) { - if(pp[i] != ungetc(pp[i],file)) { + + if((get_ioinfo(file->_file)->exflag & (EF_UTF8 | EF_UTF16)) + || !(get_ioinfo(file->_file)->wxflag & WX_TEXT)) { + unsigned char * pp = (unsigned char *)&mwc; + int i; + + for(i=sizeof(wchar_t)-1;i>=0;i--) { + if(pp[i] != ungetc(pp[i],file)) { + _unlock_file(file); + return WEOF; + } + } + }else { + char mbs[MB_LEN_MAX]; + int len; + + len = wctomb(mbs, mwc); + if(len == -1) { _unlock_file(file); return WEOF; } + + for(len--; len>=0; len--) { + if(mbs[len] != ungetc(mbs[len], file)) { + _unlock_file(file); + return WEOF; + } + } } _unlock_file(file); From df7e3fde891a80edffbadb5dfd1f80d8bbd226d4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 22 May 2014 22:28:57 +0000 Subject: [PATCH 61/69] [NTOSKRNL] When a user mode debugger has single stepping enabled and steps over a sysenter instruction, you are obviously not supposed to enter the kernel debugger on the syscall entry handler. But exactly this happened on reactos. This was because the sysenter instruction doesn't disable single stepping, so we need to handle this special case manually in the single stepping handler (which we didn't). We now check if the single step comes from KiFastCallEntry and when it does, disable single stepping in the current (nested) trap frame and return back to a secondary fast call entry. The 2nd entrypoint will make sure to re-enable the single step flag in EFLAGS before returning to usermode. To make this actually work, the asm entry stub itself needs to handle saving of eflags, so some trap frame modification from KiFastCallEntryHandler was moved into the asm stub. Since the amount of asm instructions is rather small (10 instructions, pretty straight forward) I moved everything from KiSystemServiceHandler to the asm stub and killed KiFastCallEntryHandler entirely, calling KiSystemServiceHandler instead. Now stepping over a sysenter instruction works with OllyDbg without breaking into the kernel debugger. CORE-8057 #resolve svn path=/trunk/; revision=63420 --- reactos/include/asm/ks386.template.h | 7 +-- .../ntoskrnl/include/internal/i386/asmmacro.S | 23 +++++++- reactos/ntoskrnl/ke/i386/trap.s | 10 +++- reactos/ntoskrnl/ke/i386/traphdlr.c | 58 +++++++------------ 4 files changed, 53 insertions(+), 45 deletions(-) diff --git a/reactos/include/asm/ks386.template.h b/reactos/include/asm/ks386.template.h index 77085d1bcc4..77ac3f8c306 100644 --- a/reactos/include/asm/ks386.template.h +++ b/reactos/include/asm/ks386.template.h @@ -347,7 +347,7 @@ OFFSET(CONTEXT_SEGSS, CONTEXT, SegSs), //OFFSET(CONTEXT_FLOAT_SAVE_STATUS_WORD CONTEXT_FLOAT_SAVE + FP_STATUS_WORD //OFFSET(CONTEXT_FLOAT_SAVE_TAG_WORD CONTEXT_FLOAT_SAVE + FP_TAG_WORD //OFFSET(CONTEXT_FRAME_LENGTH 0x2D0 -SIZE(CONTEXT_FRAME_LENGTH, CONTEXT), +SIZE(CONTEXT_FRAME_LENGTH, CONTEXT), HEADER("FIBER"), OFFSET(FIBER_PARAMETER, FIBER, Parameter), @@ -387,7 +387,7 @@ OFFSET(EXCEPTION_RECORD_NUMBER_PARAMETERS, EXCEPTION_RECORD, NumberParameters), OFFSET(EXCEPTION_RECORD_EXCEPTION_ADDRESS, EXCEPTION_RECORD, ExceptionAddress), SIZE(SIZEOF_EXCEPTION_RECORD, EXCEPTION_RECORD), CONSTANT(EXCEPTION_RECORD_LENGTH), - + //#define EXCEPTION_RECORD_LENGTH 0x50 HEADER("KTHREAD"), @@ -463,6 +463,5 @@ CONSTANT(EXCEPTION_EXECUTE_HANDLER), CONSTANT(STATUS_CALLBACK_POP_STACK), CONSTANT(CONTEXT_ALIGNED_SIZE), CONSTANT(PROCESSOR_FEATURE_FXSR), - - +CONSTANT(KUSER_SHARED_SYSCALL_RET), diff --git a/reactos/ntoskrnl/include/internal/i386/asmmacro.S b/reactos/ntoskrnl/include/internal/i386/asmmacro.S index 2ab3bdfd6ff..4a6b009d5fc 100644 --- a/reactos/ntoskrnl/include/internal/i386/asmmacro.S +++ b/reactos/ntoskrnl/include/internal/i386/asmmacro.S @@ -83,7 +83,7 @@ MACRO(KiEnterTrap, Flags) if (Flags AND KI_FAST_SYSTEM_CALL) /* SYSENTER requires us to build a complete ring transition trap frame */ - FrameSize = KTRAP_FRAME_V86_ES + FrameSize = KTRAP_FRAME_EIP /* Fixup fs. cx is free to clobber */ mov cx, KGDT_R0_PCR @@ -95,6 +95,13 @@ MACRO(KiEnterTrap, Flags) /* Get a stack pointer */ mov esp, [ecx + KTSS_ESP0] + /* Set up a fake hardware trap frame */ + push KGDT_R3_DATA or RPL_MASK + push edx + pushfd + push KGDT_R3_CODE or RPL_MASK + push dword ptr ds:[KUSER_SHARED_SYSCALL_RET] + elseif (Flags AND KI_SOFTWARE_TRAP) /* Software traps need a complete non-ring transition trap frame */ @@ -183,7 +190,19 @@ set_sane_segs: mov es, ax /* Fast system calls have fs already fixed */ - if (NOT (Flags AND KI_FAST_SYSTEM_CALL)) + if (Flags AND KI_FAST_SYSTEM_CALL) + + /* Enable interrupts and set a sane FS value */ + or dword ptr [esp + KTRAP_FRAME_EFLAGS], EFLAGS_INTERRUPT_MASK + mov dword ptr [esp + KTRAP_FRAME_FS], KGDT_R3_TEB or RPL_MASK + + /* Set sane active EFLAGS */ + push 2 + popfd + + /* Point edx to the usermode parameters */ + add edx, 8 + else /* Otherwise fix fs now */ mov ax, KGDT_R0_PCR mov fs, ax diff --git a/reactos/ntoskrnl/ke/i386/trap.s b/reactos/ntoskrnl/ke/i386/trap.s index 272886d4891..733451d7db3 100644 --- a/reactos/ntoskrnl/ke/i386/trap.s +++ b/reactos/ntoskrnl/ke/i386/trap.s @@ -142,14 +142,20 @@ PUBLIC _KiSystemService KiCallHandler @KiSystemServiceHandler@8 .ENDP -EXTERN @KiFastCallEntryHandler@8:PROC PUBLIC _KiFastCallEntry .PROC _KiFastCallEntry FPO 0, 0, 0, 0, 1, FRAME_TRAP KiEnterTrap (KI_FAST_SYSTEM_CALL OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS) - KiCallHandler @KiFastCallEntryHandler@8 + KiCallHandler @KiSystemServiceHandler@8 .ENDP +PUBLIC _KiFastCallEntryWithSingleStep +.PROC _KiFastCallEntryWithSingleStep + FPO 0, 0, 0, 0, 1, FRAME_TRAP + KiEnterTrap (KI_FAST_SYSTEM_CALL OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS) + or dword ptr [ecx + KTRAP_FRAME_EFLAGS], EFLAGS_TF + KiCallHandler @KiSystemServiceHandler@8 +.ENDP PUBLIC _KiEndUnexpectedRange@0 _KiEndUnexpectedRange@0: diff --git a/reactos/ntoskrnl/ke/i386/traphdlr.c b/reactos/ntoskrnl/ke/i386/traphdlr.c index d98109a21ac..568c4892d42 100644 --- a/reactos/ntoskrnl/ke/i386/traphdlr.c +++ b/reactos/ntoskrnl/ke/i386/traphdlr.c @@ -12,6 +12,9 @@ #define NDEBUG #include +VOID KiFastCallEntry(VOID); +VOID KiFastCallEntryWithSingleStep(VOID); + /* GLOBALS ********************************************************************/ UCHAR KiTrapPrefixTable[] = @@ -417,13 +420,26 @@ KiTrap01Handler(IN PKTRAP_FRAME TrapFrame) { /* Save trap frame */ KiEnterTrap(TrapFrame); - + /* Check for VDM trap */ ASSERT((KiVdmTrap(TrapFrame)) == FALSE); + /* Check if this was a single step after sysenter */ + if (TrapFrame->Eip == (ULONG)KiFastCallEntry) + { + /* Disable single stepping */ + TrapFrame->EFlags &= ~EFLAGS_TF; + + /* Re-enter at the alternative sysenter entry point */ + TrapFrame->Eip = (ULONG)KiFastCallEntryWithSingleStep; + + /* End this trap */ + KiEoiHelper(TrapFrame); + } + /* Enable interrupts if the trap came from user-mode */ if (KiUserTrap(TrapFrame)) _enable(); - + /* Mask out trap flag and dispatch the exception */ TrapFrame->EFlags &= ~EFLAGS_TF; KiDispatchException0Args(STATUS_SINGLE_STEP, @@ -1521,11 +1537,11 @@ KiDbgPostServiceHook(ULONG SystemCallNumber, ULONG_PTR Result) return Result; } -FORCEINLINE DECLSPEC_NORETURN VOID -KiSystemCall(IN PKTRAP_FRAME TrapFrame, - IN PVOID Arguments) +FASTCALL +KiSystemServiceHandler(IN PKTRAP_FRAME TrapFrame, + IN PVOID Arguments) { PKTHREAD Thread; PKSERVICE_TABLE_DESCRIPTOR DescriptorTable; @@ -1658,38 +1674,6 @@ ExitCall: KiServiceExit(TrapFrame, Result); } -DECLSPEC_NORETURN -VOID -FASTCALL -KiSystemServiceHandler(IN PKTRAP_FRAME TrapFrame, - IN PVOID Arguments) -{ - /* Call the shared handler (inline) */ - KiSystemCall(TrapFrame, Arguments); -} - -DECLSPEC_NORETURN -VOID -FASTCALL -KiFastCallEntryHandler(IN PKTRAP_FRAME TrapFrame, - IN PVOID Arguments) -{ - /* Set up a fake INT Stack and enable interrupts */ - TrapFrame->HardwareSegSs = KGDT_R3_DATA | RPL_MASK; - TrapFrame->HardwareEsp = (ULONG_PTR)Arguments; - TrapFrame->EFlags = __readeflags() | EFLAGS_INTERRUPT_MASK; - TrapFrame->SegCs = KGDT_R3_CODE | RPL_MASK; - TrapFrame->Eip = SharedUserData->SystemCallReturn; - TrapFrame->SegFs = KGDT_R3_TEB | RPL_MASK; - __writeeflags(0x2); - - /* Arguments are actually 2 frames down (because of the double indirection) */ - Arguments = (PVOID)(TrapFrame->HardwareEsp + 8); - - /* Call the shared handler (inline) */ - KiSystemCall(TrapFrame, Arguments); -} - /* * @implemented */ From 15accf6c001f7e5d5843306161a979640e7a510e Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Thu, 22 May 2014 23:31:39 +0000 Subject: [PATCH 62/69] [USETUP] - ScanForUnpartitionedDiskSpace: Scan the list of logical partitions for unpartitioned space too. - Fix a little typo. svn path=/trunk/; revision=63421 --- reactos/base/setup/usetup/lang/en-US.h | 2 +- reactos/base/setup/usetup/partlist.c | 122 ++++++++++++++++++++++++- 2 files changed, 122 insertions(+), 2 deletions(-) diff --git a/reactos/base/setup/usetup/lang/en-US.h b/reactos/base/setup/usetup/lang/en-US.h index 6788c36bfb2..23cdcebee74 100644 --- a/reactos/base/setup/usetup/lang/en-US.h +++ b/reactos/base/setup/usetup/lang/en-US.h @@ -1725,7 +1725,7 @@ MUI_STRING enUSStrings[] = {STRING_NEWPARTITION, "Setup created a new partition on"}, {STRING_UNPSPACE, - " %sUnpartitioned space%s %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_EXTENDED_PARTITION, diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index 051d02c5b7f..61b93a2582f 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -530,7 +530,8 @@ AddPartitionToDisk( PPARTENTRY PartEntry; PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[PartitionIndex]; - if (PartitionInfo->PartitionType == 0) + if (PartitionInfo->PartitionType == 0 || + (LogicalPartition == TRUE && IsContainerPartition(PartitionInfo->PartitionType))) return; PartEntry = RtlAllocateHeap(ProcessHeap, @@ -752,6 +753,125 @@ DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); } } + if (DiskEntry->ExtendedPartition != NULL) + { + if (IsListEmpty(&DiskEntry->LogicalPartListHead)) + { + DPRINT1("No logical partition!\n"); + + /* Create a partition table entry that represents the empty extended partition */ + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + NewPartEntry->LogicalPartition = TRUE; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = DiskEntry->ExtendedPartition->StartSector.QuadPart + (ULONGLONG)DiskEntry->SectorsPerTrack; + NewPartEntry->SectorCount.QuadPart = DiskEntry->ExtendedPartition->SectorCount.QuadPart - (ULONGLONG)DiskEntry->SectorsPerTrack; + + DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); + DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); + DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + InsertTailList(&DiskEntry->LogicalPartListHead, + &NewPartEntry->ListEntry); + + return; + } + + /* Start partition at head 1, cylinder 0 */ + LastStartSector = DiskEntry->ExtendedPartition->StartSector.QuadPart + (ULONGLONG)DiskEntry->SectorsPerTrack; + LastSectorCount = 0ULL; + LastUnusedSectorCount = 0ULL; + + Entry = DiskEntry->LogicalPartListHead.Flink; + while (Entry != &DiskEntry->LogicalPartListHead) + { + PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + + if (PartEntry->PartitionType != PARTITION_ENTRY_UNUSED || + PartEntry->SectorCount.QuadPart != 0ULL) + { + LastUnusedSectorCount = + PartEntry->StartSector.QuadPart - (ULONGLONG)DiskEntry->SectorsPerTrack - (LastStartSector + LastSectorCount); + + if ((PartEntry->StartSector.QuadPart - (ULONGLONG)DiskEntry->SectorsPerTrack) > (LastStartSector + LastSectorCount) && + LastUnusedSectorCount >= (ULONGLONG)DiskEntry->SectorAlignment) + { + DPRINT("Unpartitioned disk space %I64u sectors\n", LastUnusedSectorCount); + + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + NewPartEntry->LogicalPartition = TRUE; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = LastStartSector + LastSectorCount; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + LastUnusedSectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + /* Insert the table into the list */ + InsertTailList(&PartEntry->ListEntry, + &NewPartEntry->ListEntry); + } + + LastStartSector = PartEntry->StartSector.QuadPart; + LastSectorCount = PartEntry->SectorCount.QuadPart; + } + + Entry = Entry->Flink; + } + + /* Check for trailing unpartitioned disk space */ + if ((LastStartSector + LastSectorCount) < DiskEntry->ExtendedPartition->StartSector.QuadPart + DiskEntry->ExtendedPartition->SectorCount.QuadPart) + { + LastUnusedSectorCount = Align(DiskEntry->ExtendedPartition->StartSector.QuadPart + DiskEntry->ExtendedPartition->SectorCount.QuadPart - (LastStartSector + LastSectorCount), DiskEntry->SectorAlignment); + + if (LastUnusedSectorCount >= (ULONGLONG)DiskEntry->SectorAlignment) + { + DPRINT("Unpartitioned disk space: %I64u sectors\n", LastUnusedSectorCount); + + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + NewPartEntry->LogicalPartition = TRUE; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = LastStartSector + LastSectorCount; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + LastUnusedSectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + /* Append the table to the list */ + InsertTailList(&DiskEntry->LogicalPartListHead, + &NewPartEntry->ListEntry); + } + } + } + DPRINT1("ScanForUnpartitionedDiskSpace() done\n"); } From b3a2dbfc9a70150c6d5793e3af7930117f02c56e Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 23 May 2014 17:14:39 +0000 Subject: [PATCH 63/69] [shell32] revert one line of r63414 svn path=/trunk/; revision=63423 --- reactos/dll/win32/shell32/shlexec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/shell32/shlexec.cpp b/reactos/dll/win32/shell32/shlexec.cpp index 76929844d6a..717117a56bd 100644 --- a/reactos/dll/win32/shell32/shlexec.cpp +++ b/reactos/dll/win32/shell32/shlexec.cpp @@ -459,7 +459,7 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = psei->nShow; dwCreationFlags = CREATE_UNICODE_ENVIRONMENT; - if (!(psei->fMask & SEE_MASK_NO_CONSOLE)) + if (psei->fMask & SEE_MASK_NO_CONSOLE) dwCreationFlags |= CREATE_NEW_CONSOLE; startup.lpTitle = (LPWSTR)(psei->fMask & (SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE) ? psei->lpClass : NULL); From a65891147dfdcf90a238ba4def266fe15f2e6491 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 23 May 2014 17:28:39 +0000 Subject: [PATCH 64/69] [shell32] set first verb as default fixes opening control panel applets by double click svn path=/trunk/; revision=63424 --- reactos/dll/win32/shell32/defcontextmenu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/dll/win32/shell32/defcontextmenu.cpp b/reactos/dll/win32/shell32/defcontextmenu.cpp index 6c5b2b84bee..2de0965d002 100644 --- a/reactos/dll/win32/shell32/defcontextmenu.cpp +++ b/reactos/dll/win32/shell32/defcontextmenu.cpp @@ -600,8 +600,13 @@ CDefaultContextMenu::AddStaticContextMenusToMenu( fState = MFS_ENABLED; mii.dwTypeData = NULL; + /* set first entry as default */ + if (pEntry == m_pStaticEntries) + fState |= MFS_DEFAULT; + if (!wcsicmp(pEntry->szVerb, L"open")) { + /* override default when open verb is found */ fState |= MFS_DEFAULT; idResource = IDS_OPEN_VERB; } From dd379d872b94f0fa766223ea26bb0c934f8f5fe0 Mon Sep 17 00:00:00 2001 From: Sylvain Petreolle Date: Fri, 23 May 2014 19:31:23 +0000 Subject: [PATCH 65/69] [TXTSETUP] Install wmilib. Dedicated to Timo. ;) svn path=/trunk/; revision=63425 --- reactos/boot/bootdata/txtsetup.sif | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif index 555365a0642..a721eea20ad 100644 --- a/reactos/boot/bootdata/txtsetup.sif +++ b/reactos/boot/bootdata/txtsetup.sif @@ -59,6 +59,7 @@ pcix.sys=,,,,,,,,,,,,4 pcmcia.sys=,,,,,,,,,,,,4 swenum.sys=,,,,,,,,,,,,4 ntdll.dll=,,,,,,,,,,,,2 +wmilib.sys=,,,,,,,,,,,,4 [HardwareIdsDatabase] ;*PNP0A00 = isapnp From a85003772538ed70010cfce1b9133371b8a47563 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sat, 24 May 2014 06:44:22 +0000 Subject: [PATCH 66/69] [shell32] sync _SHGetUserProfilePath with wine svn path=/trunk/; revision=63427 --- reactos/dll/win32/shell32/shellpath.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/dll/win32/shell32/shellpath.cpp b/reactos/dll/win32/shell32/shellpath.cpp index de7e7e72ef7..7d2c2f0d8bb 100644 --- a/reactos/dll/win32/shell32/shellpath.cpp +++ b/reactos/dll/win32/shell32/shellpath.cpp @@ -1171,6 +1171,11 @@ static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder, if (dwFlags & SHGFP_TYPE_DEFAULT) { + if (hToken != NULL && hToken != (HANDLE)-1) + { + FIXME("unsupported for user other than current or default\n"); + return E_FAIL; + } hr = _SHGetDefaultValue(folder, pszPath); } else From 229b404fdeb646fef93a70129bf11410d49b00f1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 24 May 2014 09:53:24 +0000 Subject: [PATCH 67/69] =?UTF-8?q?[DDRAW]=20Avoid=20buffer=20overrun=20in?= =?UTF-8?q?=20IDirectDraw::GetCaps.=20Patch=20by=20J=C3=A9r=C3=B4me=20Gard?= =?UTF-8?q?ou.=20CORE-4623=20#resolve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=63428 --- reactos/dll/directx/ddraw/Ddraw/GetCaps.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/dll/directx/ddraw/Ddraw/GetCaps.c b/reactos/dll/directx/ddraw/Ddraw/GetCaps.c index fa0316609dd..ba45e683534 100644 --- a/reactos/dll/directx/ddraw/Ddraw/GetCaps.c +++ b/reactos/dll/directx/ddraw/Ddraw/GetCaps.c @@ -101,7 +101,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCAPS_DX3)); + memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX3)); } myCaps->dwVidMemFree = dwFree; @@ -126,7 +126,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS)); } myCaps->dwVidMemFree = dwFree; @@ -152,7 +152,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS)); } myCaps->dwVidMemFree = dwFree; @@ -208,7 +208,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCAPS_DX3)); + memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX3)); } myCaps->dwVidMemFree = dwFree; @@ -233,7 +233,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS)); } myCaps->dwVidMemFree = dwFree; @@ -259,7 +259,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS)); } myCaps->dwVidMemFree = dwFree; From bc9a62248c476f25b1a7d3c2944a38bb43b06ae1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 24 May 2014 10:19:01 +0000 Subject: [PATCH 68/69] [MAGNIFY] Update display even when mouse does not move. Patch by Andrea Faulds. CORE-4739 #comment Committed in r63429, thanks. #resolve svn path=/trunk/; revision=63429 --- reactos/base/applications/magnify/magnifier.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/reactos/base/applications/magnify/magnifier.c b/reactos/base/applications/magnify/magnifier.c index 856bf0160d7..8d8bec5b35c 100644 --- a/reactos/base/applications/magnify/magnifier.c +++ b/reactos/base/applications/magnify/magnifier.c @@ -353,22 +353,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) //Update to new position pMouse = pNewMouse; cp = pNewMouse; - Refresh(); } else if (((pCaret.x != pNewCaret.x) || (pCaret.y != pNewCaret.y)) && bFollowCaret) { //Update to new position pCaret = pNewCaret; cp = pNewCaret; - Refresh(); } else if (((pFocus.x != pNewFocus.x) || (pFocus.y != pNewFocus.y)) && bFollowFocus) { //Update to new position pFocus = pNewFocus; cp = pNewFocus; - Refresh(); } + Refresh(); } break; case WM_COMMAND: From 12bcab448a4277e5333953a1c192da6d2ab2c78f Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sat, 24 May 2014 16:39:55 +0000 Subject: [PATCH 69/69] [shell32] revert the revert, my wine version was outdated svn path=/trunk/; revision=63430 --- reactos/dll/win32/shell32/shlexec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/shell32/shlexec.cpp b/reactos/dll/win32/shell32/shlexec.cpp index 717117a56bd..76929844d6a 100644 --- a/reactos/dll/win32/shell32/shlexec.cpp +++ b/reactos/dll/win32/shell32/shlexec.cpp @@ -459,7 +459,7 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = psei->nShow; dwCreationFlags = CREATE_UNICODE_ENVIRONMENT; - if (psei->fMask & SEE_MASK_NO_CONSOLE) + if (!(psei->fMask & SEE_MASK_NO_CONSOLE)) dwCreationFlags |= CREATE_NEW_CONSOLE; startup.lpTitle = (LPWSTR)(psei->fMask & (SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE) ? psei->lpClass : NULL);