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
October 2005
----- 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
26 participants
737 discussions
Start a n
N
ew thread
[weiden] 18689: implemented SetupDiGetDriverInfoDetailA()
by weiden@svn.reactos.com
implemented SetupDiGetDriverInfoDetailA() Modified: trunk/reactos/lib/setupapi/devinst.c _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-10-22 20:03:50 UTC (rev 18688) +++ trunk/reactos/lib/setupapi/devinst.c 2005-10-22 20:12:42 UTC (rev 18689) @@ -4812,11 +4812,193 @@ IN DWORD DriverInfoDetailDataSize, OUT PDWORD RequiredSize OPTIONAL) { - FIXME("%p %p %p %p 0x%lx %p\n", DeviceInfoSet, DeviceInfoData, - DriverInfoData, DriverInfoDetailData, DriverInfoDetailDataSize, - RequiredSize); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + SP_DRVINFO_DATA_V2_W DriverInfoDataW; + PSP_DRVINFO_DETAIL_DATA_W DriverInfoDetailDataW = NULL; + DWORD BufSize = 0; + DWORD HardwareIDLen = 0; + BOOL ret = FALSE; + + /* do some sanity checks, the unicode version might do more thorough checks */ + if (DriverInfoData == NULL || + (DriverInfoDetailData == NULL && DriverInfoDetailDataSize != 0) || + (DriverInfoDetailData != NULL && + (DriverInfoDetailDataSize < FIELD_OFFSET(SP_DRVINFO_DETAIL_DATA_A, HardwareID) + sizeof(CHAR) || + DriverInfoDetailData->cbSize != sizeof(SP_DRVINFO_DETAIL_DATA_A)))) + { + SetLastError(ERROR_INVALID_PARAMETER); + goto Cleanup; + } + + /* make sure we support both versions of the SP_DRVINFO_DATA structure */ + if (DriverInfoData->cbSize == sizeof(SP_DRVINFO_DATA_V1_A)) + { + DriverInfoDataW.cbSize = sizeof(SP_DRVINFO_DATA_V1_W); + } + else if (DriverInfoData->cbSize == sizeof(SP_DRVINFO_DATA_V2_A)) + { + DriverInfoDataW.cbSize = sizeof(SP_DRVINFO_DATA_V2_W); + } + else + { + SetLastError(ERROR_INVALID_PARAMETER); + goto Cleanup; + } + DriverInfoDataW.DriverType = DriverInfoData->DriverType; + DriverInfoDataW.Reserved = DriverInfoData->Reserved; + + /* convert the strings to unicode */ + if (MultiByteToWideChar(CP_ACP, + 0, + DriverInfoData->Description, + LINE_LEN, + DriverInfoDataW.Description, + LINE_LEN) && + MultiByteToWideChar(CP_ACP, + 0, + DriverInfoData->MfgName, + LINE_LEN, + DriverInfoDataW.MfgName, + LINE_LEN) && + MultiByteToWideChar(CP_ACP, + 0, + DriverInfoData->ProviderName, + LINE_LEN, + DriverInfoDataW.ProviderName, + LINE_LEN)) + { + if (DriverInfoDataW.cbSize == sizeof(SP_DRVINFO_DATA_V2_W)) + { + DriverInfoDataW.DriverDate = ((PSP_DRVINFO_DATA_V2_A)DriverInfoData)->DriverDate; + DriverInfoDataW.DriverVersion = ((PSP_DRVINFO_DATA_V2_A)DriverInfoData)->DriverVersion; + } + + if (DriverInfoDetailData != NULL) + { + /* calculate the unicode buffer size from the ansi buffer size */ + HardwareIDLen = DriverInfoDetailDataSize - FIELD_OFFSET(SP_DRVINFO_DETAIL_DATA_A, HardwareID); + BufSize = FIELD_OFFSET(SP_DRVINFO_DETAIL_DATA_W, HardwareID) + + (HardwareIDLen * sizeof(WCHAR)); + + DriverInfoDetailDataW = MyMalloc(BufSize); + if (DriverInfoDetailDataW == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto Cleanup; + } + + /* initialize the buffer */ + ZeroMemory(DriverInfoDetailDataW, + BufSize); + DriverInfoDetailDataW->cbSize = sizeof(SP_DRVINFO_DETAIL_DATA_W); + } + + /* call the unicode version */ + ret = SetupDiGetDriverInfoDetailW(DeviceInfoSet, + DeviceInfoData, + &DriverInfoDataW, + DriverInfoDetailDataW, + BufSize, + RequiredSize); + + if (ret) + { + if (DriverInfoDetailDataW != NULL) + { + /* convert the SP_DRVINFO_DETAIL_DATA_W structure to ansi */ + DriverInfoDetailData->cbSize = sizeof(SP_DRVINFO_DETAIL_DATA_A); + DriverInfoDetailData->InfDate = DriverInfoDetailDataW->InfDate; + DriverInfoDetailData->Reserved = DriverInfoDetailDataW->Reserved; + if (WideCharToMultiByte(CP_ACP, + 0, + DriverInfoDetailDataW->SectionName, + LINE_LEN, + DriverInfoDetailData->SectionName, + LINE_LEN, + NULL, + NULL) && + WideCharToMultiByte(CP_ACP, + 0, + DriverInfoDetailDataW->InfFileName, + MAX_PATH, + DriverInfoDetailData->InfFileName, + MAX_PATH, + NULL, + NULL) && + WideCharToMultiByte(CP_ACP, + 0, + DriverInfoDetailDataW->DrvDescription, + LINE_LEN, + DriverInfoDetailData->DrvDescription, + LINE_LEN, + NULL, + NULL) && + WideCharToMultiByte(CP_ACP, + 0, + DriverInfoDetailDataW->HardwareID, + HardwareIDLen, + DriverInfoDetailData->HardwareID, + HardwareIDLen, + NULL, + NULL)) + { + DWORD len, cnt = 0; + DWORD hwidlen = HardwareIDLen; + CHAR *s = DriverInfoDetailData->HardwareID; + + /* count the strings in the list */ + while (*s != '\0') + { + len = lstrlenA(s) + 1; + if (hwidlen > len) + { + cnt++; + s += len; + hwidlen -= len; + } + else + { + /* looks like the string list wasn't terminated... */ + SetLastError(ERROR_INVALID_USER_BUFFER); + ret = FALSE; + break; + } + } + + /* make sure CompatIDsOffset points to the second string in the + list, if present */ + if (cnt > 1) + { + DriverInfoDetailData->CompatIDsOffset = lstrlenA(DriverInfoDetailData->HardwareID) + 1; + DriverInfoDetailData->CompatIDsLength = (DWORD)(s - DriverInfoDetailData->HardwareID) - + DriverInfoDetailData->CompatIDsOffset + 1; + } + else + { + DriverInfoDetailData->CompatIDsOffset = 0; + DriverInfoDetailData->CompatIDsLength = 0; + } + } + else + { + ret = FALSE; + } + } + + if (RequiredSize != NULL) + { + *RequiredSize = FIELD_OFFSET(SP_DRVINFO_DETAIL_DATA_A, HardwareID) + + (((*RequiredSize) - FIELD_OFFSET(SP_DRVINFO_DETAIL_DATA_W, HardwareID)) / sizeof(WCHAR)); + } + } + } + +Cleanup: + if (DriverInfoDetailDataW != NULL) + { + MyFree(DriverInfoDetailDataW); + } + + return ret; } /***********************************************************************
19 years, 2 months
1
0
0
0
[fireball] 18688: Implement acpi_pci_X_cfg_Y using HalXBusDataByOffset()
by fireball@svn.reactos.com
Implement acpi_pci_X_cfg_Y using HalXBusDataByOffset() Modified: trunk/reactos/drivers/bus/acpi/ospm/osl.c _____ Modified: trunk/reactos/drivers/bus/acpi/ospm/osl.c --- trunk/reactos/drivers/bus/acpi/ospm/osl.c 2005-10-22 20:02:03 UTC (rev 18687) +++ trunk/reactos/drivers/bus/acpi/ospm/osl.c 2005-10-22 20:03:50 UTC (rev 18688) @@ -354,11 +354,28 @@ u32 addr, u8 * val) { - /* FIXME: What do we do here? */ + NTSTATUS ret; + PCI_SLOT_NUMBER slot; - DPRINT("acpi_os_read_pci_cfg_byte is not implemented"); + if (func == 0) + return AE_ERROR; - return AE_ERROR; + slot.u.AsULONG = 0; + slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; + slot.u.bits.FunctionNumber = func & 0xFFFF; + + DPRINT("acpi_os_read_pci_cfg_byte, slot=0x%X, func=0x%X\n", slot.u.AsULONG, func); + ret = HalGetBusDataByOffset(PCIConfiguration, + bus, + slot.u.AsULONG, + val, + addr, + sizeof(UCHAR)); + + if (NT_SUCCESS(ret)) + return AE_OK; + else + return AE_ERROR; } ACPI_STATUS @@ -368,11 +385,28 @@ u32 addr, u16 * val) { - /* FIXME: What do we do here? */ + NTSTATUS ret; + PCI_SLOT_NUMBER slot; - DPRINT("acpi_os_read_pci_cfg_word is not implemented"); + if (func == 0) + return AE_ERROR; - return AE_ERROR; + slot.u.AsULONG = 0; + slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; + slot.u.bits.FunctionNumber = func & 0xFFFF; + + DPRINT("acpi_os_read_pci_cfg_word, slot=0x%x\n", slot.u.AsULONG); + ret = HalGetBusDataByOffset(PCIConfiguration, + bus, + slot.u.AsULONG, + val, + addr, + sizeof(USHORT)); + + if (NT_SUCCESS(ret)) + return AE_OK; + else + return AE_ERROR; } ACPI_STATUS @@ -382,11 +416,28 @@ u32 addr, u32 * val) { - /* FIXME: What do we do here? */ + NTSTATUS ret; + PCI_SLOT_NUMBER slot; - DPRINT("acpi_os_read_pci_cfg_dword is not implemented"); + if (func == 0) + return AE_ERROR; - return AE_ERROR; + slot.u.AsULONG = 0; + slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; + slot.u.bits.FunctionNumber = func & 0xFFFF; + + DPRINT("acpi_os_read_pci_cfg_dword, slot=0x%x\n", slot.u.AsULONG); + ret = HalGetBusDataByOffset(PCIConfiguration, + bus, + slot.u.AsULONG, + val, + addr, + sizeof(ULONG)); + + if (NT_SUCCESS(ret)) + return AE_OK; + else + return AE_ERROR; } ACPI_STATUS @@ -396,11 +447,29 @@ u32 addr, u8 val) { - /* FIXME: What do we do here? */ + NTSTATUS ret; + UCHAR buf = val; + PCI_SLOT_NUMBER slot; - DPRINT("acpi_os_write_pci_cfg_byte is not implemented"); + if (func == 0) + return AE_ERROR; - return AE_ERROR; + slot.u.AsULONG = 0; + slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; + slot.u.bits.FunctionNumber = func & 0xFFFF; + + DPRINT("acpi_os_write_pci_cfg_byte, slot=0x%x\n", slot.u.AsULONG); + ret = HalSetBusDataByOffset(PCIConfiguration, + bus, + slot.u.AsULONG, + &buf, + addr, + sizeof(UCHAR)); + + if (NT_SUCCESS(ret)) + return AE_OK; + else + return AE_ERROR; } ACPI_STATUS @@ -410,11 +479,29 @@ u32 addr, u16 val) { - /* FIXME: What do we do here? */ + NTSTATUS ret; + USHORT buf = val; + PCI_SLOT_NUMBER slot; - DPRINT("acpi_os_write_pci_cfg_word is not implemented"); + if (func == 0) + return AE_ERROR; - return AE_ERROR; + slot.u.AsULONG = 0; + slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; + slot.u.bits.FunctionNumber = func & 0xFFFF; + + DPRINT("acpi_os_write_pci_cfg_byte, slot=0x%x\n", slot.u.AsULONG); + ret = HalSetBusDataByOffset(PCIConfiguration, + bus, + slot.u.AsULONG, + &buf, + addr, + sizeof(USHORT)); + + if (NT_SUCCESS(ret)) + return AE_OK; + else + return AE_ERROR; } ACPI_STATUS @@ -424,11 +511,29 @@ u32 addr, u32 val) { - /* FIXME: What do we do here? */ + NTSTATUS ret; + ULONG buf = val; + PCI_SLOT_NUMBER slot; - DPRINT("acpi_os_write_pci_cfg_dword is not implemented"); + if (func == 0) + return AE_ERROR; - return AE_ERROR; + slot.u.AsULONG = 0; + slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; + slot.u.bits.FunctionNumber = func & 0xFFFF; + + DPRINT("acpi_os_write_pci_cfg_byte, slot=0x%x\n", slot.u.AsULONG); + ret = HalSetBusDataByOffset(PCIConfiguration, + bus, + slot.u.AsULONG, + &buf, + addr, + sizeof(ULONG)); + + if (NT_SUCCESS(ret)) + return AE_OK; + else + return AE_ERROR; } ACPI_STATUS
19 years, 2 months
1
0
0
0
[cwittich] 18687: fix inet_aton problem
by cwittich@svn.reactos.com
fix inet_aton problem Modified: trunk/reactos/services/dhcp/compat.c Modified: trunk/reactos/services/dhcp/dhclient.c Modified: trunk/reactos/services/dhcp/include/rosdhcp.h _____ Modified: trunk/reactos/services/dhcp/compat.c --- trunk/reactos/services/dhcp/compat.c 2005-10-22 19:46:00 UTC (rev 18686) +++ trunk/reactos/services/dhcp/compat.c 2005-10-22 20:02:03 UTC (rev 18687) @@ -30,6 +30,7 @@ return ret; } + int inet_aton(const char *cp, struct in_addr *inp) { inp->S_un.S_addr = inet_addr(cp); @@ -38,3 +39,4 @@ return 1; } + _____ Modified: trunk/reactos/services/dhcp/dhclient.c --- trunk/reactos/services/dhcp/dhclient.c 2005-10-22 19:46:00 UTC (rev 18686) +++ trunk/reactos/services/dhcp/dhclient.c 2005-10-22 20:02:03 UTC (rev 18687) @@ -1986,7 +1986,7 @@ ipv4addrs(char * buf) { char *tmp; - unsigned long jnk; + struct in_addr jnk; int i = 0; note("Input: %s\n", buf); @@ -1994,8 +1994,7 @@ do { tmp = strtok(buf, " "); note("got %s\n", tmp); - jnk = inet_addr( tmp ); - if( tmp ) i++; + if( tmp && inet_aton(tmp, &jnk) ) i++; buf = NULL; } while( tmp ); _____ Modified: trunk/reactos/services/dhcp/include/rosdhcp.h --- trunk/reactos/services/dhcp/include/rosdhcp.h 2005-10-22 19:46:00 UTC (rev 18686) +++ trunk/reactos/services/dhcp/include/rosdhcp.h 2005-10-22 20:02:03 UTC (rev 18687) @@ -67,5 +67,6 @@ extern DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req ); extern DWORD DSRenewIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req ); extern DWORD DSReleaseIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req ); +extern int inet_aton(const char *s, struct in_addr *addr); int warn( char *format, ... ); #endif/*ROSDHCP_H*/
19 years, 2 months
1
0
0
0
[ekohl] 18686: Update indentation.
by ekohl@svn.reactos.com
Update indentation. Modified: trunk/reactos/subsys/system/services/database.c Modified: trunk/reactos/subsys/system/services/rpcserver.c Modified: trunk/reactos/subsys/system/services/services.c _____ Modified: trunk/reactos/subsys/system/services/database.c --- trunk/reactos/subsys/system/services/database.c 2005-10-22 18:59:39 UTC (rev 18685) +++ trunk/reactos/subsys/system/services/database.c 2005-10-22 19:46:00 UTC (rev 18686) @@ -58,29 +58,29 @@ PSERVICE ScmGetServiceEntryByName(LPWSTR lpServiceName) { - PLIST_ENTRY ServiceEntry; - PSERVICE CurrentService; + PLIST_ENTRY ServiceEntry; + PSERVICE CurrentService; - DPRINT("ScmGetServiceEntryByName() called\n"); + DPRINT("ScmGetServiceEntryByName() called\n"); - ServiceEntry = ServiceListHead.Flink; - while (ServiceEntry != &ServiceListHead) + ServiceEntry = ServiceListHead.Flink; + while (ServiceEntry != &ServiceListHead) { - CurrentService = CONTAINING_RECORD(ServiceEntry, - SERVICE, - ServiceListEntry); - if (_wcsicmp(CurrentService->lpServiceName, lpServiceName) == 0) - { - DPRINT("Found service: '%S'\n", CurrentService->lpServiceName); - return CurrentService; - } + CurrentService = CONTAINING_RECORD(ServiceEntry, + SERVICE, + ServiceListEntry); + if (_wcsicmp(CurrentService->lpServiceName, lpServiceName) == 0) + { + DPRINT("Found service: '%S'\n", CurrentService->lpServiceName); + return CurrentService; + } - ServiceEntry = ServiceEntry->Flink; + ServiceEntry = ServiceEntry->Flink; } - DPRINT("Couldn't find a matching service\n"); + DPRINT("Couldn't find a matching service\n"); - return NULL; + return NULL; } @@ -135,11 +135,11 @@ static NTSTATUS STDCALL CreateGroupListRoutine(PWSTR ValueName, - ULONG ValueType, - PVOID ValueData, - ULONG ValueLength, - PVOID Context, - PVOID EntryContext) + ULONG ValueType, + PVOID ValueData, + ULONG ValueLength, + PVOID Context, + PVOID EntryContext) { PSERVICE_GROUP Group; RTL_QUERY_REGISTRY_TABLE QueryTable[2]; @@ -185,734 +185,735 @@ static NTSTATUS STDCALL CreateServiceListEntry(LPWSTR lpServiceName) { - RTL_QUERY_REGISTRY_TABLE QueryTable[6]; - UNICODE_STRING ServiceName; - PSERVICE Service = NULL; - NTSTATUS Status; + RTL_QUERY_REGISTRY_TABLE QueryTable[6]; + UNICODE_STRING ServiceName; + PSERVICE Service = NULL; + NTSTATUS Status; - DPRINT("Service: '%wZ'\n", ServiceName); + DPRINT("Service: '%wZ'\n", ServiceName); - /* Allocate service entry */ - Service = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(SERVICE) + ((wcslen(lpServiceName) + 1) * sizeof(WCHAR))); - if (Service == NULL) + /* Allocate service entry */ + Service = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SERVICE) + ((wcslen(lpServiceName) + 1) * sizeof(WCHAR))); + if (Service == NULL) { - return STATUS_INSUFFICIENT_RESOURCES; + return STATUS_INSUFFICIENT_RESOURCES; } - /* Copy service name */ - wcscpy(Service->szServiceName, lpServiceName); - Service->lpServiceName = Service->szServiceName; + /* Copy service name */ + wcscpy(Service->szServiceName, lpServiceName); + Service->lpServiceName = Service->szServiceName; - /* Get service data */ - RtlZeroMemory(&QueryTable, - sizeof(QueryTable)); + /* Get service data */ + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); - QueryTable[0].Name = L"Start"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[0].EntryContext = &Service->dwStartType; + QueryTable[0].Name = L"Start"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[0].EntryContext = &Service->dwStartType; - QueryTable[1].Name = L"Type"; - QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[1].EntryContext = &Service->Status.dwServiceType; + QueryTable[1].Name = L"Type"; + QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[1].EntryContext = &Service->Status.dwServiceType; - QueryTable[2].Name = L"ErrorControl"; - QueryTable[2].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[2].EntryContext = &Service->dwErrorControl; + QueryTable[2].Name = L"ErrorControl"; + QueryTable[2].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[2].EntryContext = &Service->dwErrorControl; - QueryTable[3].Name = L"Group"; - QueryTable[3].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[3].EntryContext = &Service->ServiceGroup; + QueryTable[3].Name = L"Group"; + QueryTable[3].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[3].EntryContext = &Service->ServiceGroup; - QueryTable[4].Name = L"Tag"; - QueryTable[4].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[4].EntryContext = &Service->dwTag; + QueryTable[4].Name = L"Tag"; + QueryTable[4].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[4].EntryContext = &Service->dwTag; - Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES, - lpServiceName, - QueryTable, - NULL, - NULL); - if (!NT_SUCCESS(Status)) + Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES, + lpServiceName, + QueryTable, + NULL, + NULL); + if (!NT_SUCCESS(Status)) { - PrintString("RtlQueryRegistryValues() failed (Status %lx)\n", Status); - HeapFree(GetProcessHeap(), 0, Service); - return Status; + PrintString("RtlQueryRegistryValues() failed (Status %lx)\n", Status); + HeapFree(GetProcessHeap(), 0, Service); + return Status; } - DPRINT("ServiceName: '%S'\n", Service->lpServiceName); - DPRINT("ServiceGroup: '%wZ'\n", &Service->ServiceGroup); - DPRINT("Start %lx Type %lx Tag %lx ErrorControl %lx\n", - Service->dwStartType, - Service->Status.dwServiceType, - Service->dwTag, - Service->dwErrorControl); + DPRINT("ServiceName: '%S'\n", Service->lpServiceName); + DPRINT("ServiceGroup: '%wZ'\n", &Service->ServiceGroup); + DPRINT("Start %lx Type %lx Tag %lx ErrorControl %lx\n", + Service->dwStartType, + Service->Status.dwServiceType, + Service->dwTag, + Service->dwErrorControl); - /* Append service entry */ - InsertTailList(&ServiceListHead, - &Service->ServiceListEntry); + /* Append service entry */ + InsertTailList(&ServiceListHead, + &Service->ServiceListEntry); - Service->Status.dwCurrentState = SERVICE_STOPPED; - Service->Status.dwControlsAccepted = 0; - Service->Status.dwWin32ExitCode = 0; - Service->Status.dwServiceSpecificExitCode = 0; - Service->Status.dwCheckPoint = 0; - Service->Status.dwWaitHint = 2000; /* 2 seconds */ + Service->Status.dwCurrentState = SERVICE_STOPPED; + Service->Status.dwControlsAccepted = 0; + Service->Status.dwWin32ExitCode = 0; + Service->Status.dwServiceSpecificExitCode = 0; + Service->Status.dwCheckPoint = 0; + Service->Status.dwWaitHint = 2000; /* 2 seconds */ - return STATUS_SUCCESS; + return STATUS_SUCCESS; } NTSTATUS ScmCreateServiceDataBase(VOID) { - RTL_QUERY_REGISTRY_TABLE QueryTable[2]; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING ServicesKeyName = - RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Se rvices"); - UNICODE_STRING SubKeyName; - HKEY ServicesKey; - ULONG Index; - NTSTATUS Status; + RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING ServicesKeyName = + RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Se rvices"); + UNICODE_STRING SubKeyName; + HKEY ServicesKey; + ULONG Index; + NTSTATUS Status; - PKEY_BASIC_INFORMATION KeyInfo = NULL; - ULONG KeyInfoLength = 0; - ULONG ReturnedLength; + PKEY_BASIC_INFORMATION KeyInfo = NULL; + ULONG KeyInfoLength = 0; + ULONG ReturnedLength; - DPRINT("ScmCreateServiceDataBase() called\n"); + DPRINT("ScmCreateServiceDataBase() called\n"); - /* Initialize basic variables */ - InitializeListHead(&GroupListHead); - InitializeListHead(&ServiceListHead); + /* Initialize basic variables */ + InitializeListHead(&GroupListHead); + InitializeListHead(&ServiceListHead); - /* Initialize the database lock */ - RtlInitializeResource(&DatabaseLock); + /* Initialize the database lock */ + RtlInitializeResource(&DatabaseLock); - /* Build group order list */ - RtlZeroMemory(&QueryTable, - sizeof(QueryTable)); + /* Build group order list */ + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); - QueryTable[0].Name = L"List"; - QueryTable[0].QueryRoutine = CreateGroupListRoutine; + QueryTable[0].Name = L"List"; + QueryTable[0].QueryRoutine = CreateGroupListRoutine; - Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, - L"ServiceGroupOrder", - QueryTable, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - return Status; + Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, + L"ServiceGroupOrder", + QueryTable, + NULL, + NULL); + if (!NT_SUCCESS(Status)) + return Status; - RtlInitUnicodeString(&ServicesKeyName, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Services"); + RtlInitUnicodeString(&ServicesKeyName, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Services"); - InitializeObjectAttributes(&ObjectAttributes, - &ServicesKeyName, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); + InitializeObjectAttributes(&ObjectAttributes, + &ServicesKeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); - Status = RtlpNtOpenKey(&ServicesKey, - KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, - &ObjectAttributes, - 0); - if (!NT_SUCCESS(Status)) - return Status; + Status = RtlpNtOpenKey(&ServicesKey, + KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, + &ObjectAttributes, + 0); + if (!NT_SUCCESS(Status)) + return Status; - /* Allocate key info buffer */ - KeyInfoLength = sizeof(KEY_BASIC_INFORMATION) + MAX_PATH * sizeof(WCHAR); - KeyInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, KeyInfoLength); - if (KeyInfo == NULL) + /* Allocate key info buffer */ + KeyInfoLength = sizeof(KEY_BASIC_INFORMATION) + MAX_PATH * sizeof(WCHAR); + KeyInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, KeyInfoLength); + if (KeyInfo == NULL) { - NtClose(ServicesKey); - return STATUS_INSUFFICIENT_RESOURCES; + NtClose(ServicesKey); + return STATUS_INSUFFICIENT_RESOURCES; } - Index = 0; - while (TRUE) + Index = 0; + while (TRUE) { - Status = NtEnumerateKey(ServicesKey, - Index, - KeyBasicInformation, - KeyInfo, - KeyInfoLength, - &ReturnedLength); - if (NT_SUCCESS(Status)) - { - if (KeyInfo->NameLength < MAX_PATH * sizeof(WCHAR)) - { + Status = NtEnumerateKey(ServicesKey, + Index, + KeyBasicInformation, + KeyInfo, + KeyInfoLength, + &ReturnedLength); + if (NT_SUCCESS(Status)) + { + if (KeyInfo->NameLength < MAX_PATH * sizeof(WCHAR)) + { + SubKeyName.Length = KeyInfo->NameLength; + SubKeyName.MaximumLength = KeyInfo->NameLength + sizeof(WCHAR); + SubKeyName.Buffer = KeyInfo->Name; + SubKeyName.Buffer[SubKeyName.Length / sizeof(WCHAR)] = 0; - SubKeyName.Length = KeyInfo->NameLength; - SubKeyName.MaximumLength = KeyInfo->NameLength + sizeof(WCHAR); - SubKeyName.Buffer = KeyInfo->Name; - SubKeyName.Buffer[SubKeyName.Length / sizeof(WCHAR)] = 0; + DPRINT("KeyName: '%wZ'\n", &SubKeyName); + Status = CreateServiceListEntry(SubKeyName.Buffer); - DPRINT("KeyName: '%wZ'\n", &SubKeyName); - Status = CreateServiceListEntry(SubKeyName.Buffer); + /* Ignore services without proper registry. */ + if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + { + Status = STATUS_SUCCESS; + } + } + } - /* Ignore services without proper registry. */ - if (Status == STATUS_OBJECT_NAME_NOT_FOUND) - { - Status = STATUS_SUCCESS; - } - } - } + if (!NT_SUCCESS(Status)) + break; - if (!NT_SUCCESS(Status)) - break; - - Index++; + Index++; } - HeapFree(GetProcessHeap(), 0, KeyInfo); - NtClose(ServicesKey); + HeapFree(GetProcessHeap(), 0, KeyInfo); + NtClose(ServicesKey); - DPRINT("ScmCreateServiceDataBase() done\n"); + DPRINT("ScmCreateServiceDataBase() done\n"); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } static NTSTATUS ScmCheckDriver(PSERVICE Service) { - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING DirName; - HANDLE DirHandle; - NTSTATUS Status; - POBJECT_DIRECTORY_INFORMATION DirInfo; - ULONG BufferLength; - ULONG DataLength; - ULONG Index; - PLIST_ENTRY GroupEntry; - PSERVICE_GROUP CurrentGroup; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING DirName; + HANDLE DirHandle; + NTSTATUS Status; + POBJECT_DIRECTORY_INFORMATION DirInfo; + ULONG BufferLength; + ULONG DataLength; + ULONG Index; + PLIST_ENTRY GroupEntry; + PSERVICE_GROUP CurrentGroup; - DPRINT("ScmCheckDriver(%S) called\n", Service->lpServiceName); + DPRINT("ScmCheckDriver(%S) called\n", Service->lpServiceName); - if (Service->Status.dwServiceType == SERVICE_KERNEL_DRIVER) + if (Service->Status.dwServiceType == SERVICE_KERNEL_DRIVER) { - RtlInitUnicodeString(&DirName, - L"\\Driver"); + RtlInitUnicodeString(&DirName, + L"\\Driver"); } - else + else { - RtlInitUnicodeString(&DirName, - L"\\FileSystem"); + RtlInitUnicodeString(&DirName, + L"\\FileSystem"); } - InitializeObjectAttributes(&ObjectAttributes, - &DirName, - 0, - NULL, - NULL); + InitializeObjectAttributes(&ObjectAttributes, + &DirName, + 0, + NULL, + NULL); - Status = NtOpenDirectoryObject(&DirHandle, - DIRECTORY_QUERY | DIRECTORY_TRAVERSE, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) + Status = NtOpenDirectoryObject(&DirHandle, + DIRECTORY_QUERY | DIRECTORY_TRAVERSE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) { - return Status; + return Status; } - BufferLength = sizeof(OBJECT_DIRECTORY_INFORMATION) + - 2 * MAX_PATH * sizeof(WCHAR); - DirInfo = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - BufferLength); + BufferLength = sizeof(OBJECT_DIRECTORY_INFORMATION) + + 2 * MAX_PATH * sizeof(WCHAR); + DirInfo = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + BufferLength); - Index = 0; - while (TRUE) + Index = 0; + while (TRUE) { - Status = NtQueryDirectoryObject(DirHandle, - DirInfo, - BufferLength, - TRUE, - FALSE, - &Index, - &DataLength); - if (Status == STATUS_NO_MORE_ENTRIES) - { - /* FIXME: Add current service to 'failed service' list */ - DPRINT("Service '%S' failed\n", Service->lpServiceName); - break; - } + Status = NtQueryDirectoryObject(DirHandle, + DirInfo, + BufferLength, + TRUE, + FALSE, + &Index, + &DataLength); + if (Status == STATUS_NO_MORE_ENTRIES) + { + /* FIXME: Add current service to 'failed service' list */ + DPRINT("Service '%S' failed\n", Service->lpServiceName); + break; + } - if (!NT_SUCCESS(Status)) - break; + if (!NT_SUCCESS(Status)) + break; - DPRINT("Comparing: '%S' '%wZ'\n", Service->lpServiceName, &DirInfo->ObjectName); + DPRINT("Comparing: '%S' '%wZ'\n", Service->lpServiceName, &DirInfo->ObjectName); - if (_wcsicmp(Service->lpServiceName, DirInfo->ObjectName.Buffer) == 0) - { - DPRINT("Found: '%S' '%wZ'\n", Service->lpServiceName, &DirInfo->ObjectName); + if (_wcsicmp(Service->lpServiceName, DirInfo->ObjectName.Buffer) == 0) + { + DPRINT("Found: '%S' '%wZ'\n", + Service->lpServiceName, &DirInfo->ObjectName); - /* Mark service as 'running' */ - Service->Status.dwCurrentState = SERVICE_RUNNING; + /* Mark service as 'running' */ + Service->Status.dwCurrentState = SERVICE_RUNNING; - /* Find the driver's group and mark it as 'running' */ - if (Service->ServiceGroup.Buffer != NULL) - { - GroupEntry = GroupListHead.Flink; - while (GroupEntry != &GroupListHead) - { - CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); + /* Find the driver's group and mark it as 'running' */ + if (Service->ServiceGroup.Buffer != NULL) + { + GroupEntry = GroupListHead.Flink; + while (GroupEntry != &GroupListHead) + { + CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); - DPRINT("Checking group '%wZ'\n", &CurrentGroup->GroupName); - if (RtlEqualUnicodeString(&Service->ServiceGroup, &CurrentGroup->GroupName, TRUE)) - { - CurrentGroup->ServicesRunning = TRUE; - } + DPRINT("Checking group '%wZ'\n", &CurrentGroup->GroupName); + if (RtlEqualUnicodeString(&Service->ServiceGroup, &CurrentGroup->GroupName, TRUE)) + { + CurrentGroup->ServicesRunning = TRUE; + } - GroupEntry = GroupEntry->Flink; - } - } - break; - } + GroupEntry = GroupEntry->Flink; + } + } + break; + } } - HeapFree(GetProcessHeap(), - 0, - DirInfo); - NtClose(DirHandle); + HeapFree(GetProcessHeap(), + 0, + DirInfo); + NtClose(DirHandle); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } VOID ScmGetBootAndSystemDriverState(VOID) { - PLIST_ENTRY ServiceEntry; - PSERVICE CurrentService; + PLIST_ENTRY ServiceEntry; + PSERVICE CurrentService; - DPRINT("ScmGetBootAndSystemDriverState() called\n"); + DPRINT("ScmGetBootAndSystemDriverState() called\n"); - ServiceEntry = ServiceListHead.Flink; - while (ServiceEntry != &ServiceListHead) + ServiceEntry = ServiceListHead.Flink; + while (ServiceEntry != &ServiceListHead) { - CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); + CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - if (CurrentService->dwStartType == SERVICE_BOOT_START || - CurrentService->dwStartType == SERVICE_SYSTEM_START) - { - /* Check driver */ - DPRINT(" Checking service: %S\n", CurrentService->lpServiceName); + if (CurrentService->dwStartType == SERVICE_BOOT_START || + CurrentService->dwStartType == SERVICE_SYSTEM_START) + { + /* Check driver */ + DPRINT(" Checking service: %S\n", CurrentService->lpServiceName); - ScmCheckDriver(CurrentService); - } - ServiceEntry = ServiceEntry->Flink; + ScmCheckDriver(CurrentService); + } + + ServiceEntry = ServiceEntry->Flink; } - DPRINT("ScmGetBootAndSystemDriverState() done\n"); + DPRINT("ScmGetBootAndSystemDriverState() done\n"); } static NTSTATUS ScmSendStartCommand(PSERVICE Service, LPWSTR Arguments) { - PSCM_START_PACKET StartPacket; - DWORD TotalLength; + PSCM_START_PACKET StartPacket; + DWORD TotalLength; #if 0 - DWORD Length; + DWORD Length; #endif - PWSTR Ptr; - DWORD Count; + PWSTR Ptr; + DWORD Count; - DPRINT("ScmSendStartCommand() called\n"); + DPRINT("ScmSendStartCommand() called\n"); - /* Calculate the total length of the start command line */ - TotalLength = wcslen(Service->lpServiceName) + 1; + /* Calculate the total length of the start command line */ + TotalLength = wcslen(Service->lpServiceName) + 1; #if 0 - if (Arguments != NULL) - { - Ptr = Arguments; - while (*Ptr) + if (Arguments != NULL) { - Length = wcslen(Ptr) + 1; - TotalLength += Length; - Ptr += Length; + Ptr = Arguments; + while (*Ptr) + { + Length = wcslen(Ptr) + 1; + TotalLength += Length; + Ptr += Length; + } } - } #endif - TotalLength++; + TotalLength++; - /* Allocate start command packet */ - StartPacket = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(SCM_START_PACKET) + (TotalLength - 1) * sizeof(WCHAR)); - if (StartPacket == NULL) - return STATUS_INSUFFICIENT_RESOURCES; + /* Allocate start command packet */ + StartPacket = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SCM_START_PACKET) + (TotalLength - 1) * sizeof(WCHAR)); + if (StartPacket == NULL) + return STATUS_INSUFFICIENT_RESOURCES; - StartPacket->Command = SCM_START_COMMAND; - StartPacket->Size = TotalLength; - Ptr = &StartPacket->Arguments[0]; - wcscpy(Ptr, Service->lpServiceName); - Ptr += (wcslen(Service->lpServiceName) + 1); + StartPacket->Command = SCM_START_COMMAND; + StartPacket->Size = TotalLength; + Ptr = &StartPacket->Arguments[0]; + wcscpy(Ptr, Service->lpServiceName); + Ptr += (wcslen(Service->lpServiceName) + 1); - /* FIXME: Copy argument list */ + /* FIXME: Copy argument list */ - *Ptr = 0; + *Ptr = 0; - /* Send the start command */ - WriteFile(Service->ControlPipeHandle, - StartPacket, - sizeof(SCM_START_PACKET) + (TotalLength - 1) * sizeof(WCHAR), - &Count, - NULL); + /* Send the start command */ + WriteFile(Service->ControlPipeHandle, + StartPacket, + sizeof(SCM_START_PACKET) + (TotalLength - 1) * sizeof(WCHAR), + &Count, + NULL); - /* FIXME: Read the reply */ + /* FIXME: Read the reply */ - HeapFree(GetProcessHeap(), - 0, - StartPacket); + HeapFree(GetProcessHeap(), + 0, + StartPacket); - DPRINT("ScmSendStartCommand() done\n"); + DPRINT("ScmSendStartCommand() done\n"); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } static NTSTATUS ScmStartUserModeService(PSERVICE Service) { - RTL_QUERY_REGISTRY_TABLE QueryTable[3]; - PROCESS_INFORMATION ProcessInformation; - STARTUPINFOW StartupInfo; - UNICODE_STRING ImagePath; - ULONG Type; - BOOL Result; - NTSTATUS Status; + RTL_QUERY_REGISTRY_TABLE QueryTable[3]; + PROCESS_INFORMATION ProcessInformation; + STARTUPINFOW StartupInfo; + UNICODE_STRING ImagePath; + ULONG Type; + BOOL Result; + NTSTATUS Status; - RtlInitUnicodeString(&ImagePath, NULL); + RtlInitUnicodeString(&ImagePath, NULL); - /* Get service data */ - RtlZeroMemory(&QueryTable, - sizeof(QueryTable)); + /* Get service data */ + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); - QueryTable[0].Name = L"Type"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[0].EntryContext = &Type; + QueryTable[0].Name = L"Type"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[0].EntryContext = &Type; - QueryTable[1].Name = L"ImagePath"; - QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[1].EntryContext = &ImagePath; + QueryTable[1].Name = L"ImagePath"; + QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; + QueryTable[1].EntryContext = &ImagePath; - Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES, - Service->lpServiceName, - QueryTable, - NULL, - NULL); - if (!NT_SUCCESS(Status)) + Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES, + Service->lpServiceName, + QueryTable, + NULL, + NULL); + if (!NT_SUCCESS(Status)) { - DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status); - return Status; + DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status); + return Status; } - DPRINT("ImagePath: '%S'\n", ImagePath.Buffer); - DPRINT("Type: %lx\n", Type); + DPRINT("ImagePath: '%S'\n", ImagePath.Buffer); + DPRINT("Type: %lx\n", Type); - /* Create '\\.\pipe\net\NtControlPipe' instance */ - Service->ControlPipeHandle = CreateNamedPipeW(L"\\\\.\\pipe\\net\\NtControlPipe", - PIPE_ACCESS_DUPLEX, - PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, - 100, - 8000, - 4, - 30000, - NULL); - DPRINT("CreateNamedPipeW() done\n"); - if (Service->ControlPipeHandle == INVALID_HANDLE_VALUE) + /* Create '\\.\pipe\net\NtControlPipe' instance */ + Service->ControlPipeHandle = CreateNamedPipeW(L"\\\\.\\pipe\\net\\NtControlPipe", + PIPE_ACCESS_DUPLEX, + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, + 100, + 8000, + 4, + 30000, + NULL); + DPRINT("CreateNamedPipeW() done\n"); + if (Service->ControlPipeHandle == INVALID_HANDLE_VALUE) { - DPRINT1("Failed to create control pipe!\n"); - return STATUS_UNSUCCESSFUL; + DPRINT1("Failed to create control pipe!\n"); + return STATUS_UNSUCCESSFUL; } - StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.lpReserved = NULL; - StartupInfo.lpDesktop = NULL; - StartupInfo.lpTitle = NULL; - StartupInfo.dwFlags = 0; - StartupInfo.cbReserved2 = 0; - StartupInfo.lpReserved2 = 0; + StartupInfo.cb = sizeof(StartupInfo); + StartupInfo.lpReserved = NULL; + StartupInfo.lpDesktop = NULL; + StartupInfo.lpTitle = NULL; + StartupInfo.dwFlags = 0; + StartupInfo.cbReserved2 = 0; + StartupInfo.lpReserved2 = 0; - Result = CreateProcessW(ImagePath.Buffer, - NULL, - NULL, - NULL, - FALSE, - DETACHED_PROCESS | CREATE_SUSPENDED, - NULL, - NULL, - &StartupInfo, - &ProcessInformation); - RtlFreeUnicodeString(&ImagePath); + Result = CreateProcessW(ImagePath.Buffer, + NULL, + NULL, + NULL, + FALSE, + DETACHED_PROCESS | CREATE_SUSPENDED, + NULL, + NULL, + &StartupInfo, + &ProcessInformation); + RtlFreeUnicodeString(&ImagePath); - if (!Result) + if (!Result) { - /* Close control pipe */ - CloseHandle(Service->ControlPipeHandle); - Service->ControlPipeHandle = INVALID_HANDLE_VALUE; + /* Close control pipe */ + CloseHandle(Service->ControlPipeHandle); + Service->ControlPipeHandle = INVALID_HANDLE_VALUE; - DPRINT1("Starting '%S' failed!\n", Service->lpServiceName); - return STATUS_UNSUCCESSFUL; + DPRINT1("Starting '%S' failed!\n", Service->lpServiceName); + return STATUS_UNSUCCESSFUL; } - DPRINT("Process Id: %lu Handle %lx\n", - ProcessInformation.dwProcessId, - ProcessInformation.hProcess); - DPRINT("Thread Id: %lu Handle %lx\n", - ProcessInformation.dwThreadId, - ProcessInformation.hThread); + DPRINT("Process Id: %lu Handle %lx\n", + ProcessInformation.dwProcessId, + ProcessInformation.hProcess); + DPRINT("Thread Id: %lu Handle %lx\n", + ProcessInformation.dwThreadId, + ProcessInformation.hThread); - /* Get process and thread ids */ - Service->ProcessId = ProcessInformation.dwProcessId; - Service->ThreadId = ProcessInformation.dwThreadId; + /* Get process and thread ids */ + Service->ProcessId = ProcessInformation.dwProcessId; + Service->ThreadId = ProcessInformation.dwThreadId; - /* Resume Thread */ - ResumeThread(ProcessInformation.hThread); + /* Resume Thread */ + ResumeThread(ProcessInformation.hThread); - /* Connect control pipe */ - if (ConnectNamedPipe(Service->ControlPipeHandle, NULL)) + /* Connect control pipe */ + if (ConnectNamedPipe(Service->ControlPipeHandle, NULL)) { - DWORD dwProcessId = 0; - DWORD dwRead = 0; + DWORD dwProcessId = 0; + DWORD dwRead = 0; - DPRINT("Control pipe connected!\n"); + DPRINT("Control pipe connected!\n"); - /* Read thread id from pipe */ - if (!ReadFile(Service->ControlPipeHandle, - (LPVOID)&dwProcessId, - sizeof(DWORD), - &dwRead, - NULL)) - { - DPRINT1("Reading the service control pipe failed (Error %lu)\n", - GetLastError()); - Status = STATUS_UNSUCCESSFUL; - } - else - { - DPRINT("Received process id %lu\n", dwProcessId); + /* Read thread id from pipe */ + if (!ReadFile(Service->ControlPipeHandle, + (LPVOID)&dwProcessId, + sizeof(DWORD), + &dwRead, + NULL)) + { + DPRINT1("Reading the service control pipe failed (Error %lu)\n", + GetLastError()); + Status = STATUS_UNSUCCESSFUL; + } + else + { + DPRINT("Received process id %lu\n", dwProcessId); - /* FIXME: Send start command */ + /* FIXME: Send start command */ - Status = STATUS_SUCCESS; - } + Status = STATUS_SUCCESS; + } } - else + else { - DPRINT("Connecting control pipe failed!\n"); + DPRINT("Connecting control pipe failed!\n"); - /* Close control pipe */ - CloseHandle(Service->ControlPipeHandle); - Service->ControlPipeHandle = INVALID_HANDLE_VALUE; - Service->ProcessId = 0; - Service->ThreadId = 0; - Status = STATUS_UNSUCCESSFUL; + /* Close control pipe */ + CloseHandle(Service->ControlPipeHandle); + Service->ControlPipeHandle = INVALID_HANDLE_VALUE; + Service->ProcessId = 0; + Service->ThreadId = 0; + Status = STATUS_UNSUCCESSFUL; } - ScmSendStartCommand(Service, NULL); + ScmSendStartCommand(Service, NULL); - /* Close process and thread handle */ - CloseHandle(ProcessInformation.hThread); - CloseHandle(ProcessInformation.hProcess); + /* Close process and thread handle */ + CloseHandle(ProcessInformation.hThread); + CloseHandle(ProcessInformation.hProcess); - return Status; + return Status; } static NTSTATUS ScmStartService(PSERVICE Service, - PSERVICE_GROUP Group) + PSERVICE_GROUP Group) { - WCHAR szDriverPath[MAX_PATH]; - UNICODE_STRING DriverPath; - NTSTATUS Status; [truncated at 1000 lines; 1627 more skipped]
19 years, 2 months
1
0
0
0
[ekohl] 18685: Simplify services.exe.
by ekohl@svn.reactos.com
Simplify services.exe. Modified: trunk/reactos/subsys/system/services/database.c Modified: trunk/reactos/subsys/system/services/rpcserver.c Modified: trunk/reactos/subsys/system/services/services.h _____ Modified: trunk/reactos/subsys/system/services/database.c --- trunk/reactos/subsys/system/services/database.c 2005-10-22 18:32:16 UTC (rev 18684) +++ trunk/reactos/subsys/system/services/database.c 2005-10-22 18:59:39 UTC (rev 18685) @@ -56,7 +56,7 @@ /* FUNCTIONS *****************************************************************/ PSERVICE -ScmGetServiceEntryByName(PUNICODE_STRING ServiceName) +ScmGetServiceEntryByName(LPWSTR lpServiceName) { PLIST_ENTRY ServiceEntry; PSERVICE CurrentService; @@ -69,9 +69,9 @@ CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - if (RtlEqualUnicodeString(&CurrentService->ServiceName, ServiceName, TRUE)) + if (_wcsicmp(CurrentService->lpServiceName, lpServiceName) == 0) { - DPRINT("Found service: '%wZ'\n", &CurrentService->ServiceName); + DPRINT("Found service: '%S'\n", CurrentService->lpServiceName); return CurrentService; } @@ -183,70 +183,44 @@ static NTSTATUS STDCALL -CreateServiceListEntry(PUNICODE_STRING ServiceName) +CreateServiceListEntry(LPWSTR lpServiceName) { RTL_QUERY_REGISTRY_TABLE QueryTable[6]; + UNICODE_STRING ServiceName; PSERVICE Service = NULL; NTSTATUS Status; DPRINT("Service: '%wZ'\n", ServiceName); + /* Allocate service entry */ - Service = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(SERVICE)); + Service = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SERVICE) + ((wcslen(lpServiceName) + 1) * sizeof(WCHAR))); if (Service == NULL) { return STATUS_INSUFFICIENT_RESOURCES; } /* Copy service name */ - Service->ServiceName.Length = ServiceName->Length; - Service->ServiceName.MaximumLength = ServiceName->Length + sizeof(WCHAR); - Service->ServiceName.Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - Service->ServiceName.MaximumLength); - if (Service->ServiceName.Buffer == NULL) - { - HeapFree(GetProcessHeap(), 0, Service); - return STATUS_INSUFFICIENT_RESOURCES; - } + wcscpy(Service->szServiceName, lpServiceName); + Service->lpServiceName = Service->szServiceName; - RtlCopyMemory(Service->ServiceName.Buffer, - ServiceName->Buffer, - ServiceName->Length); - Service->ServiceName.Buffer[ServiceName->Length / sizeof(WCHAR)] = 0; - - /* Build registry path */ - Service->RegistryPath.MaximumLength = MAX_PATH * sizeof(WCHAR); - Service->RegistryPath.Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - MAX_PATH * sizeof(WCHAR)); - if (Service->ServiceName.Buffer == NULL) - { - HeapFree(GetProcessHeap(), 0, Service->ServiceName.Buffer); - HeapFree(GetProcessHeap(), 0, Service); - return STATUS_INSUFFICIENT_RESOURCES; - } - - wcscpy(Service->RegistryPath.Buffer, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"); - wcscat(Service->RegistryPath.Buffer, - Service->ServiceName.Buffer); - Service->RegistryPath.Length = wcslen(Service->RegistryPath.Buffer) * sizeof(WCHAR); - /* Get service data */ RtlZeroMemory(&QueryTable, sizeof(QueryTable)); QueryTable[0].Name = L"Start"; QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[0].EntryContext = &Service->Start; + QueryTable[0].EntryContext = &Service->dwStartType; QueryTable[1].Name = L"Type"; QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[1].EntryContext = &Service->Type; + QueryTable[1].EntryContext = &Service->Status.dwServiceType; QueryTable[2].Name = L"ErrorControl"; QueryTable[2].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[2].EntryContext = &Service->ErrorControl; + QueryTable[2].EntryContext = &Service->dwErrorControl; QueryTable[3].Name = L"Group"; QueryTable[3].Flags = RTL_QUERY_REGISTRY_DIRECT; @@ -254,38 +228,38 @@ QueryTable[4].Name = L"Tag"; QueryTable[4].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[4].EntryContext = &Service->Tag; + QueryTable[4].EntryContext = &Service->dwTag; Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES, - ServiceName->Buffer, + lpServiceName, QueryTable, NULL, NULL); if (!NT_SUCCESS(Status)) { PrintString("RtlQueryRegistryValues() failed (Status %lx)\n", Status); - RtlFreeUnicodeString(&Service->RegistryPath); - RtlFreeUnicodeString(&Service->ServiceName); HeapFree(GetProcessHeap(), 0, Service); return Status; } - DPRINT("ServiceName: '%wZ'\n", &Service->ServiceName); - DPRINT("RegistryPath: '%wZ'\n", &Service->RegistryPath); + DPRINT("ServiceName: '%S'\n", Service->lpServiceName); DPRINT("ServiceGroup: '%wZ'\n", &Service->ServiceGroup); DPRINT("Start %lx Type %lx Tag %lx ErrorControl %lx\n", - Service->Start, Service->Type, Service->Tag, Service->ErrorControl); + Service->dwStartType, + Service->Status.dwServiceType, + Service->dwTag, + Service->dwErrorControl); /* Append service entry */ InsertTailList(&ServiceListHead, &Service->ServiceListEntry); - Service->CurrentState = SERVICE_STOPPED; - Service->ControlsAccepted = 0; - Service->Win32ExitCode = 0; - Service->ServiceSpecificExitCode = 0; - Service->CheckPoint = 0; - Service->WaitHint = 2000; /* 2 seconds */ + Service->Status.dwCurrentState = SERVICE_STOPPED; + Service->Status.dwControlsAccepted = 0; + Service->Status.dwWin32ExitCode = 0; + Service->Status.dwServiceSpecificExitCode = 0; + Service->Status.dwCheckPoint = 0; + Service->Status.dwWaitHint = 2000; /* 2 seconds */ return STATUS_SUCCESS; } @@ -376,7 +350,7 @@ SubKeyName.Buffer[SubKeyName.Length / sizeof(WCHAR)] = 0; DPRINT("KeyName: '%wZ'\n", &SubKeyName); - Status = CreateServiceListEntry(&SubKeyName); + Status = CreateServiceListEntry(SubKeyName.Buffer); /* Ignore services without proper registry. */ if (Status == STATUS_OBJECT_NAME_NOT_FOUND) @@ -415,9 +389,9 @@ PLIST_ENTRY GroupEntry; PSERVICE_GROUP CurrentGroup; - DPRINT("ScmCheckDriver(%wZ) called\n", &Service->ServiceName); + DPRINT("ScmCheckDriver(%S) called\n", Service->lpServiceName); - if (Service->Type == SERVICE_KERNEL_DRIVER) + if (Service->Status.dwServiceType == SERVICE_KERNEL_DRIVER) { RtlInitUnicodeString(&DirName, L"\\Driver"); @@ -461,21 +435,21 @@ if (Status == STATUS_NO_MORE_ENTRIES) { /* FIXME: Add current service to 'failed service' list */ - DPRINT("Service '%wZ' failed\n", &Service->ServiceName); + DPRINT("Service '%S' failed\n", Service->lpServiceName); break; } if (!NT_SUCCESS(Status)) break; - DPRINT("Comparing: '%wZ' '%wZ'\n", &Service->ServiceName, &DirInfo->ObjectName); + DPRINT("Comparing: '%S' '%wZ'\n", Service->lpServiceName, &DirInfo->ObjectName); - if (RtlEqualUnicodeString(&Service->ServiceName, &DirInfo->ObjectName, TRUE)) + if (_wcsicmp(Service->lpServiceName, DirInfo->ObjectName.Buffer) == 0) { - DPRINT("Found: '%wZ' '%wZ'\n", &Service->ServiceName, &DirInfo->ObjectName); + DPRINT("Found: '%S' '%wZ'\n", Service->lpServiceName, &DirInfo->ObjectName); /* Mark service as 'running' */ - Service->CurrentState = SERVICE_RUNNING; + Service->Status.dwCurrentState = SERVICE_RUNNING; /* Find the driver's group and mark it as 'running' */ if (Service->ServiceGroup.Buffer != NULL) @@ -520,11 +494,11 @@ { CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); - if (CurrentService->Start == SERVICE_BOOT_START || - CurrentService->Start == SERVICE_SYSTEM_START) + if (CurrentService->dwStartType == SERVICE_BOOT_START || + CurrentService->dwStartType == SERVICE_SYSTEM_START) { /* Check driver */ - DPRINT(" Checking service: %wZ\n", &CurrentService->ServiceName); + DPRINT(" Checking service: %S\n", CurrentService->lpServiceName); ScmCheckDriver(CurrentService); } @@ -549,7 +523,7 @@ DPRINT("ScmSendStartCommand() called\n"); /* Calculate the total length of the start command line */ - TotalLength = wcslen(Service->ServiceName.Buffer) + 1; + TotalLength = wcslen(Service->lpServiceName) + 1; #if 0 if (Arguments != NULL) { @@ -574,8 +548,8 @@ StartPacket->Command = SCM_START_COMMAND; StartPacket->Size = TotalLength; Ptr = &StartPacket->Arguments[0]; - wcscpy(Ptr, Service->ServiceName.Buffer); - Ptr += (wcslen(Service->ServiceName.Buffer) + 1); + wcscpy(Ptr, Service->lpServiceName); + Ptr += (wcslen(Service->lpServiceName) + 1); /* FIXME: Copy argument list */ @@ -626,7 +600,7 @@ QueryTable[1].EntryContext = &ImagePath; Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES, - Service->ServiceName.Buffer, + Service->lpServiceName, QueryTable, NULL, NULL); @@ -680,7 +654,7 @@ CloseHandle(Service->ControlPipeHandle); Service->ControlPipeHandle = INVALID_HANDLE_VALUE; - DPRINT1("Starting '%S' failed!\n", Service->ServiceName.Buffer); + DPRINT1("Starting '%S' failed!\n", Service->lpServiceName); return STATUS_UNSUCCESSFUL; } @@ -752,20 +726,30 @@ ScmStartService(PSERVICE Service, PSERVICE_GROUP Group) { + WCHAR szDriverPath[MAX_PATH]; + UNICODE_STRING DriverPath; NTSTATUS Status; DPRINT("ScmStartService() called\n"); Service->ControlPipeHandle = INVALID_HANDLE_VALUE; - DPRINT("Service->Type: %u\n", Service->Type); + DPRINT("Service->Type: %lu\n", Service->Status.dwServiceType); - if (Service->Type == SERVICE_KERNEL_DRIVER || - Service->Type == SERVICE_FILE_SYSTEM_DRIVER || - Service->Type == SERVICE_RECOGNIZER_DRIVER) + if (Service->Status.dwServiceType == SERVICE_KERNEL_DRIVER || + Service->Status.dwServiceType == SERVICE_FILE_SYSTEM_DRIVER || + Service->Status.dwServiceType == SERVICE_RECOGNIZER_DRIVER) { /* Load driver */ - DPRINT(" Path: %wZ\n", &Service->RegistryPath); - Status = NtLoadDriver(&Service->RegistryPath); + wcscpy(szDriverPath, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Services"); + wcscat(szDriverPath, + Service->lpServiceName); + + RtlInitUnicodeString(&DriverPath, + szDriverPath); + + DPRINT(" Path: %wZ\n", &DriverPath); + Status = NtLoadDriver(&DriverPath); } else { @@ -781,7 +765,7 @@ { Group->ServicesRunning = TRUE; } - Service->CurrentState = SERVICE_RUNNING; + Service->Status.dwCurrentState = SERVICE_RUNNING; } #if 0 else @@ -852,9 +836,9 @@ CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); if ((RtlEqualUnicodeString(&CurrentGroup->GroupName, &CurrentService->ServiceGroup, TRUE)) && - (CurrentService->Start == SERVICE_AUTO_START) && + (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE) && - (CurrentService->Tag == CurrentGroup->TagArray[i])) + (CurrentService->dwTag == CurrentGroup->TagArray[i])) { CurrentService->ServiceVisited = TRUE; ScmStartService(CurrentService, @@ -872,7 +856,7 @@ CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); if ((RtlEqualUnicodeString(&CurrentGroup->GroupName, &CurrentService->ServiceGroup, TRUE)) && - (CurrentService->Start == SERVICE_AUTO_START) && + (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; @@ -893,7 +877,7 @@ CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); if ((CurrentService->ServiceGroup.Length != 0) && - (CurrentService->Start == SERVICE_AUTO_START) && + (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; @@ -911,7 +895,7 @@ CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); if ((CurrentService->ServiceGroup.Length == 0) && - (CurrentService->Start == SERVICE_AUTO_START) && + (CurrentService->dwStartType == SERVICE_AUTO_START) && (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; _____ Modified: trunk/reactos/subsys/system/services/rpcserver.c --- trunk/reactos/subsys/system/services/rpcserver.c 2005-10-22 18:32:16 UTC (rev 18684) +++ trunk/reactos/subsys/system/services/rpcserver.c 2005-10-22 18:59:39 UTC (rev 18685) @@ -306,13 +306,9 @@ /* Return service status information */ - lpServiceStatus->dwServiceType = lpService->Type; - lpServiceStatus->dwCurrentState = lpService->CurrentState; - lpServiceStatus->dwControlsAccepted = lpService->ControlsAccepted; - lpServiceStatus->dwWin32ExitCode = lpService->Win32ExitCode; - lpServiceStatus->dwServiceSpecificExitCode = lpService->ServiceSpecificExitCode; - lpServiceStatus->dwCheckPoint = lpService->CheckPoint; - lpServiceStatus->dwWaitHint = lpService->WaitHint; + RtlCopyMemory(lpServiceStatus, + &lpService->Status, + sizeof(SERVICE_STATUS)); return ERROR_SUCCESS; } @@ -435,13 +431,7 @@ } /* Return service status information */ - lpServiceStatus->dwServiceType = lpService->Type; - lpServiceStatus->dwCurrentState = lpService->CurrentState; - lpServiceStatus->dwControlsAccepted = lpService->ControlsAccepted; - lpServiceStatus->dwWin32ExitCode = lpService->Win32ExitCode; - lpServiceStatus->dwServiceSpecificExitCode = lpService->ServiceSpecificExitCode; - lpServiceStatus->dwCheckPoint = lpService->CheckPoint; - lpServiceStatus->dwWaitHint = lpService->WaitHint; + RtlCopyMemory(lpServiceStatus, &lpService->Status, sizeof(SERVICE_STATUS)); return ERROR_SUCCESS; } @@ -479,7 +469,29 @@ } +/* Function 11 */ #if 0 +unsigned long +ScmrChangeServiceConfigW([in] handle_t BiningHandle, + [in] SC_HANDLE hService, + [in] DWORD dwServiceType, + [in] DWORD dwStartType, + [in] DWORD dwErrorControl, + [in, string, unique] LPCWSTR lpBinaryPathName, + [in, string, unique] LPCWSTR lpLoadOrderGroup, + [in, out, unique] LPDWORD lpdwTagId, + [in, size_is(dwDependenciesLength), unique] LPCWSTR lpDependencies, + [in] DWORD dwDependenciesLength, + [in, string, unique] LPCWSTR lpServiceStartName, + [in, size_is(dwPasswordLength), unique] LPCWSTR lpPassword, + [in] DWORD dwPasswordLength, + [in, string, unique] LPCWSTR lpDisplayName) +{ +} +#endif + + +#if 0 static DWORD CreateServiceKey(LPWSTR lpServiceName, PHKEY phKey) { @@ -592,6 +604,8 @@ } /* FIXME: Allocate and fill a service entry */ +// dwError = CreateNewServiceListEntry(lpServiceName, +// &lpServiceEntry) // if (lpdwTagId != NULL) // *lpdwTagId = 0; @@ -605,7 +619,7 @@ if (dwError != ERROR_SUCCESS) goto done; - if ((lpDisplayName != NULL) && (wcslen(lpDisplayName) > 0)) + if (lpDisplayName != NULL && *lpDisplayName != 0) { RegSetValueExW(hServiceKey, L"DisplayName", @@ -683,6 +697,16 @@ goto done; } + if (lpDependencies != NULL && *lpDependencies != 0) + { + /* FIXME: Write dependencies */ + } + + if (lpPassword != NULL) + { + /* FIXME: Write password */ + } + done:; if (hServiceKey != NULL) RegCloseKey(hServiceKey); @@ -750,7 +774,6 @@ unsigned long dwDesiredAccess, unsigned int *hService) { - UNICODE_STRING ServiceName; PSERVICE lpService; PMANAGER_HANDLE hManager; SC_HANDLE hHandle; @@ -772,10 +795,7 @@ /* FIXME: Lock the service list */ /* Get service database entry */ - RtlInitUnicodeString(&ServiceName, - lpServiceName); - - lpService = ScmGetServiceEntryByName(&ServiceName); + lpService = ScmGetServiceEntryByName(lpServiceName); if (lpService == NULL) { DPRINT1("Could not find a service!\n"); _____ Modified: trunk/reactos/subsys/system/services/services.h --- trunk/reactos/subsys/system/services/services.h 2005-10-22 18:32:16 UTC (rev 18684) +++ trunk/reactos/subsys/system/services/services.h 2005-10-22 18:59:39 UTC (rev 18685) @@ -11,28 +11,24 @@ typedef struct _SERVICE { - LIST_ENTRY ServiceListEntry; - UNICODE_STRING ServiceName; - UNICODE_STRING RegistryPath; - UNICODE_STRING ServiceGroup; + LIST_ENTRY ServiceListEntry; + LPWSTR lpServiceName; + UNICODE_STRING ServiceGroup; - ULONG Start; - ULONG Type; - ULONG ErrorControl; - ULONG Tag; + SERVICE_STATUS Status; + DWORD dwStartType; + DWORD dwErrorControl; + DWORD dwTag; - ULONG CurrentState; - ULONG ControlsAccepted; - ULONG Win32ExitCode; - ULONG ServiceSpecificExitCode; - ULONG CheckPoint; - ULONG WaitHint; + ULONG Flags; - BOOLEAN ServiceVisited; + BOOLEAN ServiceVisited; - HANDLE ControlPipeHandle; - ULONG ProcessId; - ULONG ThreadId; + HANDLE ControlPipeHandle; + ULONG ProcessId; + ULONG ThreadId; + + WCHAR szServiceName[1]; } SERVICE, *PSERVICE; @@ -47,7 +43,7 @@ VOID ScmGetBootAndSystemDriverState(VOID); VOID ScmAutoStartServices(VOID); -PSERVICE ScmGetServiceEntryByName(PUNICODE_STRING ServiceName); +PSERVICE ScmGetServiceEntryByName(LPWSTR lpServiceName); DWORD ScmMarkServiceForDelete(PSERVICE pService);
19 years, 2 months
1
0
0
0
[gvg] 18684: Move some of the DLLs a bit so they won't have to be relocated. Sort by
by gvg@svn.reactos.com
Move some of the DLLs a bit so they won't have to be relocated. Sort by address. Modified: trunk/reactos/baseaddress.xml _____ Modified: trunk/reactos/baseaddress.xml --- trunk/reactos/baseaddress.xml 2005-10-22 17:18:33 UTC (rev 18683) +++ trunk/reactos/baseaddress.xml 2005-10-22 18:32:16 UTC (rev 18684) @@ -5,17 +5,22 @@ <property name="BASEADDRESS_UXTHEME" value="0x5AD70000" /> <property name="BASEADDRESS_VDMDBG" value="0x5B0D0000" /> <property name="BASEADDRESS_OBJSEL" value="0x5B400000" /> +<property name="BASEADDRESS_SLAYER" value="0x5C7E0000" /> <property name="BASEADDRESS_DINPUT" value="0x5F580000" /> <property name="BASEADDRESS_HDWWIZ" value="0x64D40000" /> <property name="BASEADDRESS_TIMEDATE" value="0x64DA0000" /> <property name="BASEADDRESS_SYSDM" value="0x64DD0000" /> +<property name="BASEADDRESS_NCPL" value="0x64EA0000" /> <property name="BASEADDRESS_MAIN" value="0x64F40000" /> <property name="BASEADDRESS_INTL" value="0x64FB0000" /> <property name="BASEADDRESS_DESK" value="0x65080000" /> <property name="BASEADDRESS_APPWIZ" value="0x65100000" /> <property name="BASEADDRESS_ACCESS" value="0x65180000" /> +<property name="BASEADDRESS_HID" value="0x688F0000" /> +<property name="BASEADDRESS_PSXDLL" value="0x68eb0000" /> <property name="BASEADDRESS_PSAPI" value="0x68f70000" /> <property name="BASEADDRESS_MSIMG32" value="0x69cc0000" /> +<property name="BASEADDRESS_NETPLWIZ" value="0x6a240000" /> <property name="BASEADDRESS_UNICODE" value="0x6b200000" /> <property name="BASEADDRESS_ADVPACK" value="0x6b300000" /> <property name="BASEADDRESS_CONTROL" value="0x6b310000" /> @@ -28,7 +33,6 @@ <property name="BASEADDRESS_MESA32" value="0x6b380000" /> <property name="BASEADDRESS_OPENGL32" value="0x6b390000" /> <property name="BASEADDRESS_SECUR32" value="0x6b3A0000" /> -<property name="BASEADDRESS_SECURITY" value="0x71F10000" /> <property name="BASEADDRESS_SMDLL" value="0x6b3B0000" /> <property name="BASEADDRESS_URLMON" value="0x6b3C0000" /> <property name="BASEADDRESS_SERIALUI" value="0x6b3D0000" /> @@ -37,27 +41,37 @@ <property name="BASEADDRESS_WININET" value="0x70200000" /> <property name="BASEADDRESS_ACLUI" value="0x71550000" /> <property name="BASEADDRESS_SHDOCVW" value="0x71700000" /> +<property name="BASEADDRESS_MSWSOCK" value="0x71a30000" /> <property name="BASEADDRESS_WSOCK32" value="0x71ab0000" /> <property name="BASEADDRESS_ACLEDIT" value="0x71b70000" /> <property name="BASEADDRESS_NETAPI32" value="0x71c00000" /> +<property name="BASEADDRESS_SECURITY" value="0x71F10000" /> +<property name="BASEADDRESS_WINFAX" value="0x722C0000" /> +<property name="BASEADDRESS_WINSCARD" value="0x723D0000" /> +<property name="BASEADDRESS_DEVMGR" value="0x72a90000" /> <property name="BASEADDRESS_LZ32" value="0x73d80000" /> +<property name="BASEADDRESS_COREDLL" value="0x73d80000" /> <property name="BASEADDRESS_USERENV" value="0x74850000" /> <property name="BASEADDRESS_SYSSETUP" value="0x74a30000" /> +<property name="BASEADDRESS_OLEDLG" value="0x74d00000" /> <property name="BASEADDRESS_SAMSRV" value="0x74f30000" /> <property name="BASEADDRESS_SAMLIB" value="0x750C0000" /> <property name="BASEADDRESS_CABINET" value="0x75120000" /> <property name="BASEADDRESS_MSGINA" value="0x75970000" /> <property name="BASEADDRESS_IMM32" value="0x75e60000" /> +<property name="BASEADDRESS_COMMCTRL" value="0x75e60000" /> <property name="BASEADDRESS_RPCRT4" value="0x76000000" /> <property name="BASEADDRESS_SHLWAPI" value="0x76120000" /> <property name="BASEADDRESS_COMCTL32" value="0x76160000" /> <property name="BASEADDRESS_COMDLG32" value="0x76200000" /> <property name="BASEADDRESS_OLEAUT32" value="0x76260000" /> <property name="BASEADDRESS_RICHED32" value="0x76340000" /> +<property name="BASEADDRESS_D3D8THK" value="0x76340000" /> <property name="BASEADDRESS_RICHED20" value="0x76360000" /> <property name="BASEADDRESS_TWAIN_32" value="0x76380000" /> <property name="BASEADDRESS_LSASRV" value="0x76540000" /> <property name="BASEADDRESS_MIDIMAP" value="0x76600000" /> +<property name="BASEADDRESS_ODBC32" value="0x76660000" /> <property name="BASEADDRESS_WAVEMAP" value="0x76610000" /> <property name="BASEADDRESS_MPR" value="0x76620000" /> <property name="BASEADDRESS_SETUPAPI" value="0x76660000" /> @@ -68,49 +82,33 @@ <property name="BASEADDRESS_FMIFS" value="0x76df0000" /> <property name="BASEADDRESS_SHELL32" value="0x77260000" /> <property name="BASEADDRESS_IPHLPAPI" value="0x77400000" /> +<property name="BASEADDRESS_MSVFW32" value="0x77400000" /> +<property name="BASEADDRESS_MSACM32" value="0x77400000" /> <property name="BASEADDRESS_MMDRV" value="0x77530000" /> <property name="BASEADDRESS_CRTDLL" value="0x77630000" /> +<property name="BASEADDRESS_AUTHZ" value="0x77690000" /> <property name="BASEADDRESS_CFGMGR32" value="0x77700000" /> +<property name="BASEADDRESS_PACKET" value="0x77780000" /> <property name="BASEADDRESS_MSAFD" value="0x777a0000" /> <property name="BASEADDRESS_MSI" value="0x777b0000" /> <property name="BASEADDRESS_SNMPAPI" value="0x777c0000" /> +<property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" /> +<property name="BASEADDRESS_WSHTCPIP" value="0x777c0000" /> <property name="BASEADDRESS_WINMM" value="0x777d0000" /> <property name="BASEADDRESS_WS2HELP" value="0x777e0000" /> <property name="BASEADDRESS_WSHIRDA" value="0x777f0000" /> <property name="BASEADDRESS_WINSPOOL" value="0x77800000" /> -<property name="BASEADDRESS_VERSION" value="0x77a90000" /> -<property name="BASEADDRESS_WS2_32" value="0x77aa0000" /> +<property name="BASEADDRESS_VERSION" value="0x77a40000" /> <property name="BASEADDRESS_OLE32" value="0x77a50000" /> +<property name="BASEADDRESS_WS2_32" value="0x77aa0000" /> <property name="BASEADDRESS_OLEPRO32" value="0x77aa0000" /> <property name="BASEADDRESS_ADVAPI32" value="0x77dc0000" /> <property name="BASEADDRESS_USER32" value="0x77e50000" /> -<property name="BASEADDRESS_GDI32" value="0x77ee0000" /> -<property name="BASEADDRESS_DNSAPI" value="0x77f00000" /> +<property name="BASEADDRESS_GDI32" value="0x77f10000" /> +<property name="BASEADDRESS_DNSAPI" value="0x77f30000" /> <property name="BASEADDRESS_MSVCRT" value="0x78000000" /> <property name="BASEADDRESS_MSVCRT20" value="0x78500000" /> -<property name="BASEADDRESS_MSVFW32" value="0x77400000" /> -<property name="BASEADDRESS_MSWSOCK" value="0x71a30000" /> <property name="BASEADDRESS_KERNEL32" value="0x7c800000" /> <property name="BASEADDRESS_NTDLL" value="0x7C900000" /> <property name="BASEADDRESS_FREETYPE" value="0x7F000000" /> - -<property name="BASEADDRESS_SLAYER" value="0x5C7E0000" /> -<property name="BASEADDRESS_NCPL" value="0x64EA0000" /> -<property name="BASEADDRESS_HID" value="0x688F0000" /> -<property name="BASEADDRESS_PSXDLL" value="0x68eb0000" /> -<property name="BASEADDRESS_NETPLWIZ" value="0x6a240000" /> -<property name="BASEADDRESS_ACLUI" value="0x71550000" /> -<property name="BASEADDRESS_WINFAX" value="0x722C0000" /> -<property name="BASEADDRESS_DEVMGR" value="0x72a90000" /> -<property name="BASEADDRESS_WINSCARD" value="0x723D0000" /> -<property name="BASEADDRESS_COREDLL" value="0x73d80000" /> -<property name="BASEADDRESS_OLEDLG" value="0x74d00000" /> -<property name="BASEADDRESS_COMMCTRL" value="0x75e60000" /> -<property name="BASEADDRESS_D3D8THK" value="0x76340000" /> -<property name="BASEADDRESS_ODBC32" value="0x76660000" /> -<property name="BASEADDRESS_MSACM32" value="0x77400000" /> -<property name="BASEADDRESS_PACKET" value="0x77780000" /> -<property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" /> -<property name="BASEADDRESS_WSHTCPIP" value="0x777c0000" /> -<property name="BASEADDRESS_AUTHZ" value="0x77690000" /> </group>
19 years, 2 months
1
0
0
0
[hpoussin] 18683: Add a display class installer (useful when installing display drivers)
by hpoussin@svn.reactos.com
Add a display class installer (useful when installing display drivers) Use a common header for desk.cpl files Modified: trunk/reactos/bootdata/packages/reactos.dff Modified: trunk/reactos/lib/cpl/desk/appearance.c Modified: trunk/reactos/lib/cpl/desk/background.c Added: trunk/reactos/lib/cpl/desk/classinst.c Modified: trunk/reactos/lib/cpl/desk/desk.c Modified: trunk/reactos/lib/cpl/desk/desk.def Modified: trunk/reactos/lib/cpl/desk/desk.h Modified: trunk/reactos/lib/cpl/desk/desk.xml Modified: trunk/reactos/lib/cpl/desk/dibitmap.c Deleted: trunk/reactos/lib/cpl/desk/dibitmap.h Modified: trunk/reactos/lib/cpl/desk/screensaver.c Modified: trunk/reactos/lib/cpl/desk/settings.c Added: trunk/reactos/media/inf/display.inf Modified: trunk/reactos/media/inf/inf.xml Modified: trunk/reactos/media/inf/syssetup.inf _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/bootdata/packages/reactos.dff 2005-10-22 17:18:33 UTC (rev 18683) @@ -293,6 +293,7 @@ media\drivers\etc\services 5 media\inf\acpi.inf 6 media\inf\cdrom.inf 6 +media\inf\display.inf 6 media\inf\hdc.inf 6 media\inf\layout.inf 6 media\inf\machine.inf 6 _____ Modified: trunk/reactos/lib/cpl/desk/appearance.c --- trunk/reactos/lib/cpl/desk/appearance.c 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/appearance.c 2005-10-22 17:18:33 UTC (rev 18683) @@ -8,11 +8,8 @@ * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) */ -#include <windows.h> -#include <commctrl.h> +#include "desk.h" -#include "resource.h" - INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, _____ Modified: trunk/reactos/lib/cpl/desk/background.c --- trunk/reactos/lib/cpl/desk/background.c 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/background.c 2005-10-22 17:18:33 UTC (rev 18683) @@ -8,16 +8,7 @@ * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) */ -#include <windows.h> -#include <commctrl.h> -#include <commdlg.h> -#include <cpl.h> -#include <tchar.h> - -#include "resource.h" - #include "desk.h" -#include "dibitmap.h" #define MAX_BACKGROUNDS 100 _____ Added: trunk/reactos/lib/cpl/desk/classinst.c --- trunk/reactos/lib/cpl/desk/classinst.c 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/classinst.c 2005-10-22 17:18:33 UTC (rev 18683) @@ -0,0 +1,177 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Plug & Play + * FILE: lib/cpl/desk/classinst.c + * PURPOSE: Display class installer + * + * PROGRAMMERS: HervÚ Poussineau (hpoussin(a)reactos.org) + */ + +//#define NDEBUG +#include <debug.h> + +#include "desk.h" + +DWORD WINAPI +DisplayClassInstaller( + IN DI_FUNCTION InstallFunction, + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) +{ + SP_DEVINSTALL_PARAMS InstallParams; + SP_DRVINFO_DATA DriverInfoData; + HINF hInf = INVALID_HANDLE_VALUE; + TCHAR SectionName[MAX_PATH]; + TCHAR ServiceName[MAX_SERVICE_NAME_LEN]; + SP_DRVINFO_DETAIL_DATA DriverInfoDetailData; + HKEY hServicesKey = INVALID_HANDLE_VALUE; + HKEY hServiceKey = INVALID_HANDLE_VALUE; + HKEY hDeviceSubKey = INVALID_HANDLE_VALUE; + DWORD disposition; + BOOL result; + LONG rc; + + if (InstallFunction != DIF_INSTALLDEVICE) + return ERROR_DI_DO_DEFAULT; + + InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); + result = SetupDiGetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &InstallParams); + if (!result) + { + rc = GetLastError(); + DPRINT("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", rc); + goto cleanup; + } + + InstallParams.Flags |= DI_NEEDRESTART; + + result = SetupDiSetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &InstallParams); + if (!result) + { + rc = GetLastError(); + DPRINT("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", rc); + goto cleanup; + } + + DriverInfoData.cbSize = sizeof(SP_DRVINFO_DATA); + result = SetupDiGetSelectedDriver(DeviceInfoSet, DeviceInfoData, &DriverInfoData); + if (!result) + { + rc = GetLastError(); + DPRINT("SetupDiGetSelectedDriver() failed with error 0x%lx\n", rc); + goto cleanup; + } + + DriverInfoDetailData.cbSize = sizeof(SP_DRVINFO_DETAIL_DATA); + result = SetupDiGetDriverInfoDetail( + DeviceInfoSet, DeviceInfoData, + &DriverInfoData, &DriverInfoDetailData, + sizeof(SP_DRVINFO_DETAIL_DATA), NULL); + if (!result && GetLastError() != ERROR_INSUFFICIENT_BUFFER) + { + rc = GetLastError(); + DPRINT("SetupDiGetDriverInfoDetail() failed with error 0x%lx\n", rc); + goto cleanup; + } + + hInf = SetupOpenInfFile(DriverInfoDetailData.InfFileName, NULL, INF_STYLE_WIN4, NULL); + if (hInf == INVALID_HANDLE_VALUE) + { + rc = GetLastError(); + DPRINT("SetupOpenInfFile() failed with error 0x%lx\n", rc); + goto cleanup; + } + + result = SetupDiGetActualSectionToInstall( + hInf, DriverInfoDetailData.SectionName, + SectionName, MAX_PATH - _tcslen(_T(".SoftwareSettings")), NULL, NULL); + if (!result) + { + rc = GetLastError(); + DPRINT("SetupDiGetActualSectionToInstall() failed with error 0x%lx\n", rc); + goto cleanup; + } + _tcscat(SectionName, _T(".SoftwareSettings")); + + result = SetupDiInstallDevice(DeviceInfoSet, DeviceInfoData); + if (!result) + { + rc = GetLastError(); + DPRINT("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx\n", rc); + goto cleanup; + } + + result = SetupDiGetDeviceRegistryProperty( + DeviceInfoSet, DeviceInfoData, + SPDRP_SERVICE, NULL, + (PBYTE)ServiceName, MAX_SERVICE_NAME_LEN * sizeof(TCHAR), NULL); + if (!result) + { + rc = GetLastError(); + DPRINT("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx\n", rc); + goto cleanup; + } + + rc = RegOpenKeyEx( + HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Services"), + 0, KEY_ENUMERATE_SUB_KEYS, &hServicesKey); + if (rc != ERROR_SUCCESS) + { + DPRINT("RegOpenKeyEx() failed with error 0x%lx\n", rc); + goto cleanup; + } + rc = RegOpenKeyEx( + hServicesKey, ServiceName, + 0, KEY_CREATE_SUB_KEY, &hServiceKey); + if (rc != ERROR_SUCCESS) + { + DPRINT("RegOpenKeyEx() failed with error 0x%lx\n", rc); + goto cleanup; + } + + /* Create a Device0 subkey (FIXME: do a loop to find a free number?) */ + rc = RegCreateKeyEx( + hServiceKey, _T("Device0"), 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, + &hDeviceSubKey, &disposition); + if (rc != ERROR_SUCCESS) + { + DPRINT("RegCreateKeyEx() failed with error 0x%lx\n", rc); + goto cleanup; + } + if (disposition != REG_CREATED_NEW_KEY) + { + rc = ERROR_GEN_FAILURE; + DPRINT("RegCreateKeyEx() failed\n"); + goto cleanup; + } + + /* Install SoftwareSettings section */ + result = SetupInstallFromInfSection( + InstallParams.hwndParent, hInf, SectionName, + SPINST_REGISTRY, hDeviceSubKey, + NULL, 0, NULL, NULL, + NULL, NULL); + if (!result) + { + rc = GetLastError(); + DPRINT("SetupInstallFromInfSection() failed with error 0x%lx\n", rc); + goto cleanup; + } + + /* FIXME: install OpenGLSoftwareSettings section */ + + rc = ERROR_SUCCESS; + +cleanup: + if (hInf != INVALID_HANDLE_VALUE) + SetupCloseInfFile(hInf); + if (hServicesKey != INVALID_HANDLE_VALUE) + RegCloseKey(hServicesKey); + if (hServiceKey != INVALID_HANDLE_VALUE) + RegCloseKey(hServiceKey); + if (hDeviceSubKey != INVALID_HANDLE_VALUE) + RegCloseKey(hDeviceSubKey); + + return rc; +} Property changes on: trunk/reactos/lib/cpl/desk/classinst.c ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/lib/cpl/desk/desk.c --- trunk/reactos/lib/cpl/desk/desk.c 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/desk.c 2005-10-22 17:18:33 UTC (rev 18683) @@ -8,11 +8,6 @@ * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) */ -#include <windows.h> -#include <commctrl.h> -#include <cpl.h> - -#include "resource.h" #include "desk.h" #define NUM_APPLETS (1) _____ Modified: trunk/reactos/lib/cpl/desk/desk.def --- trunk/reactos/lib/cpl/desk/desk.def 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/desk.def 2005-10-22 17:18:33 UTC (rev 18683) @@ -2,5 +2,6 @@ EXPORTS CPlApplet@16 +DisplayClassInstaller@12 ; EOF _____ Modified: trunk/reactos/lib/cpl/desk/desk.h --- trunk/reactos/lib/cpl/desk/desk.h 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/desk.h 2005-10-22 17:18:33 UTC (rev 18683) @@ -1,6 +1,16 @@ #ifndef __CPL_DESK_H__ #define __CPL_DESK_H__ +#include <windows.h> +#include <commctrl.h> +#include <commdlg.h> +#include <cpl.h> +#include <tchar.h> +#include <setupapi.h> +#include <stdio.h> + +#include "resource.h" + typedef struct { int idIcon; @@ -13,5 +23,21 @@ extern HINSTANCE hApplet; +typedef struct +{ + BITMAPFILEHEADER *header; + BITMAPINFO *info; + BYTE *bits; + + int width; + int height; + +} DIBitmap; + +extern DIBitmap *DibLoadImage(TCHAR *filename); +extern void DibFreeImage(DIBitmap *bitmap); + +DWORD DbgPrint(PCH Format,...); + #endif /* __CPL_DESK_H__ */ _____ Modified: trunk/reactos/lib/cpl/desk/desk.xml --- trunk/reactos/lib/cpl/desk/desk.xml 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/desk.xml 2005-10-22 17:18:33 UTC (rev 18683) @@ -14,13 +14,15 @@ <library>gdi32</library> <library>comctl32</library> <library>comdlg32</library> + <library>setupapi</library> <library>shell32</library> - <file>desk.c</file> + <library>ntdll</library> + <file>classinst.c</file> + <file>desk.c</file> <file>background.c</file> <file>screensaver.c</file> <file>appearance.c</file> <file>settings.c</file> - <file>dibitmap.c</file> - <file>desk.rc</file> - + <file>dibitmap.c</file> + <file>desk.rc</file> </module> _____ Modified: trunk/reactos/lib/cpl/desk/dibitmap.c --- trunk/reactos/lib/cpl/desk/dibitmap.c 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/dibitmap.c 2005-10-22 17:18:33 UTC (rev 18683) @@ -8,7 +8,7 @@ * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) */ -#include "dibitmap.h" +#include "desk.h" DIBitmap *DibLoadImage(TCHAR *filename) { _____ Deleted: trunk/reactos/lib/cpl/desk/dibitmap.h --- trunk/reactos/lib/cpl/desk/dibitmap.h 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/dibitmap.h 2005-10-22 17:18:33 UTC (rev 18683) @@ -1,22 +0,0 @@ - -#ifndef __DIBITMAP_H__ -#define __DIBITMAP_H__ - -#include <windows.h> - -typedef struct -{ - BITMAPFILEHEADER *header; - BITMAPINFO *info; - BYTE *bits; - - int width; - int height; - -} DIBitmap; - -extern DIBitmap *DibLoadImage(TCHAR *filename); -extern void DibFreeImage(DIBitmap *bitmap); - -#endif /* __DIBITMAP_H__ */ - _____ Modified: trunk/reactos/lib/cpl/desk/screensaver.c --- trunk/reactos/lib/cpl/desk/screensaver.c 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/screensaver.c 2005-10-22 17:18:33 UTC (rev 18683) @@ -8,12 +8,6 @@ * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) */ -#include <windows.h> -#include <commctrl.h> - -#include "resource.h" -#include <cpl.h> -#include <tchar.h> #include "desk.h" #define MAX_SCREENSAVERS 100 _____ Modified: trunk/reactos/lib/cpl/desk/settings.c --- trunk/reactos/lib/cpl/desk/settings.c 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/lib/cpl/desk/settings.c 2005-10-22 17:18:33 UTC (rev 18683) @@ -9,13 +9,6 @@ * HervÚ Poussineau (poussine(a)freesurf.fr) */ -#include <windows.h> -#include <commctrl.h> -#include <stdio.h> -#include <tchar.h> -#include <cpl.h> - -#include "resource.h" #include "desk.h" /* As slider control can't contain user data, we have to keep an _____ Added: trunk/reactos/media/inf/display.inf --- trunk/reactos/media/inf/display.inf 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/media/inf/display.inf 2005-10-22 17:18:33 UTC (rev 18683) @@ -0,0 +1,25 @@ +; Display.INF +; +; Installation file for the Display class +; +[Version] +Signature = "$Windows NT$" +;Signature = "$ReactOS$" +LayoutFile = layout.inf + +Class = Display +ClassGUID = {4d36e968-e325-11ce-bfc1-08002be10318} +Provider = %ReactOS% +DriverVer = 10/18/2005,1.00 + +[ClassInstall32.NT] +AddReg = DisplayClass.NT.AddReg + +[DisplayClass.NT.AddReg] +HKR, , , 0, %DisplayClassName% +HKR, , Icon, 0, "-1" +HKR, , Installer32, 0, "desk.cpl,DisplayClassInstaller" + +[Strings] +ReactOS = "ReactOS Team" +DisplayClassName = "Display Adapters" _____ Modified: trunk/reactos/media/inf/inf.xml --- trunk/reactos/media/inf/inf.xml 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/media/inf/inf.xml 2005-10-22 17:18:33 UTC (rev 18683) @@ -1,6 +1,7 @@ <group> <installfile base="inf">acpi.inf</installfile> <installfile base="inf">cdrom.inf</installfile> +<installfile base="inf">display.inf</installfile> <installfile base="inf">hdc.inf</installfile> <installfile base="inf">layout.inf</installfile> <installfile base="inf">machine.inf</installfile> _____ Modified: trunk/reactos/media/inf/syssetup.inf --- trunk/reactos/media/inf/syssetup.inf 2005-10-22 17:13:49 UTC (rev 18682) +++ trunk/reactos/media/inf/syssetup.inf 2005-10-22 17:18:33 UTC (rev 18683) @@ -15,6 +15,7 @@ ; MS uses netnovel.inf as class-installer INF for NICs ; we use a separate one to keep things clean cdrom.inf +display.inf hdc.inf machine.inf mouse.inf
19 years, 2 months
1
0
0
0
[cwittich] 18682: add drivers to machine.inf:
by cwittich@svn.reactos.com
add drivers to machine.inf: System timer DMA controller System speaker Generic ACPI bus AT real-time clock Motherboard resources EISA programmable interrupt controller ACPI Fixed Feature Button Intel 82443BX Pentium(R) II CPU to PCI-Bridge Intel 82371AB/EB Power Management Controller Intel 82371AB/EB PCI to ISA Bridge Modified: trunk/reactos/media/inf/machine.inf _____ Modified: trunk/reactos/media/inf/machine.inf --- trunk/reactos/media/inf/machine.inf 2005-10-22 16:25:48 UTC (rev 18681) +++ trunk/reactos/media/inf/machine.inf 2005-10-22 17:13:49 UTC (rev 18682) @@ -23,11 +23,64 @@ [Manufacturer] %GenericMfg% = GenericMfg +%IntelMfg% = IntelMfg +[IntelMfg] +%PCI\VEN_8086&DEV_7190.DeviceDesc% = NO_DRV, PCI\VEN_8086&DEV_7190 ;Intel 440LX +%PCI\VEN_8086&DEV_7192.DeviceDesc% = NO_DRV, PCI\VEN_8086&DEV_7192 ;Intel 440BX +%PCI\VEN_8086&DEV_7113.DeviceDesc% = NO_DRV, PCI\VEN_8086&DEV_7113 + +; DO NOT INSTALL ISAPNP -> FREEZES SYSTEM +;%PCI\VEN_8086&DEV_7110.DeviceDesc% = Intel_PCI_ISA_Inst, PCI\VEN_8086&DEV_7110 +%PCI\VEN_8086&DEV_7110.DeviceDesc% = INO_DRV, PCI\VEN_8086&DEV_7110 + [GenericMfg] %*PNP0A03.DeviceDesc% = PCI_Inst,*PNP0A03 +%*PNP0100.DeviceDesc% = NO_DRV_Inst, *PNP0100 +%*PNP0200.DeviceDesc% = NO_DRV_Inst, *PNP0200 +%*PNP0800.DeviceDesc% = NO_DRV_Inst, *PNP0800 +%*PNP0A05.DeviceDesc% = NO_DRV_Inst, *PNP0A05 +%*PNP0B00.DeviceDesc% = NO_DRV_Inst, *PNP0B00 +%*PNP0C02.DeviceDesc% = NO_DRV_Inst, *PNP0C02 +%*PNP0001.DeviceDesc% = NO_DRV_Inst, *PNP0001 +%ACPI\FixedButton.DeviceDesc% = NO_DRV_Inst, ACPI\FixedButton %PCI\CC_0604.DeviceDesc% = PCI_Inst,PCI\CC_0604 +;---------------------------- NO DRIVER REQ ----------------------------- + +[NO_DRV] + +[NO_DRV.Services] +AddService = , 0x00000002 + +[NO_DRV_Inst] +AddReg = NO_DRV_Inst_REG + +[NO_DRV_Inst.Services] +AddService = , 0x00000002 + +[NO_DRV_Inst_REG] +HKR,,ResourcePickerExceptions,0,"IO@0-0xFF:*;IO:HAL,MBRES;IRQ:HAL,*" +HKR,,ResourcePickerTags,0,"MBRES" + +;----------------------------- INTEL DRIVER ----------------------------- + +[Intel_PCI_ISA_Inst] +CopyFiles = Intel_PCI_ISA_CopyFiles.NT + +[Intel_PCI_ISA_CopyFiles.NT] +isapnp.sys + +[Intel_PCI_ISA_Inst.NT.Services] +AddService = isapnp, 0x00000002, isapnp_Service_Inst + +[isapnp_Service_Inst] +ServiceType = 1 +StartType = 0 +ErrorControl = 3 +ServiceBinary = %12%\isapnp.sys +LoadOrderGroup = Boot Bus Extender + ;---------------------------- PCI BUS DRIVER ---------------------------- [PCI_Inst.NT] @@ -53,5 +106,21 @@ SystemClassName = "System devices" GenericMfg = "(Generic system devices)" +IntelMfg = "Intel" + *PNP0A03.DeviceDesc = "PCI bus" -PCI\CC_0604.DeviceDesc = "Standard PCI to PCI bridge" \ No newline at end of file +*PNP0100.DeviceDesc = "System timer" +*PNP0200.DeviceDesc = "DMA controller" +*PNP0800.DeviceDesc = "System speaker" +*PNP0A05.DeviceDesc = "Generic ACPI bus" +*PNP0b00.DeviceDesc = "AT real-time clock" +*PNP0C02.DeviceDesc = "Motherboard resources" +*PNP0001.DeviceDesc = "EISA programmable interrupt controller" + +ACPI\FixedButton.DeviceDesc=" ACPI Fixed Feature Button" +PCI\CC_0604.DeviceDesc = "Standard PCI to PCI bridge" + +PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX Pentium(R) II CPU to PCI-Bridge" +PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX Pentium(R) II CPU to PCI-Bridge" +PCI\VEN_8086&DEV_7113.DeviceDesc = "Intel 82371AB/EB Power Management Controller" +PCI\VEN_8086&DEV_7110.DeviceDesc = "Intel 82371AB/EB PCI to ISA Bridge" \ No newline at end of file
19 years, 2 months
1
0
0
0
[hpoussin] 18681: Implement SetupDiGetDriverInfoDetailW
by hpoussin@svn.reactos.com
Implement SetupDiGetDriverInfoDetailW Add stub for SetupDiGetDriverInfoDetailA Modified: trunk/reactos/lib/setupapi/devinst.c Modified: trunk/reactos/lib/setupapi/setupapi.spec _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-10-22 15:19:01 UTC (rev 18680) +++ trunk/reactos/lib/setupapi/devinst.c 2005-10-22 16:25:48 UTC (rev 18681) @@ -122,9 +122,8 @@ DWORD DriverRank; SP_DRVINFO_DATA_V2_W Info; + SP_DRVINFO_DETAIL_DATA_W Details; GUID ClassGuid; - LPWSTR InfPath; - LPWSTR InfSection; LPWSTR MatchingId; }; @@ -2331,9 +2330,9 @@ case ERROR_SUCCESS: ret = TRUE; break; - case ERROR_MORE_DATA: + case ERROR_MORE_DATA: SetLastError(ERROR_INSUFFICIENT_BUFFER); - break; + break; default: SetLastError(rc); } @@ -3680,10 +3679,10 @@ IN DWORD Rank) { struct DriverInfoElement *driverInfo = NULL; + HANDLE hFile = INVALID_HANDLE_VALUE; DWORD RequiredSize = 128; /* Initial buffer size */ BOOL Result = FALSE; PLIST_ENTRY PreviousEntry; - LPWSTR DeviceDescription = NULL; LPWSTR InfInstallSection = NULL; BOOL ret = FALSE; @@ -3695,35 +3694,38 @@ } memset(driverInfo, 0, sizeof(struct DriverInfoElement)); - /* Fill InfSection field */ - SetLastError(ERROR_INSUFFICIENT_BUFFER); - while (!Result && GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - HeapFree(GetProcessHeap(), 0, driverInfo->InfSection); - driverInfo->InfSection = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); - if (!driverInfo->InfSection) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto cleanup; - } - Result = SetupGetStringFieldW( - &ContextDevice, - 1, - driverInfo->InfSection, RequiredSize, - &RequiredSize); - } + driverInfo->Details.cbSize = sizeof(SP_DRVINFO_DETAIL_DATA); + driverInfo->Details.Reserved = (ULONG_PTR)driverInfo; + + /* Copy InfFileName field */ + wcsncpy(driverInfo->Details.InfFileName, InfFile, MAX_PATH); + + /* Fill InfDate field */ + /* FIXME: hFile = CreateFile(driverInfo->Details.InfFileName, + GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, 0, NULL); + if (hFile == INVALID_HANDLE_VALUE) + goto cleanup; + Result = GetFileTime(hFile, NULL, NULL, &driverInfo->Details.InfDate); if (!Result) - goto cleanup; + goto cleanup;*/ - /* Copy InfFile information */ - driverInfo->InfPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(InfFile) + 1) * sizeof(WCHAR)); - if (!driverInfo->InfPath) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); + /* Fill SectionName field */ + Result = SetupGetStringFieldW( + &ContextDevice, + 1, + driverInfo->Details.SectionName, LINE_LEN, + NULL); + if (!Result) goto cleanup; - } - RtlCopyMemory(driverInfo->InfPath, InfFile, (wcslen(InfFile) + 1) * sizeof(WCHAR)); + /* Fill DrvDescription field */ + Result = SetupGetStringFieldW( + &ContextDevice, + 0, /* Field index */ + driverInfo->Details.DrvDescription, LINE_LEN, + NULL); + /* Copy MatchingId information */ driverInfo->MatchingId = HeapAlloc(GetProcessHeap(), 0, (wcslen(MatchingId) + 1) * sizeof(WCHAR)); if (!driverInfo->MatchingId) @@ -3733,25 +3735,6 @@ } RtlCopyMemory(driverInfo->MatchingId, MatchingId, (wcslen(MatchingId) + 1) * sizeof(WCHAR)); - /* Get device description */ - Result = FALSE; - RequiredSize = 128; /* Initial buffer size */ - SetLastError(ERROR_INSUFFICIENT_BUFFER); - while (!Result && GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - HeapFree(GetProcessHeap(), 0, DeviceDescription); - DeviceDescription = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); - if (!DeviceDescription) - goto cleanup; - Result = SetupGetStringFieldW( - &ContextDevice, - 0, /* Field index */ - DeviceDescription, RequiredSize, - &RequiredSize); - } - if (!Result) - goto cleanup; - /* Get inf install section */ Result = FALSE; RequiredSize = 128; /* Initial buffer size */ @@ -3772,13 +3755,13 @@ goto cleanup; TRACE("Adding driver '%S' [%S/%S] (Rank 0x%lx)\n", - DeviceDescription, InfFile, InfInstallSection, Rank); + driverInfo->Details.DrvDescription, InfFile, InfInstallSection, Rank); driverInfo->DriverRank = Rank; memcpy(&driverInfo->ClassGuid, ClassGuid, sizeof(GUID)); driverInfo->Info.DriverType = DriverType; driverInfo->Info.Reserved = (ULONG_PTR)driverInfo; - wcsncpy(driverInfo->Info.Description, DeviceDescription, LINE_LEN - 1); + wcsncpy(driverInfo->Info.Description, driverInfo->Details.DrvDescription, LINE_LEN - 1); driverInfo->Info.Description[LINE_LEN - 1] = '\0'; wcsncpy(driverInfo->Info.MfgName, ManufacturerName, LINE_LEN - 1); driverInfo->Info.MfgName[LINE_LEN - 1] = '\0'; @@ -3815,14 +3798,11 @@ if (!ret) { if (driverInfo) - { - HeapFree(GetProcessHeap(), 0, driverInfo->InfPath); - HeapFree(GetProcessHeap(), 0, driverInfo->InfSection); HeapFree(GetProcessHeap(), 0, driverInfo->MatchingId); - } HeapFree(GetProcessHeap(), 0, driverInfo); } - HeapFree(GetProcessHeap(), 0, DeviceDescription); + if (hFile != INVALID_HANDLE_VALUE) + CloseHandle(hFile); HeapFree(GetProcessHeap(), 0, InfInstallSection); return ret; @@ -4377,8 +4357,6 @@ { ListEntry = RemoveHeadList(&list->DriverListHead); driverInfo = (struct DriverInfoElement *)ListEntry; - HeapFree(GetProcessHeap(), 0, driverInfo->InfSection); - HeapFree(GetProcessHeap(), 0, driverInfo->InfPath); HeapFree(GetProcessHeap(), 0, driverInfo->MatchingId); HeapFree(GetProcessHeap(), 0, driverInfo); } @@ -4405,8 +4383,6 @@ InstallParamsSet.Reserved = 0; SetupDiSetDeviceInstallParamsW(DeviceInfoSet, NULL, &InstallParamsSet); } - HeapFree(GetProcessHeap(), 0, driverInfo->InfSection); - HeapFree(GetProcessHeap(), 0, driverInfo->InfPath); HeapFree(GetProcessHeap(), 0, driverInfo->MatchingId); HeapFree(GetProcessHeap(), 0, driverInfo); } @@ -4825,6 +4801,76 @@ } /*********************************************************************** + * SetupDiGetDriverInfoDetailA (SETUPAPI.@) + */ +BOOL WINAPI +SetupDiGetDriverInfoDetailA( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DRVINFO_DATA_A DriverInfoData, + OUT PSP_DRVINFO_DETAIL_DATA_A DriverInfoDetailData OPTIONAL, + IN DWORD DriverInfoDetailDataSize, + OUT PDWORD RequiredSize OPTIONAL) +{ + FIXME("%p %p %p %p 0x%lx %p\n", DeviceInfoSet, DeviceInfoData, + DriverInfoData, DriverInfoDetailData, DriverInfoDetailDataSize, + RequiredSize); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +/********************************************************************** * + * SetupDiGetDriverInfoDetailW (SETUPAPI.@) + */ +BOOL WINAPI +SetupDiGetDriverInfoDetailW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DRVINFO_DATA_W DriverInfoData, + OUT PSP_DRVINFO_DETAIL_DATA_W DriverInfoDetailData OPTIONAL, + IN DWORD DriverInfoDetailDataSize, + OUT PDWORD RequiredSize OPTIONAL) +{ + BOOL ret = FALSE; + + if (!DeviceInfoSet) + SetLastError(ERROR_INVALID_PARAMETER); + else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + SetLastError(ERROR_INVALID_HANDLE); + else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC) + SetLastError(ERROR_INVALID_HANDLE); + else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA)) + SetLastError(ERROR_INVALID_USER_BUFFER); + else if (!DriverInfoData) + SetLastError(ERROR_INVALID_PARAMETER); + else if (!DriverInfoDetailData && DriverInfoDetailDataSize != 0) + SetLastError(ERROR_INVALID_PARAMETER); + else if (DriverInfoDetailData && DriverInfoDetailDataSize < sizeof(SP_DRVINFO_DETAIL_DATA_W)) + SetLastError(ERROR_INVALID_PARAMETER); + else if (DriverInfoDetailData && DriverInfoDetailData->cbSize != sizeof(SP_DRVINFO_DETAIL_DATA_W)) + SetLastError(ERROR_INVALID_USER_BUFFER); + else if (DriverInfoDetailData && DriverInfoDetailData->Reserved == 0) + SetLastError(ERROR_INVALID_PARAMETER); + else + { + struct DriverInfoElement *driverInfoElement; + driverInfoElement = (struct DriverInfoElement *)DriverInfoData->Reserved; + + memcpy( + DriverInfoDetailData, + &driverInfoElement->Details, + driverInfoElement->Details.cbSize); + /* FIXME: copy HardwareIDs/CompatibleIDs if buffer is big enough + * Don't forget to set CompatIDsOffset and CompatIDsLength fields. + */ + ret = TRUE; + } + + TRACE("Returning %d\n", ret); + return ret; +} + +/********************************************************************** * * SetupDiSelectBestCompatDrv (SETUPAPI.@) */ BOOL WINAPI @@ -4904,11 +4950,11 @@ goto cleanup; } - hInf = SetupOpenInfFileW(SelectedDriver->InfPath, NULL, INF_STYLE_WIN4, NULL); + hInf = SetupOpenInfFileW(SelectedDriver->Details.InfFileName, NULL, INF_STYLE_WIN4, NULL); if (hInf == INVALID_HANDLE_VALUE) goto cleanup; - ret = SetupDiGetActualSectionToInstallW(hInf, SelectedDriver->InfSection, + ret = SetupDiGetActualSectionToInstallW(hInf, SelectedDriver->Details.SectionName, SectionName, MAX_PATH, &SectionNameLength, NULL); if (!ret) goto cleanup; @@ -5046,11 +5092,11 @@ FileTimeToSystemTime(&SelectedDriver->Info.DriverDate, &DriverDate); - hInf = SetupOpenInfFileW(SelectedDriver->InfPath, NULL, INF_STYLE_WIN4, NULL); + hInf = SetupOpenInfFileW(SelectedDriver->Details.InfFileName, NULL, INF_STYLE_WIN4, NULL); if (hInf == INVALID_HANDLE_VALUE) goto cleanup; - Result = SetupDiGetActualSectionToInstallW(hInf, SelectedDriver->InfSection, + Result = SetupDiGetActualSectionToInstallW(hInf, SelectedDriver->Details.SectionName, SectionName, MAX_PATH, &SectionNameLength, NULL); if (!Result || SectionNameLength > MAX_PATH - 9) goto cleanup; @@ -5059,7 +5105,7 @@ /* Get information from [Version] section */ ClassName = NULL; RequiredSize = 0; - if (!SetupDiGetINFClassW(SelectedDriver->InfPath, &ClassGuid, ClassName, RequiredSize, &RequiredSize)) + if (!SetupDiGetINFClassW(SelectedDriver->Details.InfFileName, &ClassGuid, ClassName, RequiredSize, &RequiredSize)) { if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) goto cleanup; @@ -5069,7 +5115,7 @@ SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto cleanup; } - if (!SetupDiGetINFClassW(SelectedDriver->InfPath, &ClassGuid, ClassName, RequiredSize, &RequiredSize)) + if (!SetupDiGetINFClassW(SelectedDriver->Details.InfFileName, &ClassGuid, ClassName, RequiredSize, &RequiredSize)) goto cleanup; } /* Format ClassGuid to a string */ @@ -5123,9 +5169,9 @@ TRACE("DriverDate : '%u-%u-%u'\n", DriverDate.wMonth, DriverDate.wDay, DriverDate.wYear); TRACE("DriverDesc : '%S'\n", SelectedDriver->Info.Description); TRACE("DriverVersion : '%u.%u.%u.%u'\n", SelectedDriver->Info.DriverVersion & 0xff, (SelectedDriver->Info.DriverVersion >> 8) & 0xff, (SelectedDriver->Info.DriverVersion >> 16) & 0xff, (SelectedDriver->Info.DriverVersion >> 24) & 0xff); - TRACE("InfPath : '%S'\n", SelectedDriver->InfPath); - TRACE("InfSection : '%S'\n", SelectedDriver->InfSection); - TRACE("InfSectionExt : '%S'\n", &SectionName[wcslen(SelectedDriver->InfSection)]); /* FIXME */ + TRACE("InfPath : '%S'\n", SelectedDriver->Details.InfFileName); + TRACE("InfSection : '%S'\n", SelectedDriver->Details.SectionName); + TRACE("InfSectionExt : '%S'\n", &SectionName[wcslen(SelectedDriver->Details.SectionName)]); TRACE("MatchingDeviceId: '%S'\n", SelectedDriver->MatchingId); TRACE("ProviderName : '%S'\n", SelectedDriver->Info.ProviderName); swprintf(Buffer, L"%u-%u-%u", DriverDate.wMonth, DriverDate.wDay, DriverDate.wYear); @@ -5140,11 +5186,11 @@ rc = RegSetValueEx(hKey, L"DriverVersion", 0, REG_SZ, (const BYTE *)Buffer, (wcslen(Buffer) + 1) * sizeof(WCHAR)); } if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, L"InfPath", 0, REG_SZ, (const BYTE *)SelectedDriver->InfPath, (wcslen(SelectedDriver->InfPath) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, L"InfPath", 0, REG_SZ, (const BYTE *)SelectedDriver->Details.InfFileName, (wcslen(SelectedDriver->Details.InfFileName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, L"InfSection", 0, REG_SZ, (const BYTE *)SelectedDriver->InfSection, (wcslen(SelectedDriver->InfSection) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, L"InfSection", 0, REG_SZ, (const BYTE *)SelectedDriver->Details.SectionName, (wcslen(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueEx(hKey, L"InfSectionExt", 0, REG_SZ, (const BYTE *)&SectionName[wcslen(SelectedDriver->InfSection)], (wcslen(SectionName) - wcslen(SelectedDriver->InfSection) + 1) * sizeof(WCHAR)); + rc = RegSetValueEx(hKey, L"InfSectionExt", 0, REG_SZ, (const BYTE *)&SectionName[wcslen(SelectedDriver->Details.SectionName)], (wcslen(SectionName) - wcslen(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) rc = RegSetValueEx(hKey, L"MatchingDeviceId", 0, REG_SZ, (const BYTE *)SelectedDriver->MatchingId, (wcslen(SelectedDriver->MatchingId) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) _____ Modified: trunk/reactos/lib/setupapi/setupapi.spec --- trunk/reactos/lib/setupapi/setupapi.spec 2005-10-22 15:19:01 UTC (rev 18680) +++ trunk/reactos/lib/setupapi/setupapi.spec 2005-10-22 16:25:48 UTC (rev 18681) @@ -327,8 +327,8 @@ @ stub SetupDiGetDeviceInstanceIdW @ stdcall SetupDiGetDeviceRegistryPropertyA(long ptr long ptr ptr long ptr) @ stdcall SetupDiGetDeviceRegistryPropertyW(long ptr long ptr ptr long ptr) -@ stub SetupDiGetDriverInfoDetailA -@ stub SetupDiGetDriverInfoDetailW +@ stdcall SetupDiGetDriverInfoDetailA(ptr ptr ptr ptr long ptr) +@ stdcall SetupDiGetDriverInfoDetailW(ptr ptr ptr ptr long ptr) @ stub SetupDiGetDriverInstallParamsA @ stub SetupDiGetDriverInstallParamsW @ stub SetupDiGetDeviceInterfaceAlias
19 years, 2 months
1
0
0
0
[gvg] 18680: Merge from trunk:
by gvg@svn.reactos.com
Merge from trunk: Use MaxPos instead of MaxTrackingPos when "restoring" a window which was previously maximized. Fixes bug 925. Modified: branches/ros-branch-0_2_8/reactos/subsys/win32k/ntuser/winpos.c _____ Modified: branches/ros-branch-0_2_8/reactos/subsys/win32k/ntuser/winpos.c --- branches/ros-branch-0_2_8/reactos/subsys/win32k/ntuser/winpos.c 2005-10-22 15:11:55 UTC (rev 18679) +++ branches/ros-branch-0_2_8/reactos/subsys/win32k/ntuser/winpos.c 2005-10-22 15:19:01 UTC (rev 18680) @@ -374,8 +374,8 @@ Window->Style &= ~WS_MINIMIZE; if (Window->Flags & WINDOWOBJECT_RESTOREMAX) { - co_WinPosGetMinMaxInfo(Window, NULL, - &InternalPos->MaxPos, NULL, &Size); + co_WinPosGetMinMaxInfo(Window, &Size, + &InternalPos->MaxPos, NULL, NULL); Window->Style |= WS_MAXIMIZE; IntGdiSetRect(NewPos, InternalPos->MaxPos.x, InternalPos->MaxPos.y, Size.x, Size.y); @@ -1359,7 +1359,6 @@ case SW_SHOWMAXIMIZED: { -//__asm__("int $3\n"); Swp |= SWP_SHOWWINDOW; if (!(Window->Style & WS_MAXIMIZE)) {
19 years, 2 months
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
...
74
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Results per page:
10
25
50
100
200