ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
146 discussions
Start a n
N
ew thread
[fireball] 24296: - Change in CONNECT_DATA for drivers so that they get direct pointer to the raw configuration data returned by the device - Spelling fixes - More debug prints added to ease debugging - Added entries for mouse and keyboard drivers (keyboard is currently commented out) - Implemented actual usb mouse driver - contains 1 hack aimed to correct determining the endpoint. Driver fully works except for actually sending data to win32k/HID driver stack
by fireball@svn.reactos.org
Author: fireball Date: Fri Sep 29 13:08:20 2006 New Revision: 24296 URL:
http://svn.reactos.org/svn/reactos?rev=24296&view=rev
Log: - Change in CONNECT_DATA for drivers so that they get direct pointer to the raw configuration data returned by the device - Spelling fixes - More debug prints added to ease debugging - Added entries for mouse and keyboard drivers (keyboard is currently commented out) - Implemented actual usb mouse driver - contains 1 hack aimed to correct determining the endpoint. Driver fully works except for actually sending data to win32k/HID driver stack Added: trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.c trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.h Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/compdrv.c trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.h trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.h trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/compdrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/compdrv.c (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/compdrv.c Fri Sep 29 13:08:20 2006 @@ -370,7 +370,7 @@ TRAP(); } - // let's scan the interfacs for those we recognize + // let's scan the interfaces for those we recognize pconfig_desc = (PUSB_CONFIGURATION_DESC) buf; if (pconfig_desc->wTotalLength > 512) { @@ -386,6 +386,9 @@ usb_dbg_print(DBGLVL_MAXIMUM, ("compdev_select_driver(): error, dev does not exist\n")); return; } + + usb_dbg_print(DBGLVL_MAXIMUM, ("compdev_select_driver(): got %d interfaces\n", + (LONG)pconfig_desc->bNumInterfaces)); for(i = 0; i < (LONG) pconfig_desc->bNumInterfaces; i++) { @@ -407,6 +410,7 @@ param.dev_mgr = dev_mgr; param.pdriver = pcand; param.dev_handle = 0; + param.if_desc = pif_desc; pcand->disp_tbl.dev_connect(¶m, usb_make_handle(dev_id, i, 0)); } } Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c Fri Sep 29 13:08:20 2006 @@ -158,6 +158,12 @@ pdrvr[GEN_IF_DRIVER_IDX].driver_init = gendrv_if_driver_init; pdrvr[GEN_IF_DRIVER_IDX].driver_destroy = gendrv_if_driver_destroy; + + pdrvr[MOUSE_DRIVER_IDX].driver_init = mouse_driver_init; + pdrvr[MOUSE_DRIVER_IDX].driver_destroy = mouse_driver_destroy; + + //pdrvr[KEYBOARD_DRIVER_IDX].driver_init = gendrv_if_driver_init; + //pdrvr[KEYBOARD_DRIVER_IDX].driver_destroy = gendrv_if_driver_destroy; } BOOLEAN Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h Fri Sep 29 13:08:20 2006 @@ -6,6 +6,7 @@ DEV_HANDLE dev_handle; struct _USB_DRIVER *pdriver; struct _USB_DEV_MANAGER *dev_mgr; + PUSB_INTERFACE_DESC if_desc; } CONNECT_DATA, *PCONNECT_DATA; @@ -49,13 +50,15 @@ } USB_DRIVER_DESCRIPTION,*PUSB_DRIVER_DESCRIPTION; -#define DEVMGR_MAX_DRIVERS 6 +#define DEVMGR_MAX_DRIVERS 7//8 #define RH_DRIVER_IDX 0 #define HUB_DRIVER_IDX 1 #define UMSS_DRIVER_IDX 2 #define COMP_DRIVER_IDX 3 #define GEN_DRIVER_IDX 4 #define GEN_IF_DRIVER_IDX 5 +#define MOUSE_DRIVER_IDX 6 +#define KEYBOARD_DRIVER_IDX 7//temp disabled typedef struct _USB_DRIVER { Added: trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.c (added) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.c Fri Sep 29 13:08:20 2006 @@ -1,0 +1,365 @@ +/* + * PROJECT: ReactOS USB Drivers + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: mouse.c + * PURPOSE: Generic USB mouse driver + * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org) + */ + +#include "usbdriver.h" +#include "ntddmou.h" + +BOOLEAN mouse_connect(PCONNECT_DATA dev_mgr, DEV_HANDLE dev_handle); +BOOLEAN mouse_disconnect(PUSB_DEV_MANAGER dev_mgr, DEV_HANDLE dev_handle); +BOOLEAN mouse_stop(PUSB_DEV_MANAGER dev_mgr, DEV_HANDLE dev_handle); + +VOID mouse_irq(PURB purb, PVOID pcontext); +VOID mouse_set_cfg_completion(PURB purb, PVOID pcontext); + + +BOOLEAN +mouse_driver_init(PUSB_DEV_MANAGER dev_mgr, PUSB_DRIVER pdriver) +{ + PMOUSE_DRVR_EXTENSION pdrvr_ext; + + if (dev_mgr == NULL || pdriver == NULL) + return FALSE; + + //init driver structure, no PNP table functions + pdriver->driver_desc.flags = USB_DRIVER_FLAG_IF_CAPABLE; + pdriver->driver_desc.vendor_id = 0xffff; // USB Vendor ID + pdriver->driver_desc.product_id = 0xffff; // USB Product ID. + pdriver->driver_desc.release_num = 0x100; // Release Number of Device + + pdriver->driver_desc.config_val = 1; // Configuration Value + pdriver->driver_desc.if_num = 1; // Interface Number + pdriver->driver_desc.if_class = USB_CLASS_HID; // Interface Class + pdriver->driver_desc.if_sub_class = 1; // Interface SubClass + pdriver->driver_desc.if_protocol = 2; // Interface Protocol + + pdriver->driver_desc.driver_name = "USB Mouse driver"; // Driver name for Name Registry + pdriver->driver_desc.dev_class = USB_CLASS_HID; + pdriver->driver_desc.dev_sub_class = 1; // Device Subclass + pdriver->driver_desc.dev_protocol = 2; // Protocol Info. + + pdriver->driver_ext = usb_alloc_mem(NonPagedPool, sizeof(MOUSE_DRVR_EXTENSION)); + pdriver->driver_ext_size = sizeof(MOUSE_DRVR_EXTENSION); + + RtlZeroMemory(pdriver->driver_ext, sizeof(MOUSE_DRVR_EXTENSION)); + pdrvr_ext = (PMOUSE_DRVR_EXTENSION) pdriver->driver_ext; + pdrvr_ext->dev_mgr = dev_mgr; + + pdriver->disp_tbl.version = 1; + pdriver->disp_tbl.dev_connect = mouse_connect; + pdriver->disp_tbl.dev_disconnect = mouse_disconnect; + pdriver->disp_tbl.dev_stop = mouse_stop; + pdriver->disp_tbl.dev_reserved = NULL; + + usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_driver_init(): mouse driver is initialized\n")); + return TRUE; +} + +BOOLEAN +mouse_driver_destroy(PUSB_DEV_MANAGER dev_mgr, PUSB_DRIVER pdriver) +{ + //PMOUSE_DRVR_EXTENSION pdrvr_ext; + if (dev_mgr == NULL || pdriver == NULL) + return FALSE; + + //pdrvr_ext = (PUMSS_DRVR_EXTENSION) pdriver->driver_ext; + //umss_delete_port_device(pdrvr_ext->port_dev_obj); + //pdrvr_ext->port_dev_obj = NULL; + + //ASSERT(IsListEmpty(&pdrvr_ext->dev_list) == TRUE); + usb_free_mem(pdriver->driver_ext); + pdriver->driver_ext = NULL; + pdriver->driver_ext_size = 0; + usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_driver_destroy(): mouse driver is destroyed\n")); + return TRUE; +} + +BOOLEAN +mouse_connect(PCONNECT_DATA param, DEV_HANDLE dev_handle) +{ + PURB purb; + NTSTATUS status; + PUSB_DEV_MANAGER dev_mgr; + PUSB_DRIVER pdrvr; + PUSB_DEV pdev; + PMOUSE_DRVR_EXTENSION pdev_ext; +// LONG i; + PUSB_ENDPOINT_DESC pendp_desc = NULL; + ULONG MaxPacketSize; + + usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_connect(): entering...\n")); + + dev_mgr = param->dev_mgr; + pdrvr = param->pdriver; + pdev_ext = (PMOUSE_DRVR_EXTENSION)pdrvr->driver_ext; + + // Lock USB Device + status = usb_query_and_lock_dev(dev_mgr, dev_handle, &pdev); + if (status != STATUS_SUCCESS) + { + //usb_free_mem(desc_buf); + usb_dbg_print(DBGLVL_MEDIUM, ("mouse_connect(): unable to query&lock device, status=0x%x\n", status)); + return FALSE; + } + + // Endpoint-finding code + if (param->if_desc) + { + // Get a pointer to the config packet from compdev + PUCHAR Buffer = (PUCHAR)param->if_desc; + ULONG Offset = 0; + BOOLEAN FoundEndpoint = FALSE; + + // Find our the only needed endpoint descriptor + while (Offset < 512) + { + pendp_desc = (PUSB_ENDPOINT_DESC)&Buffer[Offset]; + usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_connect(): DescType=0x%x, Attrs=0x%x, Len=%d\n", + pendp_desc->bDescriptorType, pendp_desc->bmAttributes, pendp_desc->bLength)); + + if (pendp_desc->bDescriptorType == USB_DT_ENDPOINT && + pendp_desc->bLength == sizeof(USB_ENDPOINT_DESC)) + { + // Found it + FoundEndpoint = TRUE; + break; + } + + Offset += pendp_desc->bLength; + } + + if (!FoundEndpoint) + return FALSE; + + // FIXME: Check if it's INT endpoint + // (pendp_desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) + + // endpoint must be IN + if ((pendp_desc->bEndpointAddress & USB_DIR_IN) == 0) + return FALSE; + } + + + // Endpoint descriptor substitution code + { + ULONG if_idx, endp_idx; + PUSB_ENDPOINT pendp; + + //FoundEndpoint = FALSE; + for(if_idx = 0; if_idx < MAX_INTERFACES_PER_CONFIG /*pdev->usb_config->if_count*/; if_idx++) + { + for(endp_idx = 0; endp_idx < MAX_ENDPS_PER_IF /*pdev->usb_config->interf[if_idx].endp_count*/; endp_idx++) + { + pendp = &pdev->usb_config->interf[if_idx].endp[endp_idx]; + + if (pendp->pusb_endp_desc != NULL) + { + //HACKHACK: for some reason this usb driver chooses different and completely wrong + // endpoint. Since I don't have time to research this, I just find the + // endpoint descriptor myself and copy it + memcpy(pendp->pusb_endp_desc, pendp_desc, pendp_desc->bLength); + + usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_connect(): [%i][%i] DescType=0x%x, Attrs=0x%x, Len=%d\n",if_idx, endp_idx, + pendp->pusb_endp_desc->bDescriptorType, pendp->pusb_endp_desc->bmAttributes, pendp->pusb_endp_desc->bLength)); + } + } + } + } + + // Unlock USB Device + usb_unlock_dev(pdev); + + // Send URB + purb = usb_alloc_mem(NonPagedPool, sizeof(URB)); + if (purb == NULL) + return FALSE; + RtlZeroMemory(purb, sizeof(URB)); + + MaxPacketSize = pendp_desc->wMaxPacketSize; + if (MaxPacketSize > 8) + MaxPacketSize = 8; + + // Build a URB for our interrupt transfer + UsbBuildInterruptOrBulkTransferRequest(purb, + usb_make_handle((dev_handle >> 16), 0, 0), + (PUCHAR)&pdev_ext->mouse_data, + MaxPacketSize, //use max packet size + mouse_irq, + pdev_ext, + 0); + + // Call USB driver stack + status = usb_submit_urb(pdev_ext->dev_mgr, purb); + if (status != STATUS_PENDING) + { + usb_free_mem(purb); + purb = NULL; + } + + return TRUE; +} + +// pcontext == device extension +VOID +mouse_set_cfg_completion(PURB purb, PVOID pcontext) +{ + PMOUSE_DRVR_EXTENSION pdev_ext = (PMOUSE_DRVR_EXTENSION)pcontext; + DEV_HANDLE endp_handle; + NTSTATUS status; + + if (purb->status != STATUS_SUCCESS) + { + usb_free_mem(purb); + return; + } + + endp_handle = purb->endp_handle; + + //usb_free_mem(purb); + //purb = NULL; + + usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_set_cfg_completion() endpoint handle=0x%x\n", endp_handle)); + + // Build a URB for our interrupt transfer + UsbBuildInterruptOrBulkTransferRequest(purb, + endp_handle, + /*usb_make_handle((pdev_ext->dev_handle >> 16), pdev_ext->if_idx, + pdev_ext->int_endp_idx),*/ + (PUCHAR)&pdev_ext->mouse_data, + 4, // FIXME: use max packet size! + mouse_irq, + pdev_ext, + 0); + + // Call USB driver stack + status = usb_submit_urb(pdev_ext->dev_mgr, purb); + if (status != STATUS_PENDING) + { + usb_free_mem(purb); + purb = NULL; + } +} + + +VOID +mouse_irq(PURB purb, PVOID pcontext) +{ + MOUSE_INPUT_DATA MouseInputData; + //ULONG InputDataConsumed; + NTSTATUS status; + PMOUSE_DRVR_EXTENSION pdev_ext = (PMOUSE_DRVR_EXTENSION)pcontext; + signed char *data = pdev_ext->mouse_data; + usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_irq(): called\n")); + + ASSERT(purb); + + if (purb->status != STATUS_SUCCESS) + { + usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_irq(): purb->status 0x%08X\n", purb->status)); + //return; + } + + usb_dbg_print(DBGLVL_MAXIMUM, ("Mouse input: x %d, y %d, w %d, btn: 0x%02x\n", data[1], data[2], data[3], data[0])); + + // Fill mouse input data structure + MouseInputData.Flags = MOUSE_MOVE_RELATIVE; + MouseInputData.LastX = data[1]; + MouseInputData.LastY = data[2]; + + MouseInputData.ButtonFlags = 0; + MouseInputData.ButtonData = 0; + + if ((data[0] & 0x01) && ((pdev_ext->btn_old & 0x01) != (data[0] & 0x01))) + MouseInputData.ButtonFlags |= MOUSE_LEFT_BUTTON_DOWN; + else if (!(data[0] & 0x01) && ((pdev_ext->btn_old & 0x01) != (data[0] & 0x01))) + MouseInputData.ButtonFlags |= MOUSE_LEFT_BUTTON_UP; + + if ((data[0] & 0x02) && ((pdev_ext->btn_old & 0x02) != (data[0] & 0x02))) + MouseInputData.ButtonFlags |= MOUSE_RIGHT_BUTTON_DOWN; + else if (!(data[0] & 0x02) && ((pdev_ext->btn_old & 0x02) != (data[0] & 0x02))) + MouseInputData.ButtonFlags |= MOUSE_RIGHT_BUTTON_UP; + + if ((data[0] & 0x04) && ((pdev_ext->btn_old & 0x04) != (data[0] & 0x04))) + MouseInputData.ButtonFlags |= MOUSE_MIDDLE_BUTTON_DOWN; + else if (!(data[0] & 0x04) && ((pdev_ext->btn_old & 0x04) != (data[0] & 0x04))) + MouseInputData.ButtonFlags |= MOUSE_MIDDLE_BUTTON_UP; + + if ((data[0] & 0x08) && ((pdev_ext->btn_old & 0x08) != (data[0] & 0x08))) + MouseInputData.ButtonFlags |= MOUSE_BUTTON_4_DOWN; + else if (!(data[0] & 0x08) && ((pdev_ext->btn_old & 0x08) != (data[0] & 0x08))) + MouseInputData.ButtonFlags |= MOUSE_BUTTON_4_UP; + + if ((data[0] & 0x10) && ((pdev_ext->btn_old & 0x10) != (data[0] & 0x10))) + MouseInputData.ButtonFlags |= MOUSE_BUTTON_5_DOWN; + else if (!(data[0] & 0x10) && ((pdev_ext->btn_old & 0x10) != (data[0] & 0x10))) + MouseInputData.ButtonFlags |= MOUSE_BUTTON_5_UP; + + if (data[3]) + { + MouseInputData.ButtonFlags |= MOUSE_WHEEL; + MouseInputData.ButtonData = data[3]; + } + + // Commit the input data somewhere... + /*if (UsbPortInterface.MouseConnectData->ClassService) + { + KIRQL OldIrql; + + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + (*(PSERVICE_CALLBACK_ROUTINE)UsbPortInterface.MouseConnectData->ClassService)( + UsbPortInterface.MouseConnectData->ClassDeviceObject, + &MouseInputData, + (&MouseInputData)+1, + &InputDataConsumed); + KeLowerIrql(OldIrql); + }*/ + + // Save old button data + pdev_ext->btn_old = data[0]; + + // resubmit the urb + status = usb_submit_urb(pdev_ext->dev_mgr, purb); +} + +BOOLEAN +mouse_stop(PUSB_DEV_MANAGER dev_mgr, DEV_HANDLE dev_handle) +{ + UNREFERENCED_PARAMETER(dev_handle); + UNREFERENCED_PARAMETER(dev_mgr); + return TRUE; +} + +BOOLEAN +mouse_disconnect(PUSB_DEV_MANAGER dev_mgr, DEV_HANDLE dev_handle) +{ + PDEVICE_OBJECT dev_obj; + NTSTATUS status; + PUSB_DEV pdev; + PUSB_DRIVER pdrvr; + + if (dev_mgr == NULL || dev_handle == 0) + return FALSE; + + pdev = NULL; + //special use of the lock dev, simply use this routine to get the dev + status = usb_query_and_lock_dev(dev_mgr, dev_handle, &pdev); + if (pdev == NULL) + { + return FALSE; + } + if (status == STATUS_SUCCESS) + { + // must be a bug + TRAP(); + usb_unlock_dev(pdev); + } + pdrvr = pdev->dev_driver; + dev_obj = pdev->dev_obj; + pdev = NULL; + + return TRUE;//umss_delete_device(dev_mgr, pdrvr, dev_obj, FALSE); +} Added: trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.h (added) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.h Fri Sep 29 13:08:20 2006 @@ -1,0 +1,23 @@ +#ifndef __MOUSE_H__ +#define __MOUSE_H__ + +typedef struct _MOUSE_DRVR_EXTENSION +{ + //INTERRUPT_DATA_BLOCK idb; + PUSB_INTERFACE_DESC pif_desc; + UCHAR if_idx, out_endp_idx, in_endp_idx, int_endp_idx; + PUSB_ENDPOINT_DESC pout_endp_desc, pin_endp_desc, pint_endp_desc; + + PUSB_DEV_MANAGER dev_mgr; + signed char mouse_data[8]; + UCHAR btn_old; +} MOUSE_DRVR_EXTENSION, *PMOUSE_DRVR_EXTENSION; + + +BOOLEAN +mouse_driver_init(PUSB_DEV_MANAGER dev_mgr, PUSB_DRIVER pdriver); + +BOOLEAN +mouse_driver_destroy(PUSB_DEV_MANAGER dev_mgr, PUSB_DRIVER pdriver); + +#endif Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c Fri Sep 29 13:08:20 2006 @@ -1241,6 +1241,8 @@ } // if can_submit is STATUS_SUCCESS, the purb is inserted into the schedule + uhci_dbg_print(DBGLVL_MAXIMUM, ("uhci_process_pending_endp(): endp_type=0x%x\n", + endp_type(pendp))); switch (endp_type(pendp)) { case USB_ENDPOINT_XFER_BULK: Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c Fri Sep 29 13:08:20 2006 @@ -781,7 +781,6 @@ return status; } - void usb_config_dev_completion(PURB purb, PVOID context) { Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.h (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.h Fri Sep 29 13:08:20 2006 @@ -955,6 +955,15 @@ PURB purb ); +void usb_fill_int_urb(PURB urb, + struct _USB_DEV *dev, + ULONG pipe, + PVOID transfer_buffer, + LONG buffer_length, + PURBCOMPLETION complete, + PVOID context, + int interval); + LONG usb_calc_bus_time( LONG low_speed, Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.h (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.h Fri Sep 29 13:08:20 2006 @@ -26,4 +26,5 @@ #include "devmgr.h" #include "hub.h" #include "umss.h" +#include "mouse.h" #include "uhciver.h" Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild Fri Sep 29 13:08:20 2006 @@ -18,6 +18,7 @@ <file>compdrv.c</file> <file>etd.c</file> <file>gendrv.c</file> + <file>mouse.c</file> <file>usbdriver.rc</file> <pch>usbdriver.h</pch> </module>
18 years, 2 months
1
0
0
0
[gedmurphy] 24295: change run icon as a few people wanted something more fitting and add 2 more icons to the system imagelist
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Sep 29 02:57:09 2006 New Revision: 24295 URL:
http://svn.reactos.org/svn/reactos?rev=24295&view=rev
Log: change run icon as a few people wanted something more fitting and add 2 more icons to the system imagelist Added: trunk/reactos/dll/win32/shell32/res/icons/134.ico (with props) trunk/reactos/dll/win32/shell32/res/icons/40.ico (with props) Modified: trunk/reactos/dll/win32/shell32/icon_res.rc trunk/reactos/dll/win32/shell32/res/icons/25.ico trunk/reactos/dll/win32/shell32/res/icons/328.ico trunk/reactos/dll/win32/shell32/shresdef.h Modified: trunk/reactos/dll/win32/shell32/icon_res.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/icon_res…
============================================================================== --- trunk/reactos/dll/win32/shell32/icon_res.rc (original) +++ trunk/reactos/dll/win32/shell32/icon_res.rc Fri Sep 29 02:57:09 2006 @@ -33,6 +33,7 @@ IDI_SHELL_PROGRAMS_FOLDER2 ICON "res/icons/37.ico" IDI_SHELL_PRINTERS_FOLDER ICON "res/icons/38.ico" IDI_SHELL_FONTS_FOLDER ICON "res/icons/39.ico" +IDI_SHELL_TSKBAR_STARTMENU ICON "res/icons/40.ico" IDI_SHELL_CD_MUSIC ICON "res/icons/41.ico" IDI_SHELL_FAVORITES ICON "res/icons/44.ico" IDI_SHELL_LOGOFF ICON "res/icons/45.ico" @@ -40,6 +41,7 @@ // "res/icons/47.ico" IDI_SHELL_LOCKED ICON "res/icons/48.ico" // "res/icons/54.ico" +IDI_SHELL_FIND_IN_FILE ICON "res/icons/134.ico" IDI_SHELL_CONTROL_PANEL3 ICON "res/icons/137.ico" IDI_SHELL_PRINTER2 ICON "res/icons/138.ico" IDI_SHELL_INF_FILE ICON "res/icons/151.ico" Added: trunk/reactos/dll/win32/shell32/res/icons/134.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/icon…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shell32/res/icons/134.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: trunk/reactos/dll/win32/shell32/res/icons/25.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/icon…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/dll/win32/shell32/res/icons/328.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/icon…
============================================================================== Binary files - no diff available. Added: trunk/reactos/dll/win32/shell32/res/icons/40.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/icon…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shell32/res/icons/40.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: trunk/reactos/dll/win32/shell32/shresdef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shresdef…
============================================================================== --- trunk/reactos/dll/win32/shell32/shresdef.h (original) +++ trunk/reactos/dll/win32/shell32/shresdef.h Fri Sep 29 02:57:09 2006 @@ -133,12 +133,15 @@ #define IDI_SHELL_PROGRAMS_FOLDER2 37 #define IDI_SHELL_PRINTERS_FOLDER 38 #define IDI_SHELL_FONTS_FOLDER 39 +#define IDI_SHELL_TSKBAR_STARTMENU 40 #define IDI_SHELL_CD_MUSIC 41 #define IDI_SHELL_FAVORITES 44 #define IDI_SHELL_LOGOFF 45 #define IDI_SHELL_EXPLORER 46 #define IDI_SHELL_LOCKED 48 + +#define IDI_SHELL_FIND_IN_FILE 134 #define IDI_SHELL_CONTROL_PANEL3 137 #define IDI_SHELL_PRINTER2 138
18 years, 2 months
1
0
0
0
[gedmurphy] 24294: new timedate and powercfg icons
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Sep 29 02:14:00 2006 New Revision: 24294 URL:
http://svn.reactos.org/svn/reactos?rev=24294&view=rev
Log: new timedate and powercfg icons Modified: trunk/reactos/dll/cpl/powercfg/resources/ac.ico trunk/reactos/dll/cpl/timedate/resources/applet.ico Modified: trunk/reactos/dll/cpl/powercfg/resources/ac.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/powercfg/resources…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/dll/cpl/timedate/resources/applet.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/resources…
============================================================================== Binary files - no diff available.
18 years, 2 months
1
0
0
0
[gedmurphy] 24293: rename folder to make it clear
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Sep 29 02:03:03 2006 New Revision: 24293 URL:
http://svn.reactos.org/svn/reactos?rev=24293&view=rev
Log: rename folder to make it clear Added: trunk/reactos/dll/win32/shell32/res/icons/Icon_Licence/ - copied from r24292, trunk/reactos/dll/win32/shell32/res/icons/Licence/ Removed: trunk/reactos/dll/win32/shell32/res/icons/Licence/
18 years, 2 months
1
0
0
0
[gedmurphy] 24292: fix the floppy icons and add 2 new ones for network drives.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Sep 29 02:01:07 2006 New Revision: 24292 URL:
http://svn.reactos.org/svn/reactos?rev=24292&view=rev
Log: fix the floppy icons and add 2 new ones for network drives. Modified: trunk/reactos/dll/win32/shell32/res/icons/10.ico trunk/reactos/dll/win32/shell32/res/icons/11.ico trunk/reactos/dll/win32/shell32/res/icons/6.ico trunk/reactos/dll/win32/shell32/res/icons/7.ico Modified: trunk/reactos/dll/win32/shell32/res/icons/10.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/icon…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/dll/win32/shell32/res/icons/11.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/icon…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/dll/win32/shell32/res/icons/6.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/icon…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/dll/win32/shell32/res/icons/7.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/icon…
============================================================================== Binary files - no diff available.
18 years, 2 months
1
0
0
0
[gedmurphy] 24291: - Reserve enough space on the heap to store the GUID - Thanks to Thomas for restoring my sanity
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Sep 29 01:36:12 2006 New Revision: 24291 URL:
http://svn.reactos.org/svn/reactos?rev=24291&view=rev
Log: - Reserve enough space on the heap to store the GUID - Thanks to Thomas for restoring my sanity Modified: trunk/reactos/base/applications/devmgmt/enumdevices.c Modified: trunk/reactos/base/applications/devmgmt/enumdevices.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/enumdevices.c (original) +++ trunk/reactos/base/applications/devmgmt/enumdevices.c Fri Sep 29 01:36:12 2006 @@ -151,7 +151,9 @@ if (!bRet) { - guids = HeapAlloc(GetProcessHeap(), 0, RequiredSize); + guids = HeapAlloc(GetProcessHeap(), + 0, + RequiredSize * sizeof(GUID)); if (guids == NULL) return -1;
18 years, 2 months
1
0
0
0
[gedmurphy] 24290: clean up irregularities
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Sep 29 01:15:51 2006 New Revision: 24290 URL:
http://svn.reactos.org/svn/reactos?rev=24290&view=rev
Log: clean up irregularities Modified: trunk/reactos/base/applications/devmgmt/about.c trunk/reactos/base/applications/devmgmt/devmgmt.rbuild trunk/reactos/base/applications/devmgmt/devmgmt.rc trunk/reactos/base/applications/devmgmt/enumdevices.c trunk/reactos/base/applications/devmgmt/mainwnd.c trunk/reactos/base/applications/devmgmt/misc.c Modified: trunk/reactos/base/applications/devmgmt/about.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/about.c (original) +++ trunk/reactos/base/applications/devmgmt/about.c Fri Sep 29 01:15:51 2006 @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Services + * PROJECT: ReactOS Device Managment * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/devmgmt/about.c * PURPOSE: About dialog box message handler Modified: trunk/reactos/base/applications/devmgmt/devmgmt.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/devmgmt.rbuild (original) +++ trunk/reactos/base/applications/devmgmt/devmgmt.rbuild Fri Sep 29 01:15:51 2006 @@ -2,12 +2,12 @@ <rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> <module name="devmgmt" type="win32gui" installbase="system32" installname="devmgmt.exe"> <include base="devmgmt">.</include> - <define name="UNICODE" /> - <define name="_UNICODE" /> - <define name="__REACTOS__" /> - <define name="__USE_W32API" /> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x501</define> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="__REACTOS__" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> <library>ntdll</library> <library>setupapi</library> <library>gdi32</library> Modified: trunk/reactos/base/applications/devmgmt/devmgmt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/devmgmt.rc (original) +++ trunk/reactos/base/applications/devmgmt/devmgmt.rc Fri Sep 29 01:15:51 2006 @@ -5,11 +5,11 @@ #define REACTOS_STR_FILE_DESCRIPTION "ReactOS Device Manager\0" #define REACTOS_STR_INTERNAL_NAME "devmgmt\0" #define REACTOS_STR_ORIGINAL_FILENAME "devmgmt.exe\0" -//#include <reactos/version.rc> +#include <reactos/version.rc> LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -//1 24 DISCARDABLE "manifest.xml" +1 24 DISCARDABLE "manifest.xml" STRINGTABLE DISCARDABLE BEGIN Modified: trunk/reactos/base/applications/devmgmt/enumdevices.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/enumdevices.c (original) +++ trunk/reactos/base/applications/devmgmt/enumdevices.c Fri Sep 29 01:15:51 2006 @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Services + * PROJECT: ReactOS Device Managment * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/devmgmt/enumdevices.c * PURPOSE: Enumerates all devices on the local machine Modified: trunk/reactos/base/applications/devmgmt/mainwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/mainwnd.c (original) +++ trunk/reactos/base/applications/devmgmt/mainwnd.c Fri Sep 29 01:15:51 2006 @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Services + * PROJECT: ReactOS Device Managment * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/devmgmt/mainwnd.c * PURPOSE: Main window message handler Modified: trunk/reactos/base/applications/devmgmt/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/misc.c (original) +++ trunk/reactos/base/applications/devmgmt/misc.c Fri Sep 29 01:15:51 2006 @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Services + * PROJECT: ReactOS Device Managment * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/devmgmt/misc.c * PURPOSE: miscallanous functions
18 years, 2 months
1
0
0
0
[gedmurphy] 24289: Initial development of a devmgmt.msc clone. Unusable at the moment though.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Sep 29 00:05:17 2006 New Revision: 24289 URL:
http://svn.reactos.org/svn/reactos?rev=24289&view=rev
Log: Initial development of a devmgmt.msc clone. Unusable at the moment though. Added: trunk/reactos/base/applications/devmgmt/ trunk/reactos/base/applications/devmgmt/En.rc trunk/reactos/base/applications/devmgmt/about.c trunk/reactos/base/applications/devmgmt/devmgmt.c trunk/reactos/base/applications/devmgmt/devmgmt.rbuild trunk/reactos/base/applications/devmgmt/devmgmt.rc trunk/reactos/base/applications/devmgmt/enumdevices.c trunk/reactos/base/applications/devmgmt/mainwnd.c trunk/reactos/base/applications/devmgmt/manifest.xml trunk/reactos/base/applications/devmgmt/misc.c trunk/reactos/base/applications/devmgmt/precomp.h trunk/reactos/base/applications/devmgmt/res/ trunk/reactos/base/applications/devmgmt/res/computer.ico (with props) trunk/reactos/base/applications/devmgmt/res/exit.bmp (with props) trunk/reactos/base/applications/devmgmt/res/help.bmp (with props) trunk/reactos/base/applications/devmgmt/res/properties.bmp (with props) trunk/reactos/base/applications/devmgmt/res/refresh.bmp (with props) trunk/reactos/base/applications/devmgmt/res/root.bmp (with props) trunk/reactos/base/applications/devmgmt/resource.h Added: trunk/reactos/base/applications/devmgmt/En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/En.rc (added) +++ trunk/reactos/base/applications/devmgmt/En.rc Fri Sep 29 00:05:17 2006 @@ -1,0 +1,72 @@ +IDR_MAINMENU MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "E&xit", IDC_EXIT + END + POPUP "Action" + BEGIN + MENUITEM "Print", IDC_PRINT, GRAYED + MENUITEM SEPARATOR + MENUITEM "Properties...", IDC_PROP + MENUITEM SEPARATOR + MENUITEM "Help", IDC_PROGHELP, GRAYED + END + POPUP "Help" + BEGIN + MENUITEM "Help", IDC_PROGHELP + MENUITEM "About", IDC_ABOUT + END +END + +IDR_POPUP MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "Properties...", IDC_PROP, GRAYED + MENUITEM SEPARATOR + MENUITEM "Help", IDC_PROGHELP + END +END + +IDD_ABOUTBOX DIALOGEX 22,16,190,182 +CAPTION "About Device Manager" +FONT 8,"Tahoma",0,0 +STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + LTEXT "Device Manager v0.1\nCopyright (C) 2006\nby Ged Murphy (gedmurphy(a)gmail.com)", IDC_STATIC, 48, 7, 130, 26 + PUSHBUTTON "Close", IDOK, 75, 162, 44, 15 + ICON IDI_MAIN_ICON, IDC_STATIC, 10, 10, 7, 30 + EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program 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 General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP_PROP "Properties" + IDS_TOOLTIP_REFRESH "Refresh" + IDS_TOOLTIP_HELP "Help" + IDS_TOOLTIP_EXIT "Exit" +END + +/* Hints */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HINT_BLANK " " + IDS_HINT_EXIT " Exits the program." + IDS_HINT_REFRESH " Refresh the service list." + IDS_HINT_PROP " Open property sheet for the current selection." + IDS_HINT_HELP " Display help window." + IDS_HINT_ABOUT " About ReactOS Device Manager." + + IDS_HINT_SYS_RESTORE " Restores this window to normal size." + IDS_HINT_SYS_MOVE " Moves this window." + IDS_HINT_SYS_SIZE " Resizes this window." + IDS_HINT_SYS_MINIMIZE " Collapses this window to an icon." + IDS_HINT_SYS_MAXIMIZE " Expands this window to fill this screen." + IDS_HINT_SYS_CLOSE " Closes this window." +END Added: trunk/reactos/base/applications/devmgmt/about.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/about.c (added) +++ trunk/reactos/base/applications/devmgmt/about.c Fri Sep 29 00:05:17 2006 @@ -1,0 +1,62 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/devmgmt/about.c + * PURPOSE: About dialog box message handler + * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + +#include "precomp.h" + +BOOL CALLBACK +AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + HWND hLicenseEditWnd; + HICON hIcon = NULL; + TCHAR strLicense[700]; + + switch (message) + { + case WM_INITDIALOG: + + hIcon = LoadImage(hInstance, + MAKEINTRESOURCE(IDI_MAIN_ICON), + IMAGE_ICON, + 16, + 16, + 0); + + SendMessage(hDlg, + WM_SETICON, + ICON_SMALL, + (LPARAM)hIcon); + + hLicenseEditWnd = GetDlgItem(hDlg, + IDC_LICENSE_EDIT); + + LoadString(hInstance, + IDS_LICENSE, + strLicense, + sizeof(strLicense) / sizeof(TCHAR)); + + SetWindowText(hLicenseEditWnd, + strLicense); + + return TRUE; + + case WM_COMMAND: + + if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) + { + DestroyIcon(hIcon); + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; + } + + break; + } + + return FALSE; +} Added: trunk/reactos/base/applications/devmgmt/devmgmt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/devmgmt.c (added) +++ trunk/reactos/base/applications/devmgmt/devmgmt.c Fri Sep 29 00:05:17 2006 @@ -1,0 +1,67 @@ +/* + * PROJECT: ReactOS Device Managment + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/devmgmt/devmgmt.c + * PURPOSE: Program HQ + * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + +#include "precomp.h" + +HINSTANCE hInstance; +HANDLE ProcessHeap; + +int WINAPI +WinMain(HINSTANCE hThisInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + LPTSTR lpAppName; + HWND hMainWnd; + MSG Msg; + int Ret = 1; + INITCOMMONCONTROLSEX icex; + + hInstance = hThisInstance; + ProcessHeap = GetProcessHeap(); + + icex.dwSize = sizeof(INITCOMMONCONTROLSEX); + icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES; + InitCommonControlsEx(&icex); + + if (!AllocAndLoadString(&lpAppName, + hInstance, + IDS_APPNAME)) + { + return 1; + } + + if (InitMainWindowImpl()) + { + hMainWnd = CreateMainWindow(lpAppName, + nCmdShow); + if (hMainWnd != NULL) + { + /* pump the message queue */ + while( GetMessage( &Msg, NULL, 0, 0 ) ) + { + TranslateMessage(&Msg); + DispatchMessage(&Msg); + + } + + Ret = 0; + } + + UninitMainWindowImpl(); + } + + LocalFree((HLOCAL)lpAppName); + + return Ret; +} + + + Added: trunk/reactos/base/applications/devmgmt/devmgmt.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/devmgmt.rbuild (added) +++ trunk/reactos/base/applications/devmgmt/devmgmt.rbuild Fri Sep 29 00:05:17 2006 @@ -1,0 +1,28 @@ +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="devmgmt" type="win32gui" installbase="system32" installname="devmgmt.exe"> + <include base="devmgmt">.</include> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="__REACTOS__" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> + <library>ntdll</library> + <library>setupapi</library> + <library>gdi32</library> + <library>kernel32</library> + <library>user32</library> + <library>comctl32</library> + <library>advapi32</library> + <compilationunit name="unit.c"> + <file>about.c</file> + <file>devmgmt.c</file> + <file>enumdevices.c</file> + <file>mainwnd.c</file> + <file>misc.c</file> + </compilationunit> + <file>devmgmt.rc</file> + <pch>precomp.h</pch> + </module> +</rbuild> Added: trunk/reactos/base/applications/devmgmt/devmgmt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/devmgmt.rc (added) +++ trunk/reactos/base/applications/devmgmt/devmgmt.rc Fri Sep 29 00:05:17 2006 @@ -1,0 +1,29 @@ +#include <windows.h> +#include <commctrl.h> +#include "resource.h" + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Device Manager\0" +#define REACTOS_STR_INTERNAL_NAME "devmgmt\0" +#define REACTOS_STR_ORIGINAL_FILENAME "devmgmt.exe\0" +//#include <reactos/version.rc> + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +//1 24 DISCARDABLE "manifest.xml" + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPNAME "ReactOS Device Manager" +END + +IDI_MAIN_ICON ICON "res/computer.ico" +IDB_ROOT_IMAGE BITMAP "res/root.bmp" + +/* main toolbar icons */ +IDB_PROP BITMAP DISCARDABLE "res/properties.bmp" +IDB_REFRESH BITMAP DISCARDABLE "res/refresh.bmp" +IDB_HELP BITMAP DISCARDABLE "res/help.bmp" +IDB_EXIT BITMAP DISCARDABLE "res/exit.bmp" + + +#include "En.rc" Added: trunk/reactos/base/applications/devmgmt/enumdevices.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/enumdevices.c (added) +++ trunk/reactos/base/applications/devmgmt/enumdevices.c Fri Sep 29 00:05:17 2006 @@ -1,0 +1,356 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/devmgmt/enumdevices.c + * PURPOSE: Enumerates all devices on the local machine + * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + +#include "precomp.h" + +SP_CLASSIMAGELIST_DATA ImageListData; + + +static HTREEITEM +InsertIntoTreeView(HWND hTV, + HTREEITEM hRoot, + LPTSTR lpLabel, + INT DevImage) +{ + TV_ITEM tvi; + TV_INSERTSTRUCT tvins; + + ZeroMemory(&tvi, sizeof(tvi)); + ZeroMemory(&tvins, sizeof(tvins)); + + tvi.mask = TVIF_TEXT | TVIF_IMAGE; + tvi.pszText = lpLabel; + tvi.cchTextMax = lstrlen(lpLabel); + tvi.iImage = DevImage; + tvi.iSelectedImage = DevImage; + + tvins.item = tvi; + tvins.hInsertAfter = hRoot; + + return TreeView_InsertItem(hTV, &tvins); +} + + +static INT +EnumDeviceClasses(INT ClassIndex, + TCHAR *DeviceClassName, + TCHAR *DeviceClassDesc, + BOOL *DevicePresent, + INT *ClassImage) +{ + GUID ClassGuid; + HKEY KeyClass; + HDEVINFO hDevInfo; + TCHAR ClassName[MAX_CLASS_NAME_LEN]; + DWORD RequiredSize = MAX_CLASS_NAME_LEN; + UINT Ret; + + *DevicePresent = FALSE; + + Ret = CM_Enumerate_Classes(ClassIndex, + &ClassGuid, + 0); + if (Ret != CR_SUCCESS) + { + /* all classes enumerated */ + if(Ret == CR_NO_SUCH_VALUE) + return -1; + + if (Ret == CR_INVALID_DATA) + ; /*FIXME: what should we do here? */ + + /* handle other errors... */ + } + + if (SetupDiClassNameFromGuid(&ClassGuid, + ClassName, + RequiredSize, + &RequiredSize)) + { + lstrcpy(DeviceClassName, ClassName); + } + else + { + *DeviceClassName = _T('\0'); + } + + if (!SetupDiGetClassImageIndex(&ImageListData, + &ClassGuid, + ClassImage)) + { + /* set the blank icon */ + *ClassImage = 41; + } + + /* FIXME: why are we calling this here? */ + hDevInfo = SetupDiGetClassDevs(&ClassGuid, + 0, + NULL, + DIGCF_PRESENT); + if (hDevInfo == INVALID_HANDLE_VALUE) + return -2; + + KeyClass = SetupDiOpenClassRegKeyEx(&ClassGuid, + MAXIMUM_ALLOWED, + DIOCR_INSTALLER, + NULL, + 0); + if (KeyClass != INVALID_HANDLE_VALUE) + { + DWORD dwSize = MAX_CLASS_NAME_LEN; + + if (RegQueryValue(KeyClass, + NULL, + DeviceClassDesc, + &dwSize) != ERROR_SUCCESS) + { + *DeviceClassDesc = _T('\0'); + } + } + else + { + return -3; + } + + /* FIXME: Can we call this earlier, or see above? */ + SetupDiDestroyDeviceInfoList(hDevInfo); + + *DevicePresent = TRUE; + + RegCloseKey(KeyClass); + + return 0; +} + + +static INT +EnumDevices(INT index, + TCHAR* DeviceClassName, + TCHAR* DeviceName) +{ + HDEVINFO hDevInfo; + SP_DEVINFO_DATA DeviceInfoData; + DWORD RequiredSize = 0; + GUID *guids = NULL; + BOOL bRet; + + *DeviceName = _T('\0'); + + bRet = SetupDiClassGuidsFromName(DeviceClassName, + NULL, + RequiredSize, + &RequiredSize); + if (RequiredSize == 0) + return -2; + + if (!bRet) + { + guids = HeapAlloc(GetProcessHeap(), 0, RequiredSize); + if (guids == NULL) + return -1; + + bRet = SetupDiClassGuidsFromName(DeviceClassName, + guids, + RequiredSize, + &RequiredSize); + + if (!bRet || RequiredSize == 0) + { + /* incorrect class name */ + HeapFree(GetProcessHeap(), 0, guids); + return -3; + } + } + + /* get device info set for our device class */ + hDevInfo = SetupDiGetClassDevs(guids, + 0, + NULL, + DIGCF_PRESENT); + + HeapFree(GetProcessHeap(), 0, guids); + if(hDevInfo == INVALID_HANDLE_VALUE) + { + if(!bRet) + { + /* device info is unavailable */ + return -4; + } + } + + ZeroMemory(&DeviceInfoData, sizeof(SP_DEVINFO_DATA)); + DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + + bRet = SetupDiEnumDeviceInfo(hDevInfo, + index, + &DeviceInfoData); + + if (!bRet) + { + //no such device: + SetupDiDestroyDeviceInfoList(hDevInfo); + return -1; + } + + /* get the device's friendly name */ + if (!SetupDiGetDeviceRegistryProperty(hDevInfo, + &DeviceInfoData, + SPDRP_FRIENDLYNAME, + 0, + (BYTE*)DeviceName, + MAX_DEV_LEN, + NULL)) + { + /* if the friendly name fails, try the description instead */ + bRet = SetupDiGetDeviceRegistryProperty(hDevInfo, + &DeviceInfoData, + SPDRP_DEVICEDESC, + 0, + (BYTE*)DeviceName, + MAX_DEV_LEN, + NULL); + if (!bRet) + { + /* if the description fails, just give up! */ + SetupDiDestroyDeviceInfoList(hDevInfo); + return -5; + } + } + + return 0; +} + + +VOID +ListDevicesByType(PMAIN_WND_INFO Info, + HTREEITEM hRoot) +{ + HTREEITEM hDevItem; + TCHAR DevName[MAX_DEV_LEN]; + TCHAR DevDesc[MAX_DEV_LEN]; + BOOL DevExist = FALSE; + INT ClassRet; + INT index = 0; + INT DevImage; + + do + { + ClassRet = EnumDeviceClasses(index, + DevName, + DevDesc, + &DevExist, + &DevImage); + + if ((ClassRet != -1) && (DevExist)) + { + TCHAR DeviceName[MAX_DEV_LEN]; + INT Ret, DevIndex = 0; + + if (DevDesc[0] != _T('\0')) + { + hDevItem = InsertIntoTreeView(Info->hTreeView, + hRoot, + DevDesc, + DevImage); + } + else + { + hDevItem = InsertIntoTreeView(Info->hTreeView, + hRoot, + DevName, + DevImage); + } + + do + { + Ret = EnumDevices(DevIndex, + DevName, + DeviceName); + if (Ret == 0) + { + InsertIntoTreeView(Info->hTreeView, + hDevItem, + DeviceName, + DevImage); + } + + DevIndex++; + + } while (Ret != -1); + + if (!TreeView_GetChild(Info->hTreeView, + hDevItem)) + { + TreeView_DeleteItem(Info->hTreeView, + hDevItem); + } + else + { + TreeView_SortChildren(Info->hTreeView, + hDevItem, + 0); + } + } + + index++; + + } while (ClassRet != -1); + + TreeView_Expand(Info->hTreeView, + hRoot, + TVE_EXPAND); + + TreeView_SortChildren(Info->hTreeView, + hRoot, + 0); +} + + +HTREEITEM +InitTreeView(PMAIN_WND_INFO Info) +{ + HTREEITEM hRoot; + HBITMAP hComp; + TCHAR ComputerName[MAX_PATH]; + DWORD dwSize = MAX_PATH; + INT RootImage; + //COLORREF Mask = RGB(255, 0, 128); + + TreeView_DeleteAllItems(Info->hTreeView); + + /* get the device image List */ + ImageListData.cbSize = sizeof(ImageListData); + SetupDiGetClassImageList(&ImageListData); + + hComp = LoadBitmap(hInstance, + MAKEINTRESOURCE(IDB_ROOT_IMAGE)); + + ImageList_Add(ImageListData.ImageList, + hComp, + NULL); + + TreeView_SetImageList(Info->hTreeView, + &ImageListData.ImageList, + TVSIL_NORMAL); + + if (!GetComputerName(ComputerName, + &dwSize)) + { + ComputerName[0] = _T('\0'); + } + + RootImage = ImageList_GetImageCount(ImageListData.ImageList) - 1; + + hRoot = InsertIntoTreeView(Info->hTreeView, + NULL, + ComputerName, + RootImage); + + return hRoot; +} Added: trunk/reactos/base/applications/devmgmt/mainwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/mainwnd.c (added) +++ trunk/reactos/base/applications/devmgmt/mainwnd.c Fri Sep 29 00:05:17 2006 @@ -1,0 +1,590 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/devmgmt/mainwnd.c + * PURPOSE: Main window message handler + * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + +#include "precomp.h" + +static const TCHAR szMainWndClass[] = TEXT("DevMgmtWndClass"); + +/* Toolbar buttons */ +TBBUTTON Buttons [] = +{ /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */ + {TBICON_PROP, IDC_PROP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* properties */ + {TBICON_REFRESH, IDC_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* refresh */ + + /* Note: First item for a seperator is its width in pixels */ + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ + + {TBICON_HELP, IDC_PROGHELP,TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* help */ + {TBICON_EXIT, IDC_EXIT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* exit */ + +}; + + +/* menu hints */ +static const MENU_HINT MainMenuHintTable[] = { + /* File Menu */ + {IDC_EXIT, IDS_HINT_EXIT}, + + /* Action Menu */ + {IDC_REFRESH, IDS_HINT_REFRESH}, + {IDC_PROP, IDS_HINT_PROP}, + + /* Help Menu */ + {IDC_PROGHELP, IDS_HINT_HELP}, + {IDC_ABOUT, IDS_HINT_ABOUT} +}; +/* system menu hints */ +static const MENU_HINT SystemMenuHintTable[] = { + {SC_RESTORE, IDS_HINT_SYS_RESTORE}, + {SC_MOVE, IDS_HINT_SYS_MOVE}, + {SC_SIZE, IDS_HINT_SYS_SIZE}, + {SC_MINIMIZE, IDS_HINT_SYS_MINIMIZE}, + {SC_MAXIMIZE, IDS_HINT_SYS_MAXIMIZE}, + {SC_CLOSE, IDS_HINT_SYS_CLOSE}, +}; + + +static BOOL +MainWndMenuHint(PMAIN_WND_INFO Info, + WORD CmdId, + const MENU_HINT *HintArray, + DWORD HintsCount, + UINT DefHintId) +{ + BOOL Found = FALSE; + const MENU_HINT *LastHint; + UINT HintId = DefHintId; + + LastHint = HintArray + HintsCount; + while (HintArray != LastHint) + { + if (HintArray->CmdId == CmdId) + { + HintId = HintArray->HintId; + Found = TRUE; + break; + } + HintArray++; + } + + StatusBarLoadString(Info->hStatus, + SB_SIMPLEID, + hInstance, + HintId); + + return Found; +} + + +static VOID +UpdateMainStatusBar(PMAIN_WND_INFO Info) +{ + if (Info->hStatus != NULL) + { + SendMessage(Info->hStatus, + SB_SIMPLE, + (WPARAM)Info->InMenuLoop, + 0); + } +} + + +static BOOL +CreateToolbar(PMAIN_WND_INFO Info) +{ + INT NumButtons = sizeof(Buttons) / sizeof(Buttons[0]); + + Info->hTool = CreateWindowEx(0, + TOOLBARCLASSNAME, + NULL, + WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, + 0, 0, 0, 0, + Info->hMainWnd, + (HMENU)IDC_TOOLBAR, + hInstance, + NULL); + if(Info->hTool != NULL) + { + HIMAGELIST hImageList; + + SendMessage(Info->hTool, + TB_SETEXTENDEDSTYLE, + 0, + TBSTYLE_EX_HIDECLIPPEDBUTTONS); + + SendMessage(Info->hTool, + TB_BUTTONSTRUCTSIZE, + sizeof(Buttons[0]), + 0); + + hImageList = InitImageList(IDB_PROP, + IDB_EXIT, + 16, + 16); + if (hImageList == NULL) + return FALSE; + + ImageList_Destroy((HIMAGELIST)SendMessage(Info->hTool, + TB_SETIMAGELIST, + 0, + (LPARAM)hImageList)); + + SendMessage(Info->hTool, + TB_ADDBUTTONS, + NumButtons, + (LPARAM)Buttons); + + return TRUE; + } + + return FALSE; +} + + +static BOOL +CreateTreeView(PMAIN_WND_INFO Info) +{ + Info->hTreeView = CreateWindowEx(0, + WC_TREEVIEW, + NULL, + WS_CHILD | WS_VISIBLE | WS_BORDER | + TVS_HASLINES | TVS_HASBUTTONS | TVS_SHOWSELALWAYS, + 0, 0, 0, 0, + Info->hMainWnd, + (HMENU) IDC_TREEVIEW, + hInstance, + NULL); + if (Info->hTreeView == NULL) + { + DisplayString(_T("Could not create TreeView.")); + return FALSE; + } + + return TRUE; +} + +static BOOL +CreateStatusBar(PMAIN_WND_INFO Info) +{ + INT StatWidths[] = {110, -1}; /* widths of status bar */ + + Info->hStatus = CreateWindowEx(0, + STATUSCLASSNAME, + NULL, + WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, + 0, 0, 0, 0, + Info->hMainWnd, + (HMENU)IDC_STATUSBAR, + hInstance, + NULL); + if(Info->hStatus == NULL) + return FALSE; + + + SendMessage(Info->hStatus, + SB_SETPARTS, + sizeof(StatWidths) / sizeof(INT), + (LPARAM)StatWidths); + + return TRUE; +} + + + +static VOID +InitMainWnd(PMAIN_WND_INFO Info) +{ + HTREEITEM hRoot; + + if (!CreateToolbar(Info)) + DisplayString(_T("error creating toolbar")); + + if (!CreateTreeView(Info)) + { + DisplayString(_T("error creating list view")); + return; + } + + if (!CreateStatusBar(Info)) + DisplayString(_T("error creating status bar")); + + /* Create Popup Menu */ + Info->hShortcutMenu = LoadMenu(hInstance, + MAKEINTRESOURCE(IDR_POPUP)); + Info->hShortcutMenu = GetSubMenu(Info->hShortcutMenu, + 0); + + hRoot = InitTreeView(Info); + if (hRoot) + ListDevicesByType(Info, hRoot); +} + + +static VOID +MainWndCommand(PMAIN_WND_INFO Info, + WORD CmdId, + HWND hControl) +{ + UNREFERENCED_PARAMETER(hControl); + + switch (CmdId) + { + case IDC_PROP: + { + // call builtin driver prop sheet + } + break; + + case IDC_REFRESH: + { + // refresh treeview + } + break; + + case IDC_PROGHELP: + DisplayString(_T("Help is not yet implemented\n")); + SetFocus(Info->hTreeView); + break; + + case IDC_EXIT: + PostMessage(Info->hMainWnd, + WM_CLOSE, + 0, + 0); + break; + + case IDC_ABOUT: + DialogBox(hInstance, + MAKEINTRESOURCE(IDD_ABOUTBOX), + Info->hMainWnd, + (DLGPROC)AboutDialogProc); + SetFocus(Info->hTreeView); + break; + + } +} + + +static VOID CALLBACK +MainWndResize(PMAIN_WND_INFO Info, + WORD cx, + WORD cy) +{ + RECT rcClient, rcTool, rcStatus; + int lvHeight, iToolHeight, iStatusHeight; + + /* Size toolbar and get height */ + SendMessage(Info->hTool, TB_AUTOSIZE, 0, 0); + GetWindowRect(Info->hTool, &rcTool); + iToolHeight = rcTool.bottom - rcTool.top; + + /* Size status bar and get height */ + SendMessage(Info->hStatus, WM_SIZE, 0, 0); + GetWindowRect(Info->hStatus, &rcStatus); + iStatusHeight = rcStatus.bottom - rcStatus.top; + + /* Calculate remaining height and size list view */ + GetClientRect(Info->hMainWnd, &rcClient); + lvHeight = rcClient.bottom - iToolHeight - iStatusHeight; + SetWindowPos(Info->hTreeView, + NULL, + 0, + iToolHeight, + rcClient.right, + lvHeight, + SWP_NOZORDER); +} + + +static LRESULT CALLBACK +MainWndProc(HWND hwnd, + UINT msg, + WPARAM wParam, + LPARAM lParam) +{ + PMAIN_WND_INFO Info; + LRESULT Ret = 0; + + /* Get the window context */ + Info = (PMAIN_WND_INFO)GetWindowLongPtr(hwnd, + GWLP_USERDATA); + if (Info == NULL && msg != WM_CREATE) + { + goto HandleDefaultMessage; + } + + switch(msg) + { + case WM_CREATE: + { + Info = (PMAIN_WND_INFO)(((LPCREATESTRUCT)lParam)->lpCreateParams); + + /* Initialize the main window context */ + Info->hMainWnd = hwnd; + + SetWindowLongPtr(hwnd, + GWLP_USERDATA, + (LONG_PTR)Info); + + InitMainWnd(Info); + + /* Show the window */ + ShowWindow(hwnd, + Info->nCmdShow); + + } + break; + + case WM_SIZE: + { + MainWndResize(Info, + LOWORD(lParam), + HIWORD(lParam)); + } + break; + + case WM_NOTIFY: + { + LPNMHDR pnmhdr = (LPNMHDR)lParam; + + switch (pnmhdr->code) + { + case NM_DBLCLK: + { + POINT pt; + RECT rect; + + GetCursorPos(&pt); + GetWindowRect(Info->hTreeView, &rect); + + if (PtInRect(&rect, pt)) + { + SendMessage(hwnd, + WM_COMMAND, + //ID_PROP, + MAKEWPARAM((WORD)IDC_PROP, (WORD)0), + 0); + } + + //OpenPropSheet(Info); + } + break; + + case TTN_GETDISPINFO: + { + LPTOOLTIPTEXT lpttt; + UINT idButton; + + lpttt = (LPTOOLTIPTEXT)lParam; + + /* Specify the resource identifier of the descriptive + * text for the given button. */ + idButton = (UINT)lpttt->hdr.idFrom; + switch (idButton) + { + case IDC_PROP: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PROP); + break; + + case IDC_REFRESH: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_REFRESH); + break; + + case IDC_PROGHELP: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_HELP); + break; + + case IDC_EXIT: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXIT); + break; + + } + } + break; + } + } + break; + + case WM_CONTEXTMENU: + { + POINT pt; + RECT lvRect; + + INT xPos = GET_X_LPARAM(lParam); + INT yPos = GET_Y_LPARAM(lParam); + + GetCursorPos(&pt); + + /* display popup when cursor is in the list view */ + GetWindowRect(Info->hTreeView, &lvRect); + if (PtInRect(&lvRect, pt)) + { + TrackPopupMenuEx(Info->hShortcutMenu, + TPM_RIGHTBUTTON, + xPos, + yPos, + Info->hMainWnd, + NULL); + } + } + break; + + case WM_COMMAND: + { + MainWndCommand(Info, + LOWORD(wParam), + (HWND)lParam); + goto HandleDefaultMessage; + } + + case WM_MENUSELECT: + { + if (Info->hStatus != NULL) + { + if (!MainWndMenuHint(Info, + LOWORD(wParam), + MainMenuHintTable, + sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]), + IDS_HINT_BLANK)) + { + MainWndMenuHint(Info, + LOWORD(wParam), + SystemMenuHintTable, + sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]), + IDS_HINT_BLANK); + } + } + } + break; + + case WM_ENTERMENULOOP: + { + Info->InMenuLoop = TRUE; + UpdateMainStatusBar(Info); + break; + } + + case WM_EXITMENULOOP: + { + Info->InMenuLoop = FALSE; + UpdateMainStatusBar(Info); + break; + } + + case WM_CLOSE: + { + DestroyMenu(Info->hShortcutMenu); + DestroyWindow(hwnd); + } + break; + + case WM_DESTROY: + { + //DestroyMainWnd(Info); + + HeapFree(ProcessHeap, + 0, + Info); + SetWindowLongPtr(hwnd, + GWLP_USERDATA, + 0); + + /* Break the message queue loop */ + PostQuitMessage(0); + } + break; + + default: + { +HandleDefaultMessage: + + Ret = DefWindowProc(hwnd, + msg, + wParam, + lParam); + } + break; + } + return Ret; +} + + + +HWND +CreateMainWindow(LPCTSTR lpCaption, + int nCmdShow) +{ + PMAIN_WND_INFO Info; + HWND hMainWnd = NULL; + + Info = HeapAlloc(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(MAIN_WND_INFO)); + + if (Info != NULL) + { + Info->nCmdShow = nCmdShow; + + hMainWnd = CreateWindowEx(WS_EX_WINDOWEDGE, + szMainWndClass, + lpCaption, + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, + CW_USEDEFAULT, + CW_USEDEFAULT, + 650, + 450, + NULL, + NULL, + hInstance, + Info); + if (hMainWnd == NULL) + { + GetError(); + HeapFree(ProcessHeap, + 0, + Info); + } + } + + return hMainWnd; +} + +BOOL +InitMainWindowImpl(VOID) +{ + WNDCLASSEX wc = {0}; + + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpfnWndProc = MainWndProc; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, + MAKEINTRESOURCE(IDI_MAIN_ICON)); + wc.hCursor = LoadCursor(NULL, + IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAINMENU); + wc.lpszClassName = szMainWndClass; + wc.hIconSm = (HICON)LoadImage(hInstance, + MAKEINTRESOURCE(IDI_MAIN_ICON), + IMAGE_ICON, + 16, + 16, + LR_SHARED); + + return RegisterClassEx(&wc) != (ATOM)0; +} + + +VOID +UninitMainWindowImpl(VOID) +{ + UnregisterClass(szMainWndClass, + hInstance); +} + Added: trunk/reactos/base/applications/devmgmt/manifest.xml URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/manifest.xml (added) +++ trunk/reactos/base/applications/devmgmt/manifest.xml Fri Sep 29 00:05:17 2006 @@ -1,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly + xmlns="urn:schemas-microsoft-com:asm.v1" + manifestVersion="1.0"> +<assemblyIdentity + name="Win32 Application.default.App" + processorArchitecture="x86" + version="1.0.0.0" + type="win32"/> +<description>ReactOS Service Manager</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="x86" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> Added: trunk/reactos/base/applications/devmgmt/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/misc.c (added) +++ trunk/reactos/base/applications/devmgmt/misc.c Fri Sep 29 00:05:17 2006 @@ -1,0 +1,261 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/devmgmt/misc.c + * PURPOSE: miscallanous functions + * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com> + * + */ + +#include "precomp.h" + +static INT +LengthOfStrResource(IN HINSTANCE hInst, + IN UINT uID) +{ + HRSRC hrSrc; + HGLOBAL hRes; + LPWSTR lpName, lpStr; + + if (hInst == NULL) + { + return -1; + } + + /* There are always blocks of 16 strings */ + lpName = (LPWSTR)MAKEINTRESOURCE((uID >> 4) + 1); + + /* Find the string table block */ + if ((hrSrc = FindResourceW(hInst, lpName, (LPWSTR)RT_STRING)) && + (hRes = LoadResource(hInst, hrSrc)) && + (lpStr = LockResource(hRes))) + { + UINT x; + + /* Find the string we're looking for */ + uID &= 0xF; /* position in the block, same as % 16 */ + for (x = 0; x < uID; x++) + { + lpStr += (*lpStr) + 1; + } + + /* Found the string */ + return (int)(*lpStr); + } + return -1; +} + +INT +AllocAndLoadString(OUT LPTSTR *lpTarget, + IN HINSTANCE hInst, + IN UINT uID) +{ + INT ln; + + ln = LengthOfStrResource(hInst, + uID); + if (ln++ > 0) + { + (*lpTarget) = (LPTSTR)LocalAlloc(LMEM_FIXED, + ln * sizeof(TCHAR)); + if ((*lpTarget) != NULL) + { + INT Ret; + if (!(Ret = LoadString(hInst, uID, *lpTarget, ln))) + { + LocalFree((HLOCAL)(*lpTarget)); + } + return Ret; + } + } + return 0; +} + +DWORD +LoadAndFormatString(IN HINSTANCE hInstance, + IN UINT uID, + OUT LPTSTR *lpTarget, + ...) +{ + DWORD Ret = 0; + LPTSTR lpFormat; + va_list lArgs; + + if (AllocAndLoadString(&lpFormat, + hInstance, + uID) > 0) + { + va_start(lArgs, lpTarget); + /* let's use FormatMessage to format it because it has the ability to allocate + memory automatically */ + Ret = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, + lpFormat, + 0, + 0, + (LPTSTR)lpTarget, + 0, + &lArgs); + va_end(lArgs); + + LocalFree((HLOCAL)lpFormat); + } + + return Ret; +} + +BOOL +StatusBarLoadAndFormatString(IN HWND hStatusBar, + IN INT PartId, + IN HINSTANCE hInstance, + IN UINT uID, + ...) +{ + BOOL Ret = FALSE; + LPTSTR lpFormat, lpStr; + va_list lArgs; + + if (AllocAndLoadString(&lpFormat, + hInstance, + uID) > 0) + { + va_start(lArgs, uID); + /* let's use FormatMessage to format it because it has the ability to allocate + memory automatically */ + Ret = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, + lpFormat, + 0, + 0, + (LPTSTR)&lpStr, + 0, + &lArgs); + va_end(lArgs); + + if (lpStr != NULL) + { + Ret = (BOOL)SendMessage(hStatusBar, + SB_SETTEXT, + (WPARAM)PartId, + (LPARAM)lpStr); + LocalFree((HLOCAL)lpStr); + } + + LocalFree((HLOCAL)lpFormat); + } + + return Ret; +} + +BOOL +StatusBarLoadString(IN HWND hStatusBar, + IN INT PartId, + IN HINSTANCE hInstance, + IN UINT uID) +{ + BOOL Ret = FALSE; + LPTSTR lpStr; + + if (AllocAndLoadString(&lpStr, + hInstance, + uID) > 0) + { + Ret = (BOOL)SendMessage(hStatusBar, + SB_SETTEXT, + (WPARAM)PartId, + (LPARAM)lpStr); + LocalFree((HLOCAL)lpStr); + } + + return Ret; +} + + +INT +GetTextFromEdit(OUT LPTSTR lpString, + IN HWND hDlg, + IN UINT Res) +{ + INT len = GetWindowTextLength(GetDlgItem(hDlg, Res)); + if(len > 0) + { + GetDlgItemText(hDlg, + Res, + lpString, + len + 1); + } + else + lpString = NULL; + + return len; +} + + +HIMAGELIST +InitImageList(UINT StartResource, + UINT EndResource, + UINT Width, + UINT Height) +{ + HBITMAP hBitmap; + HIMAGELIST hImageList; + UINT i; + INT Ret; + + /* Create the toolbar icon image list */ + hImageList = ImageList_Create(Width, + Height, + ILC_MASK | ILC_COLOR24, + EndResource - StartResource, + 0); + if (hImageList == NULL) + return NULL; + + /* Add all icons to the image list */ + for (i = StartResource; i <= EndResource; i++) + { + hBitmap = LoadImage(hInstance, + MAKEINTRESOURCE(i), + IMAGE_BITMAP, + Width, + Height, + LR_LOADTRANSPARENT); + if (hBitmap == NULL) + return NULL; + + Ret = ImageList_AddMasked(hImageList, + hBitmap, + RGB(255, 0, 128)); + if (Ret == -1) + return NULL; + + DeleteObject(hBitmap); + } + + return hImageList; +} + + +VOID GetError(VOID) +{ + LPVOID lpMsgBuf; + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL ); + + MessageBox(NULL, lpMsgBuf, _T("Error!"), MB_OK | MB_ICONERROR); + + LocalFree(lpMsgBuf); +} + + +VOID DisplayString(PTCHAR Msg) +{ + MessageBox(NULL, Msg, _T("Note!"), MB_ICONEXCLAMATION|MB_OK); +} + Added: trunk/reactos/base/applications/devmgmt/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/precomp.h (added) +++ trunk/reactos/base/applications/devmgmt/precomp.h Fri Sep 29 00:05:17 2006 @@ -1,0 +1,102 @@ +#ifndef __DEVMGMT_PRECOMP_H +#define __DEVMGMT_PRECOMP_H + +//#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <windowsx.h> /* GET_X/Y_LPARAM */ +#include <stdio.h> +#include <tchar.h> +#include <setupapi.h> +#include <cfgmgr32.h> +#include <commctrl.h> +#include "resource.h" + +#ifdef _MSC_VER +#pragma warning(disable : 4100) +#endif + +#ifndef SB_SIMPLEID +#define SB_SIMPLEID 0xFF +#endif + +#define NO_ITEM_SELECTED -1 +#define MAX_KEY_LENGTH 256 +#define MAX_DEV_LEN 1000 + + +typedef struct _MAIN_WND_INFO +{ + HWND hMainWnd; + HWND hTreeView; + HWND hStatus; + HWND hTool; + HWND hProgDlg; + HMENU hShortcutMenu; + int nCmdShow; + + /* status flags */ + BOOL InMenuLoop : 1; + +} MAIN_WND_INFO, *PMAIN_WND_INFO; + + +BOOL CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + + +/* servman.c */ +extern HINSTANCE hInstance; +extern HANDLE ProcessHeap; + +/* mainwnd.c */ +typedef struct _MENU_HINT +{ + WORD CmdId; + UINT HintId; +} MENU_HINT, *PMENU_HINT; + +BOOL InitMainWindowImpl(VOID); +VOID UninitMainWindowImpl(VOID); +HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow); + + +/* enumdevices.c */ +HTREEITEM InitTreeView(PMAIN_WND_INFO Info); +VOID ListDevicesByType(PMAIN_WND_INFO Info, HTREEITEM hRoot); + + +/* misc.c */ +INT AllocAndLoadString(OUT LPTSTR *lpTarget, + IN HINSTANCE hInst, + IN UINT uID); + +DWORD LoadAndFormatString(IN HINSTANCE hInstance, + IN UINT uID, + OUT LPTSTR *lpTarget, + ...); + +BOOL StatusBarLoadAndFormatString(IN HWND hStatusBar, + IN INT PartId, + IN HINSTANCE hInstance, + IN UINT uID, + ...); + +BOOL StatusBarLoadString(IN HWND hStatusBar, + IN INT PartId, + IN HINSTANCE hInstance, + IN UINT uID); + +INT GetTextFromEdit(OUT LPTSTR lpString, + IN HWND hDlg, + IN UINT Res); + +VOID GetError(VOID); + +VOID DisplayString(PTCHAR); + +HIMAGELIST InitImageList(UINT NumButtons, + UINT StartResource, + UINT Width, + UINT Height); + + +#endif /* __DEVMGMT_PRECOMP_H */ Added: trunk/reactos/base/applications/devmgmt/res/computer.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/devmgmt/res/computer.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/devmgmt/res/exit.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/devmgmt/res/exit.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/devmgmt/res/help.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/devmgmt/res/help.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/devmgmt/res/properties.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/devmgmt/res/properties.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/devmgmt/res/refresh.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/devmgmt/res/refresh.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/devmgmt/res/root.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/devmgmt/res/root.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/devmgmt/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/devmgmt/…
============================================================================== --- trunk/reactos/base/applications/devmgmt/resource.h (added) +++ trunk/reactos/base/applications/devmgmt/resource.h Fri Sep 29 00:05:17 2006 @@ -1,0 +1,63 @@ +#define IDC_STATIC -1 + + +#define IDI_MAIN_ICON 50 +#define IDB_ROOT_IMAGE 51 + +/* windows */ +#define IDC_TREEVIEW 1000 +#define IDC_TOOLBAR 1001 +#define IDC_STATUSBAR 1002 + +/* commands */ +#define IDC_PROP 2000 +#define IDC_REFRESH 2001 +#define IDC_PRINT 2002 +#define IDC_PROGHELP 2003 +#define IDC_EXIT 2004 +#define IDC_ABOUT 4031 + +/* menus */ +#define IDR_MAINMENU 102 +#define IDR_POPUP 103 + +/* tooltips */ +#define IDS_TOOLTIP_PROP 6000 +#define IDS_TOOLTIP_REFRESH 6001 +#define IDS_TOOLTIP_HELP 6002 +#define IDS_TOOLTIP_EXIT 6003 + +/* button bitmaps */ +#define IDB_PROP 10000 +#define IDB_REFRESH 10001 +#define IDB_HELP 10002 +#define IDB_EXIT 10003 + +/* toolbar buttons */ +#define TBICON_PROP 0 +#define TBICON_REFRESH 1 +#define TBICON_HELP 2 +#define TBICON_EXIT 3 + +/* about box info */ +#define IDD_ABOUTBOX 200 +#define IDC_LICENSE_EDIT 201 +#define IDS_APPNAME 202 +#define IDS_LICENSE 203 + + +/* menu hints */ +#define IDS_HINT_BLANK 20000 +#define IDS_HINT_REFRESH 20002 +#define IDS_HINT_PROP 20003 +#define IDS_HINT_HELP 20004 +#define IDS_HINT_ABOUT 20005 +#define IDS_HINT_EXIT 20006 + +/* system menu hints */ +#define IDS_HINT_SYS_RESTORE 21001 +#define IDS_HINT_SYS_MOVE 21002 +#define IDS_HINT_SYS_SIZE 21003 +#define IDS_HINT_SYS_MINIMIZE 21004 +#define IDS_HINT_SYS_MAXIMIZE 21005 +#define IDS_HINT_SYS_CLOSE 21006
18 years, 2 months
1
0
0
0
[greatlrd] 24288: NtGdiCreateDIBitmap fixed 2 more hiden bugs (cause some crash/bsod) but not the bug I am searching for.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Sep 28 23:08:07 2006 New Revision: 24288 URL:
http://svn.reactos.org/svn/reactos?rev=24288&view=rev
Log: NtGdiCreateDIBitmap fixed 2 more hiden bugs (cause some crash/bsod) but not the bug I am searching for. Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c Thu Sep 28 23:08:07 2006 @@ -793,7 +793,16 @@ PDC Dc; HBITMAP Bmp; - + if (Header == NULL) + { + return NULL; + } + + if (Header->biSize == 0) + { + return NULL; + } + if (NULL == hDc) { BITMAPINFOHEADER *change_Header = (BITMAPINFOHEADER *)Header;
18 years, 2 months
1
0
0
0
[greatlrd] 24287: fix a hidden bug in IntCreateBitmapIndirect
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Sep 28 22:32:09 2006 New Revision: 24287 URL:
http://svn.reactos.org/svn/reactos?rev=24287&view=rev
Log: fix a hidden bug in IntCreateBitmapIndirect Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Thu Sep 28 22:32:09 2006 @@ -437,7 +437,12 @@ Size.cx, Size.cy, BitsPixel, hBitmap); bmp = BITMAPOBJ_LockBitmap( hBitmap ); - /* FIXME - bmp can be NULL!!!!!! */ + if (bmp == NULL) + { + /* FIXME should we free the hBitmap or return it ?? */ + return 0; + } + bmp->flFlags = BITMAPOBJ_IS_APIBITMAP; BITMAPOBJ_UnlockBitmap( bmp );
18 years, 2 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
15
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Results per page:
10
25
50
100
200