Author: hbelusca Date: Mon Mar 6 00:05:13 2017 New Revision: 74114
URL: http://svn.reactos.org/svn/reactos?rev=74114&view=rev Log: [REACTOS-CLT2017]: Sync with ROS 0.4.4 release branch. In particular the following fixes/hacks: - Apply the Wordpad related hack from CORE-5823 by Jared Smudde (r73624). - Disable COMMAND.COM debugging messages. CORE-10710 (r73625). - Add a hack by Thomas to avoid MmGetPhysicalAddress failures during USB transfers. CORE-9224 (r73627). - Apply the patch that allows us to dynamically change the resolution by resizing in VirtualBox. CORE-6742 (r73628). - Mask WndProc exceptions CORE-11915 (r73631).
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/ (props changed) branches/ReactOS-0.4.4-CLT2017/reactos/base/applications/wordpad/res/formatbar.bmp branches/ReactOS-0.4.4-CLT2017/reactos/base/applications/wordpad/res/toolbar.bmp branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbehci/ (props changed) branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbehci/usb_request.cpp branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbohci/ (props changed) branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbohci/usb_request.cpp branches/ReactOS-0.4.4-CLT2017/reactos/subsystems/mvdm/dos/command.S branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/device.c branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/device.h branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/pdevobj.c branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/user/ntuser/display.c branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/user/user32/windows/message.c
Propchange: branches/ReactOS-0.4.4-CLT2017/reactos/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Mar 6 00:05:13 2017 @@ -16,6 +16,7 @@ /branches/ros-amd64-bringup:36852 /branches/ros-amd64-bringup/reactos:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882 /branches/ros-branch-0_3_15-lt2013:59059 +/branches/ros-branch-0_4_4/reactos:73624-73625,73627-73628,73631 /branches/ros-csrss:57561-58762 /branches/shell-experiments:61927-65494 /branches/shell32_new-bringup:51893-53652,53661,53700
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/base/applications/wordpad/res/formatbar.bmp URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/ba... ============================================================================== Binary files - no diff available.
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/base/applications/wordpad/res/toolbar.bmp URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/ba... ============================================================================== Binary files - no diff available.
Propchange: branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbehci/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Mar 6 00:05:13 2017 @@ -19,6 +19,7 @@ /branches/ros-amd64-bringup/drivers/usb/usbehci_new:36852 /branches/ros-amd64-bringup/reactos/drivers/usb/usbehci:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882 /branches/ros-amd64-bringup/reactos/drivers/usb/usbehci_new:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882 +/branches/ros-branch-0_4_4/reactos/drivers/usb/usbehci:73627-73628,73631 /branches/shell32_new-bringup/drivers/usb/usbehci:51893-53652,53661,53700 /branches/shell32_new-bringup/drivers/usb/usbehci_new:51893-53652,53661,53700 /branches/tcp-rewrite-branch/drivers/usb/usbehci:48720,48840-48841,49424-49426,49454
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbehci/usb_request.cpp URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/dr... ============================================================================== --- branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbehci/usb_request.cpp [iso-8859-1] (original) +++ branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbehci/usb_request.cpp [iso-8859-1] Mon Mar 6 00:05:13 2017 @@ -601,6 +601,7 @@ // // get address // + *(volatile char *)TransferBuffer; // HACK for CORE-9224 Address = MmGetPhysicalAddress(TransferBuffer);
//
Propchange: branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbohci/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Mar 6 00:05:13 2017 @@ -14,6 +14,7 @@ /branches/ros-amd64-bringup/drivers/usb/usbohci:36852 /branches/ros-amd64-bringup/reactos/drivers/usb/usbehci_new:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882 /branches/ros-amd64-bringup/reactos/drivers/usb/usbohci:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882 +/branches/ros-branch-0_4_4/reactos/drivers/usb/usbohci:73627-73628,73631 /branches/shell32_new-bringup/drivers/usb/usbohci:51893-53652,53661,53700 /branches/tcp-rewrite-branch/drivers/usb/usbohci:48720,48840-48841,49424-49426,49454 /branches/usb-bringup/drivers/usb/usbohci:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-51850,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbohci/usb_request.cpp URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/dr... ============================================================================== --- branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] (original) +++ branches/ReactOS-0.4.4-CLT2017/reactos/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] Mon Mar 6 00:05:13 2017 @@ -771,6 +771,7 @@ // // get physical page // + *(volatile char *)Buffer; // HACK for CORE-9224 Page = MmGetPhysicalAddress(Buffer).LowPart;
//
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/subsystems/mvdm/dos/command.S URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/su... ============================================================================== --- branches/ReactOS-0.4.4-CLT2017/reactos/subsystems/mvdm/dos/command.S [iso-8859-1] (original) +++ branches/ReactOS-0.4.4-CLT2017/reactos/subsystems/mvdm/dos/command.S [iso-8859-1] Mon Mar 6 00:05:13 2017 @@ -17,7 +17,7 @@ #include "asmxtras.inc" #include <isvbop.inc>
-// #define NDEBUG +#define NDEBUG
/* DEFINES ********************************************************************/
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/device.c URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/wi... ============================================================================== --- branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/device.c [iso-8859-1] (original) +++ branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/device.c [iso-8859-1] Mon Mar 6 00:05:13 2017 @@ -30,99 +30,22 @@ return STATUS_SUCCESS; }
- -PGRAPHICS_DEVICE -NTAPI -EngpRegisterGraphicsDevice( - _In_ PUNICODE_STRING pustrDeviceName, - _In_ PUNICODE_STRING pustrDiplayDrivers, - _In_ PUNICODE_STRING pustrDescription, +BOOLEAN +EngpPopulateDeviceModeList( + _Inout_ PGRAPHICS_DEVICE pGraphicsDevice, _In_ PDEVMODEW pdmDefault) { - PGRAPHICS_DEVICE pGraphicsDevice; - PDEVICE_OBJECT pDeviceObject; - PFILE_OBJECT pFileObject; - NTSTATUS Status; PWSTR pwsz; - ULONG i, cj, cModes = 0; - SIZE_T cjWritten; - BOOL bEnable = TRUE; + PLDEVOBJ pldev; PDEVMODEINFO pdminfo; PDEVMODEW pdm, pdmEnd; - PLDEVOBJ pldev; + ULONG i, cModes = 0; BOOLEAN bModeMatch = FALSE;
- TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName); - - /* Allocate a GRAPHICS_DEVICE structure */ - pGraphicsDevice = ExAllocatePoolWithTag(PagedPool, - sizeof(GRAPHICS_DEVICE), - GDITAG_GDEVICE); - if (!pGraphicsDevice) - { - ERR("ExAllocatePoolWithTag failed\n"); - return NULL; - } - - /* Try to open the driver */ - Status = IoGetDeviceObjectPointer(pustrDeviceName, - FILE_READ_DATA | FILE_WRITE_DATA, - &pFileObject, - &pDeviceObject); - if (!NT_SUCCESS(Status)) - { - ERR("Could not open driver %wZ, 0x%lx\n", pustrDeviceName, Status); - ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); - return NULL; - } - - /* Enable the device */ - EngFileWrite(pFileObject, &bEnable, sizeof(BOOL), &cjWritten); - - /* Copy the device and file object pointers */ - pGraphicsDevice->DeviceObject = pDeviceObject; - pGraphicsDevice->FileObject = pFileObject; - - /* Copy device name */ - RtlStringCbCopyNW(pGraphicsDevice->szNtDeviceName, - sizeof(pGraphicsDevice->szNtDeviceName), - pustrDeviceName->Buffer, - pustrDeviceName->Length); - - /* Create a win device name (FIXME: virtual devices!) */ - swprintf(pGraphicsDevice->szWinDeviceName, L"\\.\DISPLAY%d", (int)giDevNum); - - /* Allocate a buffer for the strings */ - cj = pustrDiplayDrivers->Length + pustrDescription->Length + sizeof(WCHAR); - pwsz = ExAllocatePoolWithTag(PagedPool, cj, GDITAG_DRVSUP); - if (!pwsz) - { - ERR("Could not allocate string buffer\n"); - ASSERT(FALSE); // FIXME - ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); - return NULL; - } - - /* Copy display driver names */ - pGraphicsDevice->pDiplayDrivers = pwsz; - RtlCopyMemory(pGraphicsDevice->pDiplayDrivers, - pustrDiplayDrivers->Buffer, - pustrDiplayDrivers->Length); - - /* Copy description */ - pGraphicsDevice->pwszDescription = pwsz + pustrDiplayDrivers->Length / sizeof(WCHAR); - RtlCopyMemory(pGraphicsDevice->pwszDescription, - pustrDescription->Buffer, - pustrDescription->Length); - pGraphicsDevice->pwszDescription[pustrDescription->Length/sizeof(WCHAR)] = 0; - - /* Initialize the pdevmodeInfo list and default index */ - pGraphicsDevice->pdevmodeInfo = NULL; - pGraphicsDevice->iDefaultMode = 0; - pGraphicsDevice->iCurrentMode = 0; - - // FIXME: initialize state flags - pGraphicsDevice->StateFlags = 0; + ASSERT(pGraphicsDevice->pdevmodeInfo == NULL); + ASSERT(pGraphicsDevice->pDevModeList == NULL); + + pwsz = pGraphicsDevice->pDiplayDrivers;
/* Loop through the driver names * This is a REG_MULTI_SZ string */ @@ -138,7 +61,7 @@ }
/* Get the mode list from the driver */ - pdminfo = LDEVOBJ_pdmiGetModes(pldev, pDeviceObject); + pdminfo = LDEVOBJ_pdmiGetModes(pldev, pGraphicsDevice->DeviceObject); if (!pdminfo) { ERR("Could not get mode list for '%ls'\n", pwsz); @@ -170,8 +93,7 @@ if (!pGraphicsDevice->pdevmodeInfo || cModes == 0) { ERR("No devmodes\n"); - ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); - return NULL; + return FALSE; }
/* Allocate an index buffer */ @@ -182,8 +104,7 @@ if (!pGraphicsDevice->pDevModeList) { ERR("No devmode list\n"); - ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); - return NULL; + return FALSE; }
TRACE("Looking for mode %lux%lux%lu(%lu Hz)\n", @@ -232,7 +153,106 @@ pGraphicsDevice->pDevModeList[i].pdm = pdm; i++; } - } + } + return TRUE; +} + +PGRAPHICS_DEVICE +NTAPI +EngpRegisterGraphicsDevice( + _In_ PUNICODE_STRING pustrDeviceName, + _In_ PUNICODE_STRING pustrDiplayDrivers, + _In_ PUNICODE_STRING pustrDescription, + _In_ PDEVMODEW pdmDefault) +{ + PGRAPHICS_DEVICE pGraphicsDevice; + PDEVICE_OBJECT pDeviceObject; + PFILE_OBJECT pFileObject; + NTSTATUS Status; + PWSTR pwsz; + ULONG cj; + SIZE_T cjWritten; + BOOL bEnable = TRUE; + + TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName); + + /* Allocate a GRAPHICS_DEVICE structure */ + pGraphicsDevice = ExAllocatePoolWithTag(PagedPool, + sizeof(GRAPHICS_DEVICE), + GDITAG_GDEVICE); + if (!pGraphicsDevice) + { + ERR("ExAllocatePoolWithTag failed\n"); + return NULL; + } + + /* Try to open the driver */ + Status = IoGetDeviceObjectPointer(pustrDeviceName, + FILE_READ_DATA | FILE_WRITE_DATA, + &pFileObject, + &pDeviceObject); + if (!NT_SUCCESS(Status)) + { + ERR("Could not open driver %wZ, 0x%lx\n", pustrDeviceName, Status); + ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); + return NULL; + } + + /* Enable the device */ + EngFileWrite(pFileObject, &bEnable, sizeof(BOOL), &cjWritten); + + /* Copy the device and file object pointers */ + pGraphicsDevice->DeviceObject = pDeviceObject; + pGraphicsDevice->FileObject = pFileObject; + + /* Copy device name */ + RtlStringCbCopyNW(pGraphicsDevice->szNtDeviceName, + sizeof(pGraphicsDevice->szNtDeviceName), + pustrDeviceName->Buffer, + pustrDeviceName->Length); + + /* Create a win device name (FIXME: virtual devices!) */ + swprintf(pGraphicsDevice->szWinDeviceName, L"\\.\DISPLAY%d", (int)giDevNum); + + /* Allocate a buffer for the strings */ + cj = pustrDiplayDrivers->Length + pustrDescription->Length + sizeof(WCHAR); + pwsz = ExAllocatePoolWithTag(PagedPool, cj, GDITAG_DRVSUP); + if (!pwsz) + { + ERR("Could not allocate string buffer\n"); + ASSERT(FALSE); // FIXME + ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); + return NULL; + } + + /* Copy display driver names */ + pGraphicsDevice->pDiplayDrivers = pwsz; + RtlCopyMemory(pGraphicsDevice->pDiplayDrivers, + pustrDiplayDrivers->Buffer, + pustrDiplayDrivers->Length); + + /* Copy description */ + pGraphicsDevice->pwszDescription = pwsz + pustrDiplayDrivers->Length / sizeof(WCHAR); + RtlCopyMemory(pGraphicsDevice->pwszDescription, + pustrDescription->Buffer, + pustrDescription->Length); + pGraphicsDevice->pwszDescription[pustrDescription->Length/sizeof(WCHAR)] = 0; + + /* Initialize the pdevmodeInfo list and default index */ + pGraphicsDevice->pdevmodeInfo = NULL; + pGraphicsDevice->iDefaultMode = 0; + pGraphicsDevice->iCurrentMode = 0; + + // FIXME: initialize state flags + pGraphicsDevice->StateFlags = 0; + + /* Create the mode list */ + pGraphicsDevice->pDevModeList = NULL; + if (!EngpPopulateDeviceModeList(pGraphicsDevice, pdmDefault)) + { + ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); + return NULL; + }
/* Lock loader */ EngAcquireSemaphore(ghsemGraphicsDeviceList); @@ -250,7 +270,7 @@
/* Unlock loader */ EngReleaseSemaphore(ghsemGraphicsDeviceList); - TRACE("Prepared %lu modes for %ls\n", cModes, pGraphicsDevice->pwszDescription); + TRACE("Prepared %lu modes for %ls\n", pGraphicsDevice->cDevModes, pGraphicsDevice->pwszDescription);
return pGraphicsDevice; }
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/device.h URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/wi... ============================================================================== --- branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/device.h [iso-8859-1] (original) +++ branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/device.h [iso-8859-1] Mon Mar 6 00:05:13 2017 @@ -2,6 +2,11 @@ #pragma once
#define TAG_GDEV 'gdev' + +VOID +NTAPI +PDEVOBJ_vRefreshModeList( + PPDEVOBJ ppdev);
extern PGRAPHICS_DEVICE gpPrimaryGraphicsDevice; extern PGRAPHICS_DEVICE gpVgaGraphicsDevice; @@ -29,6 +34,11 @@ _In_ PUNICODE_STRING pustrDescription, _In_ PDEVMODEW pdmDefault);
+BOOLEAN +EngpPopulateDeviceModeList( + _Inout_ PGRAPHICS_DEVICE pGraphicsDevice, + _In_ PDEVMODEW pdmDefault); + INIT_FUNCTION NTSTATUS NTAPI
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/pdevobj.c URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/wi... ============================================================================== --- branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] (original) +++ branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] Mon Mar 6 00:05:13 2017 @@ -249,6 +249,45 @@
DPRINT("PDEVOBJ_pSurface() returning %p\n", ppdev->pSurface); return ppdev->pSurface; +} + +VOID +NTAPI +PDEVOBJ_vRefreshModeList( + PPDEVOBJ ppdev) +{ + PGRAPHICS_DEVICE pGraphicsDevice; + PDEVMODEINFO pdminfo, pdmiNext; + DEVMODEW dmDefault; + + /* Lock the PDEV */ + EngAcquireSemaphore(ppdev->hsemDevLock); + + pGraphicsDevice = ppdev->pGraphicsDevice; + + /* Remember our default mode */ + dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm; + + /* Clear out the modes */ + for (pdminfo = pGraphicsDevice->pdevmodeInfo; + pdminfo; + pdminfo = pdmiNext) + { + pdmiNext = pdminfo->pdmiNext; + ExFreePoolWithTag(pdminfo, GDITAG_DEVMODE); + } + pGraphicsDevice->pdevmodeInfo = NULL; + ExFreePoolWithTag(pGraphicsDevice->pDevModeList, GDITAG_GDEVICE); + pGraphicsDevice->pDevModeList = NULL; + + /* Now re-populate the list */ + if (!EngpPopulateDeviceModeList(pGraphicsDevice, &dmDefault)) + { + DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n"); + } + + /* Unlock PDEV */ + EngReleaseSemaphore(ppdev->hsemDevLock); }
PDEVMODEW
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/user/ntuser/display.c URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/wi... ============================================================================== --- branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/user/ntuser/display.c [iso-8859-1] (original) +++ branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/user/ntuser/display.c [iso-8859-1] Mon Mar 6 00:05:13 2017 @@ -463,19 +463,27 @@ PGRAPHICS_DEVICE pGraphicsDevice; PDEVMODEENTRY pdmentry; ULONG i, iFoundMode; + PPDEVOBJ ppdev;
TRACE("Enter UserEnumDisplaySettings('%wZ', %lu)\n", pustrDevice, iModeNum);
/* Ask GDI for the GRAPHICS_DEVICE */ pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0); - - if (!pGraphicsDevice) + ppdev = EngpGetPDEV(pustrDevice); + + if (!pGraphicsDevice || !ppdev) { /* No device found */ ERR("No device found!\n"); return STATUS_INVALID_PARAMETER_1; } + + /* let's politely ask the driver for an updated mode list, + just in case there's something new in there (vbox) */ + + PDEVOBJ_vRefreshModeList(ppdev); + PDEVOBJ_vRelease(ppdev);
iFoundMode = 0; for (i = 0; i < pGraphicsDevice->cDevModes; i++)
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/user/user32/windows/message.c URL: http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/wi... ============================================================================== --- branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/user/user32/windows/message.c [iso-8859-1] (original) +++ branches/ReactOS-0.4.4-CLT2017/reactos/win32ss/user/user32/windows/message.c [iso-8859-1] Mon Mar 6 00:05:13 2017 @@ -1464,20 +1464,15 @@
if (PreResult) goto Exit;
- if (!Dialog) - Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam); - else - { _SEH2_TRY { Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti); + ERR("Exception when calling Ansi WndProc %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti); } _SEH2_END; - }
if (Hook && MsgOverride) { @@ -1518,20 +1513,15 @@
if (PreResult) goto Exit;
- if (!Dialog) - Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam); - else - { _SEH2_TRY { Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti); + ERR("Exception when calling unicode WndProc %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti); } _SEH2_END; - }
if (Hook && MsgOverride) { @@ -1611,20 +1601,15 @@
if (PreResult) goto Exit;
- if (!Dialog) - Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam); - else - { _SEH2_TRY { Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti); + ERR("Exception when calling Ansi WndProc %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti); } _SEH2_END; - }
if (Hook && MsgOverride) { @@ -1672,20 +1657,15 @@
if (PreResult) goto Exit;
- if (!Dialog) - Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam); - else - { _SEH2_TRY { Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti); + ERR("Exception when calling unicode WndProc %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti); } _SEH2_END; - }
if (Hook && MsgOverride) {