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
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
December 2005
----- 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
40 participants
704 discussions
Start a n
N
ew thread
[gedmurphy] 20276: - shut some of the msvc warnings up
by gedmurphy@svn.reactos.com
- shut some of the msvc warnings up - change malloc's to HeapAlloc's - fix memory leaks Modified: trunk/reactos/apps/utils/net/netstat/netstat.c _____ Modified: trunk/reactos/apps/utils/net/netstat/netstat.c --- trunk/reactos/apps/utils/net/netstat/netstat.c 2005-12-20 13:24:47 UTC (rev 20275) +++ trunk/reactos/apps/utils/net/netstat/netstat.c 2005-12-20 19:54:25 UTC (rev 20276) @@ -108,7 +108,7 @@ TCHAR Proto[5]; - if ((argc == 1) || (isdigit(*argv[1]))) + if ((argc == 1) || (_istdigit(*argv[1]))) bNoOptions = TRUE; /* Parse command line for options we have been given. */ @@ -123,23 +123,18 @@ switch (tolower(c)) { case 'a' : - //_tprintf(_T("got a\n")); bDoShowAllCons = TRUE; break; case 'e' : - //_tprintf(_T("got e\n")); bDoShowEthStats = TRUE; break; case 'n' : - //_tprintf(_T("got n\n")); bDoShowNumbers = TRUE; break; case 's' : - //_tprintf(_T("got s\n")); bDoShowProtoStats = TRUE; break; case 'p' : - //_tprintf(_T("got p\n")); bDoShowProtoCons = TRUE; strncpy(Proto, (++argv)[i], sizeof(Proto)); @@ -171,10 +166,12 @@ } } } - else if (isdigit(*argv[i])) + else if (_istdigit(*argv[i])) { - _stscanf(argv[i], "%lu", &Interval); - bLoopOutput = TRUE; + if (_stscanf(argv[i], "%lu", &Interval) != EOF) + bLoopOutput = TRUE; + else + return EXIT_FAILURE; } // else // { @@ -278,7 +275,7 @@ PMIB_IPSTATS pIpStats; DWORD dwRetVal; - pIpStats = (MIB_IPSTATS*) malloc(sizeof(MIB_IPSTATS)); + pIpStats = (MIB_IPSTATS*) HeapAlloc(GetProcessHeap(), 0, sizeof(MIB_IPSTATS)); if ((dwRetVal = GetIpStatistics(pIpStats)) == NO_ERROR) { @@ -303,6 +300,8 @@ } else DoFormatMessage(dwRetVal); + + HeapFree(GetProcessHeap(), 0, pIpStats); } VOID ShowIcmpStatistics() @@ -310,7 +309,7 @@ PMIB_ICMP pIcmpStats; DWORD dwRetVal; - pIcmpStats = (MIB_ICMP*) malloc(sizeof(MIB_ICMP)); + pIcmpStats = (MIB_ICMP*) HeapAlloc(GetProcessHeap(), 0, sizeof(MIB_ICMP)); if ((dwRetVal = GetIcmpStatistics(pIcmpStats)) == NO_ERROR) { @@ -346,6 +345,8 @@ else DoFormatMessage(dwRetVal); + HeapFree(GetProcessHeap(), 0, pIcmpStats); + } VOID ShowTcpStatistics() @@ -353,7 +354,7 @@ PMIB_TCPSTATS pTcpStats; DWORD dwRetVal; - pTcpStats = (MIB_TCPSTATS*) malloc(sizeof(MIB_TCPSTATS)); + pTcpStats = (MIB_TCPSTATS*) HeapAlloc(GetProcessHeap(), 0, sizeof(MIB_TCPSTATS)); if ((dwRetVal = GetTcpStatistics(pTcpStats)) == NO_ERROR) { @@ -369,6 +370,8 @@ } else DoFormatMessage(dwRetVal); + + HeapFree(GetProcessHeap(), 0, pTcpStats); } VOID ShowUdpStatistics() @@ -376,7 +379,7 @@ PMIB_UDPSTATS pUdpStats; DWORD dwRetVal; - pUdpStats = (MIB_UDPSTATS*) malloc(sizeof(MIB_UDPSTATS)); + pUdpStats = (MIB_UDPSTATS*) HeapAlloc(GetProcessHeap(), 0, sizeof(MIB_UDPSTATS)); if ((dwRetVal = GetUdpStatistics(pUdpStats)) == NO_ERROR) { @@ -388,6 +391,8 @@ } else DoFormatMessage(dwRetVal); + + HeapFree(GetProcessHeap(), 0, pUdpStats); } VOID ShowEthernetStatistics() @@ -396,12 +401,12 @@ DWORD dwSize = 0; DWORD dwRetVal = 0; - pIfTable = (MIB_IFTABLE*) malloc(sizeof(MIB_IFTABLE)); + pIfTable = (MIB_IFTABLE*) HeapAlloc(GetProcessHeap(), 0, sizeof(MIB_IFTABLE)); if (GetIfTable(pIfTable, &dwSize, 0) == ERROR_INSUFFICIENT_BUFFER) { - GlobalFree(pIfTable); - pIfTable = (MIB_IFTABLE*) malloc(dwSize); + HeapFree(GetProcessHeap(), 0, pIfTable); + pIfTable = (MIB_IFTABLE*) HeapAlloc(GetProcessHeap(), 0, dwSize); if ((dwRetVal = GetIfTable(pIfTable, &dwSize, 0)) == NO_ERROR) { @@ -423,6 +428,7 @@ else DoFormatMessage(dwRetVal); } + HeapFree(GetProcessHeap(), 0, pIfTable); } VOID ShowTcpTable() @@ -444,12 +450,13 @@ DoFormatMessage(error); exit(EXIT_FAILURE); } - tcpTable = (PMIB_TCPTABLE)malloc(dwSize); + tcpTable = (PMIB_TCPTABLE) HeapAlloc(GetProcessHeap(), 0, dwSize); error = GetTcpTable(tcpTable, &dwSize, TRUE ); if (error) { printf("Failed to snapshot TCP endpoints table.\n"); DoFormatMessage(error); + HeapFree(GetProcessHeap(), 0, tcpTable); exit(EXIT_FAILURE); } @@ -475,6 +482,7 @@ Host, Remote, TcpState[tcpTable->table[i].dwState]); } } + HeapFree(GetProcessHeap(), 0, tcpTable); } @@ -495,12 +503,13 @@ DoFormatMessage(error); exit(EXIT_FAILURE); } - udpTable = (PMIB_UDPTABLE)malloc(dwSize); + udpTable = (PMIB_UDPTABLE) HeapAlloc(GetProcessHeap(), 0, dwSize); error = GetUdpTable(udpTable, &dwSize, TRUE); if (error) { printf("Failed to snapshot UDP endpoints table.\n"); DoFormatMessage(error); + HeapFree(GetProcessHeap(), 0, udpTable); exit(EXIT_FAILURE); } @@ -516,6 +525,8 @@ _tprintf(_T(" %-6s %-22s %-22s\n"), _T("UDP"), Host, _T(":*:")); } + + HeapFree(GetProcessHeap(), 0, udpTable); }
18 years, 9 months
1
0
0
0
[sgasiorek] 20275: when message is not unicode then SendMessageA should be used. Fixes #1152 and combobox in "Run..." dialog
by sgasiorek@svn.reactos.com
when message is not unicode then SendMessageA should be used. Fixes #1152 and combobox in "Run..." dialog Modified: trunk/reactos/lib/user32/controls/combo.c _____ Modified: trunk/reactos/lib/user32/controls/combo.c --- trunk/reactos/lib/user32/controls/combo.c 2005-12-20 09:45:53 UTC (rev 20274) +++ trunk/reactos/lib/user32/controls/combo.c 2005-12-20 13:24:47 UTC (rev 20275) @@ -2075,7 +2075,10 @@ msg = LB_ADDSTRING_LOWER; else if( lphc->dwStyle & CBS_UPPERCASE ) msg = LB_ADDSTRING_UPPER; - return SendMessageW(lphc->hWndLBox, msg, 0, lParam); + if( unicode ) + return SendMessageW(lphc->hWndLBox, msg, 0, lParam); + else + return SendMessageA(lphc->hWndLBox, msg, 0, lParam); } #ifndef __REACTOS__ case CB_INSERTSTRING16: @@ -2090,7 +2093,10 @@ msg = LB_INSERTSTRING_LOWER; else if( lphc->dwStyle & CBS_UPPERCASE ) msg = LB_INSERTSTRING_UPPER; - return SendMessageW(lphc->hWndLBox, msg, 0, lParam); + if( unicode ) + return SendMessageW(lphc->hWndLBox, msg, 0, lParam); + else + return SendMessageA(lphc->hWndLBox, msg, 0, lParam); } #ifndef __REACTOS__ case CB_DELETESTRING16:
18 years, 9 months
1
0
0
0
[hpoussin] 20274: Honor DI_ENUMSINGLEINF flag in SetupDiBuildDriverInfoList
by hpoussin@svn.reactos.com
Honor DI_ENUMSINGLEINF flag in SetupDiBuildDriverInfoList Implement SetupDiGetSelectedDevice/SetupDiSetSelectedDevice Modified: trunk/reactos/lib/setupapi/devinst.c Modified: trunk/reactos/lib/setupapi/setupapi.spec Modified: trunk/reactos/lib/setupapi/setupapi_private.h _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-12-19 17:58:17 UTC (rev 20273) +++ trunk/reactos/lib/setupapi/devinst.c 2005-12-20 09:45:53 UTC (rev 20274) @@ -5655,41 +5655,65 @@ goto done; } - /* Enumerate .inf files */ - Result = FALSE; - RequiredSize = 32768; /* Initial buffer size */ - SetLastError(ERROR_INSUFFICIENT_BUFFER); - while (!Result && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + if (InstallParams.Flags & DI_ENUMSINGLEINF) { - HeapFree(GetProcessHeap(), 0, Buffer); + /* InstallParams.DriverPath contains the name of a .inf file */ + RequiredSize = wcslen(InstallParams.DriverPath) + 2; Buffer = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); if (!Buffer) { - Result = FALSE; SetLastError(ERROR_NOT_ENOUGH_MEMORY); - break; + goto done; } - Result = SetupGetInfFileListW( - *InstallParams.DriverPath ? InstallParams.DriverPath : NULL, - INF_STYLE_WIN4, - Buffer, RequiredSize, - &RequiredSize); + wcscpy(Buffer, InstallParams.DriverPath); + ((LPWSTR)Buffer)[RequiredSize - 1] = 0; + Result = TRUE; } - if (!Result && GetLastError() == ERROR_FILE_NOT_FOUND) + else { - /* No .inf file in specified directory. So, we should - * success as we created an empty driver info list. - */ - ret = TRUE; - goto done; + /* Enumerate .inf files */ + Result = FALSE; + RequiredSize = 32768; /* Initial buffer size */ + SetLastError(ERROR_INSUFFICIENT_BUFFER); + while (!Result && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + HeapFree(GetProcessHeap(), 0, Buffer); + Buffer = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); + if (!Buffer) + { + Result = FALSE; + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + break; + } + Result = SetupGetInfFileListW( + *InstallParams.DriverPath ? InstallParams.DriverPath : NULL, + INF_STYLE_WIN4, + Buffer, RequiredSize, + &RequiredSize); + } + if (!Result && GetLastError() == ERROR_FILE_NOT_FOUND) + { + /* No .inf file in specified directory. So, we should + * success as we created an empty driver info list. + */ + ret = TRUE; + goto done; + } } if (Result) { LPCWSTR filename; LPWSTR pFullFilename; - if (*InstallParams.DriverPath) + if (InstallParams.Flags & DI_ENUMSINGLEINF) { + FullInfFileName = HeapAlloc(GetProcessHeap(), 0, MAX_PATH); + if (!FullInfFileName) + goto done; + pFullFilename = &FullInfFileName[0]; + } + else if (*InstallParams.DriverPath) + { DWORD len; len = GetFullPathNameW(InstallParams.DriverPath, 0, NULL, NULL); if (len == 0) @@ -6324,6 +6348,44 @@ /*********************************************************************** + * SetupDiGetSelectedDevice (SETUPAPI.@) + */ +BOOL WINAPI +SetupDiGetSelectedDevice( + IN HDEVINFO DeviceInfoSet, + OUT PSP_DEVINFO_DATA DeviceInfoData) +{ + struct DeviceInfoSet *list; + BOOL ret = FALSE; + + TRACE("%p %p\n", DeviceInfoSet, DeviceInfoData); + + if (!DeviceInfoSet) + SetLastError(ERROR_INVALID_HANDLE); + else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC) + SetLastError(ERROR_INVALID_HANDLE); + else if (list->SelectedDevice == NULL) + SetLastError(ERROR_NO_DEVICE_SELECTED); + else if (!DeviceInfoData) + SetLastError(ERROR_INVALID_PARAMETER); + else if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA)) + SetLastError(ERROR_INVALID_USER_BUFFER); + else + { + memcpy(&DeviceInfoData->ClassGuid, + &list->SelectedDevice->ClassGuid, + sizeof(GUID)); + DeviceInfoData->DevInst = list->SelectedDevice->dnDevInst; + DeviceInfoData->Reserved = (ULONG_PTR)list->SelectedDevice; + ret = TRUE; + } + + TRACE("Returning %d\n", ret); + return ret; +} + + +/********************************************************************** * * SetupDiGetSelectedDriverA (SETUPAPI.@) */ BOOL WINAPI @@ -6434,6 +6496,40 @@ /*********************************************************************** + * SetupDiSetSelectedDevice (SETUPAPI.@) + */ +BOOL WINAPI +SetupDiSetSelectedDevice( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData) +{ + struct DeviceInfoSet *list; + BOOL ret = FALSE; + + TRACE("%p %p\n", DeviceInfoSet, DeviceInfoData); + + if (!DeviceInfoSet) + SetLastError(ERROR_INVALID_HANDLE); + else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC) + SetLastError(ERROR_INVALID_HANDLE); + else if (!DeviceInfoData) + SetLastError(ERROR_INVALID_PARAMETER); + else if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA)) + SetLastError(ERROR_INVALID_USER_BUFFER); + else if (DeviceInfoData->Reserved == 0) + SetLastError(ERROR_INVALID_USER_BUFFER); + else + { + list->SelectedDevice = (struct DeviceInfoElement *)DeviceInfoData->Reserved; + ret = TRUE; + } + + TRACE("Returning %d\n", ret); + return ret; +} + + +/********************************************************************** * * SetupDiSetSelectedDriverA (SETUPAPI.@) */ BOOL WINAPI _____ Modified: trunk/reactos/lib/setupapi/setupapi.spec --- trunk/reactos/lib/setupapi/setupapi.spec 2005-12-19 17:58:17 UTC (rev 20273) +++ trunk/reactos/lib/setupapi/setupapi.spec 2005-12-20 09:45:53 UTC (rev 20274) @@ -345,7 +345,7 @@ @ stub SetupDiGetHwProfileListExW @ stdcall SetupDiGetINFClassA(str ptr ptr long ptr) @ stdcall SetupDiGetINFClassW(wstr ptr ptr long ptr) -@ stub SetupDiGetSelectedDevice +@ stdcall SetupDiGetSelectedDevice(ptr ptr) @ stdcall SetupDiGetSelectedDriverA(ptr ptr ptr) @ stdcall SetupDiGetSelectedDriverW(ptr ptr ptr) @ stub SetupDiGetWizardPage @@ -382,7 +382,7 @@ @ stdcall SetupDiSetDeviceRegistryPropertyW(ptr ptr long ptr long) @ stub SetupDiSetDriverInstallParamsA @ stub SetupDiSetDriverInstallParamsW -@ stub SetupDiSetSelectedDevice +@ stdcall SetupDiSetSelectedDevice(ptr ptr) @ stdcall SetupDiSetSelectedDriverA(ptr ptr ptr) @ stdcall SetupDiSetSelectedDriverW(ptr ptr ptr) @ stub SetupDiUnremoveDevice _____ Modified: trunk/reactos/lib/setupapi/setupapi_private.h --- trunk/reactos/lib/setupapi/setupapi_private.h 2005-12-19 17:58:17 UTC (rev 20273) +++ trunk/reactos/lib/setupapi/setupapi_private.h 2005-12-20 09:45:53 UTC (rev 20274) @@ -156,6 +156,7 @@ LIST_ENTRY DriverListHead; /* List of struct DriverInfoElement */ LIST_ENTRY ListHead; /* List of struct DeviceInfoElement */ + struct DeviceInfoElement *SelectedDevice; /* Used by SetupDiGetClassInstallParamsW/SetupDiSetClassInstallParamsW */ struct ClassInstallParams ClassInstallParams;
18 years, 9 months
1
0
0
0
[gvg] 20273: /me loves Raymond
by gvg@svn.reactos.com
/me loves Raymond Modified: trunk/reactos/lib/kernel32/process/create.c _____ Modified: trunk/reactos/lib/kernel32/process/create.c --- trunk/reactos/lib/kernel32/process/create.c 2005-12-19 15:51:57 UTC (rev 20272) +++ trunk/reactos/lib/kernel32/process/create.c 2005-12-19 17:58:17 UTC (rev 20273) @@ -668,6 +668,11 @@ SIZE_T EnvSize = 0; BOOL Ret = FALSE; + /* FIXME should process + * HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options + * key (see
http://blogs.msdn.com/oldnewthing/archive/2005/12/19/505449.aspx
) + */ + DPRINT("CreateProcessW: lpApplicationName: %S lpCommandLine: %S" " lpEnvironment: %p lpCurrentDirectory: %S dwCreationFlags: %lx\n", lpApplicationName, lpCommandLine, lpEnvironment, lpCurrentDirectory,
18 years, 9 months
1
0
0
0
[turner] 20272: Add initial presentation for MIT 100 Laptop.
by turner@svn.reactos.com
Add initial presentation for MIT 100 Laptop. Added: trunk/press-media/presentations/MIT Laptop/ Added: trunk/press-media/presentations/MIT Laptop/ReactOS_and_100laptop.ppt _____ Added: trunk/press-media/presentations/MIT Laptop/ReactOS_and_100laptop.ppt (Binary files differ) Property changes on: trunk/press-media/presentations/MIT Laptop/ReactOS_and_100laptop.ppt ___________________________________________________________________ Name: svn:mime-type + application/octet-stream
18 years, 9 months
1
0
0
0
[hpoussin] 20271: Implement SetupDiGetDeviceInfoListClass
by hpoussin@svn.reactos.com
Implement SetupDiGetDeviceInfoListClass Parse 'Include' and 'Needs' directives in SetupInstallFromInfSectionW and when installing services Modified: trunk/reactos/lib/setupapi/devinst.c Modified: trunk/reactos/lib/setupapi/install.c Modified: trunk/reactos/lib/setupapi/setupapi.spec _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-12-19 13:26:53 UTC (rev 20270) +++ trunk/reactos/lib/setupapi/devinst.c 2005-12-19 15:08:55 UTC (rev 20271) @@ -3184,10 +3184,70 @@ OUT PBOOL pRebootRequired OPTIONAL) { INFCONTEXT ContextService; + INFCONTEXT ContextInclude; DWORD RequiredSize; INT Flags; BOOL ret = FALSE; + /* Parse 'Include' line */ + if (SetupFindFirstLineW(hInf, SectionName, L"Include", &ContextInclude)) + { + DWORD Index = 1; + while (TRUE) + { + static WCHAR szBuffer[MAX_PATH]; + PWSTR pBuffer = NULL; + DWORD required; + + ret = SetupGetStringFieldW(&ContextInclude, Index, szBuffer, MAX_PATH, &required); + if (!ret && GetLastError() == ERROR_INVALID_PARAMETER) + break; + else if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pBuffer = MyMalloc(required); + ret = SetupGetStringFieldW(&ContextInclude, Index, pBuffer, required, &required); + } + if (ret) + ret = SetupOpenAppendInfFileW(pBuffer ? pBuffer : szBuffer, hInf, NULL); + + MyFree(pBuffer); + if (!ret) + goto done; + Index++; + } + } + + /* Parse 'Needs' line */ + if (SetupFindFirstLineW(hInf, SectionName, L"Needs", &ContextInclude)) + { + DWORD Index = 1; + while (TRUE) + { + static WCHAR szBuffer[MAX_PATH]; + PWSTR pBuffer = NULL; + DWORD required; + + ret = SetupGetStringFieldW(&ContextInclude, Index, szBuffer, MAX_PATH, &required); + if (!ret && GetLastError() == ERROR_INVALID_PARAMETER) + break; + else if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pBuffer = MyMalloc(required); + ret = SetupGetStringFieldW(&ContextInclude, Index, pBuffer, required, &required); + } + if (ret) + { + ret = InstallServicesSection(hInf, pBuffer ? pBuffer : szBuffer, + DeviceInfoSet, DeviceInfoData, pAssociatedService, pRebootRequired); + } + + MyFree(pBuffer); + if (!ret) + goto done; + Index++; + } + } + ret = SetupFindFirstLineW(hInf, SectionName, NULL, &ContextService); while (ret) { @@ -4133,6 +4193,35 @@ } /*********************************************************************** + * SetupDiGetDeviceInfoListClass (SETUPAPI.@) + */ +BOOL WINAPI SetupDiGetDeviceInfoListClass( + IN HDEVINFO DeviceInfoSet, + OUT LPGUID ClassGuid) +{ + struct DeviceInfoSet *list; + BOOL ret = FALSE; + + TRACE("%p %p\n", DeviceInfoSet, ClassGuid); + + if (!DeviceInfoSet) + SetLastError(ERROR_INVALID_HANDLE); + else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC) + SetLastError(ERROR_INVALID_HANDLE); + else if (IsEqualIID(&list->ClassGuid, &GUID_NULL)) + SetLastError(ERROR_NO_ASSOCIATED_CLASS); + else + { + memcpy(&ClassGuid, &list->ClassGuid, sizeof(GUID)); + + ret = TRUE; + } + + TRACE("Returning %d\n", ret); + return ret; +} + +/********************************************************************** * * SetupDiGetDeviceInfoListDetailW (SETUPAPI.@) */ BOOL WINAPI SetupDiGetDeviceInfoListDetailW( _____ Modified: trunk/reactos/lib/setupapi/install.c --- trunk/reactos/lib/setupapi/install.c 2005-12-19 13:26:53 UTC (rev 20270) +++ trunk/reactos/lib/setupapi/install.c 2005-12-19 15:08:55 UTC (rev 20271) @@ -64,6 +64,8 @@ static const WCHAR RegisterDlls[] = {'R','e','g','i','s','t','e','r','D','l','l','s',0}; static const WCHAR UnregisterDlls[] = {'U','n','r','e','g','i','s','t','e','r','D','l','l','s',0}; static const WCHAR ProfileItems[] = {'P','r','o','f','i','l','e','I','t','e','m','s',0}; +static const WCHAR Include[] = {'I','n','c','l','u','d','e',0}; +static const WCHAR Needs[] = {'N','e','e','d','s',0}; /*********************************************************************** @@ -789,6 +791,67 @@ PSP_FILE_CALLBACK_W callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data ) { + INFCONTEXT include_context; + + /* Parse 'Include' line */ + if (SetupFindFirstLineW( hinf, section, Include, &include_context )) + { + DWORD index = 1; + while (TRUE) + { + static WCHAR szBuffer[MAX_PATH]; + PWSTR pBuffer = NULL; + DWORD required; + BOOL ok; + + ok = SetupGetStringFieldW( &include_context, index, szBuffer, MAX_PATH, &required ); + if (!ok && GetLastError() == ERROR_INVALID_PARAMETER) + break; + else if (!ok && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pBuffer = MyMalloc(required); + ok = SetupGetStringFieldW( &include_context, index, pBuffer, required, &required ); + } + if (ok) + ok = SetupOpenAppendInfFileW( pBuffer ? pBuffer : szBuffer, hinf, NULL ); + + MyFree(pBuffer); + if (!ok) return FALSE; + index++; + } + } + + /* Parse 'Needs' line */ + if (SetupFindFirstLineW( hinf, section, Needs, &include_context )) + { + DWORD index = 1; + while (TRUE) + { + static WCHAR szBuffer[MAX_PATH]; + PWSTR pBuffer = NULL; + DWORD required; + BOOL ok; + + ok = SetupGetStringFieldW( &include_context, index, szBuffer, MAX_PATH, &required ); + if (!ok && GetLastError() == ERROR_INVALID_PARAMETER) + break; + else if (!ok && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pBuffer = MyMalloc(required); + ok = SetupGetStringFieldW( &include_context, index, pBuffer, required, &required ); + } + if (ok) + { + ok = SetupInstallFromInfSectionW( owner, hinf, pBuffer ? pBuffer : szBuffer, + flags, key_root, src_root, copy_flags, callback, context, devinfo, devinfo_data ); + } + + MyFree(pBuffer); + if (!ok) return FALSE; + index++; + } + } + if (flags & SPINST_FILES) { struct files_callback_info info; _____ Modified: trunk/reactos/lib/setupapi/setupapi.spec --- trunk/reactos/lib/setupapi/setupapi.spec 2005-12-19 13:26:53 UTC (rev 20270) +++ trunk/reactos/lib/setupapi/setupapi.spec 2005-12-19 15:08:55 UTC (rev 20271) @@ -320,7 +320,7 @@ @ stdcall SetupDiGetClassImageListExW(ptr wstr ptr) @ stub SetupDiGetClassInstallParamsA @ stub SetupDiGetClassInstallParamsW -@ stub SetupDiGetDeviceInfoListClass +@ stdcall SetupDiGetDeviceInfoListClass(ptr ptr) @ stdcall SetupDiGetDeviceInfoListDetailA(ptr ptr) @ stdcall SetupDiGetDeviceInfoListDetailW(ptr ptr) @ stdcall SetupDiGetDeviceInstallParamsA(ptr ptr ptr)
18 years, 9 months
1
0
0
0
[sgasiorek] 20270: updated Polish translation by Wiktor Maryniowski
by sgasiorek@svn.reactos.com
updated Polish translation by Wiktor Maryniowski Modified: trunk/reactos/lib/devmgr/Pl.rc _____ Modified: trunk/reactos/lib/devmgr/Pl.rc --- trunk/reactos/lib/devmgr/Pl.rc 2005-12-19 13:09:22 UTC (rev 20269) +++ trunk/reactos/lib/devmgr/Pl.rc 2005-12-19 13:26:53 UTC (rev 20270) @@ -1,16 +1,96 @@ -// Polish language resource file (Sebastian Gasiorek, 2005-11-13) +// Polish language resource file (Sebastian Gasiorek,Wiktor Maryniowski, 2005-12-12) -LANGUAGE LANG_POLISH, SUBLANG_DEFAULT +LANGUAGE LANG_POLISH, SUBLANG_NEUTRAL STRINGTABLE BEGIN -IDS_NAME "Nazwa" -IDS_TYPE "Typ" -IDS_MANUFACTURER "Producent: %1" -IDS_LOCATION "Lokalizacja: %1" -IDS_STATUS "Stan urz?dzenia: %1" + IDS_NAME "Nazwa" + IDS_TYPE "Typ" + IDS_MANUFACTURER "Producent: %1" + IDS_LOCATION "Lokalizacja: %1" + IDS_STATUS "Stan urz?dzenia: %1" + IDS_UNKNOWN "NiedostÛpne" + IDS_LOCATIONSTR "Lokalizacja %1!u! (%2)" + IDS_DEVCODE " (Kod %1!u!)" + IDS_DEVCODE2 " (Kod %2!u!)" + IDS_ENABLEDEVICE "U?ywaj tego urz?dzenia (w??czone)" + IDS_DISABLEDEVICE "Nie u?ywaj tego urz?dzenia (wy??czone)" + IDS_UNKNOWNDEVICE "Nieznane urz?dzenie" + IDS_NODRIVERLOADED "Nie zainstalowano sterownika dla tego urz?dzenia." + IDS_DEVONPARENT "w??czone %1" + IDS_TROUBLESHOOTDEV "&Konflikty..." + IDS_ENABLEDEV "&W??cz urz?dzenie" + IDS_REINSTALLDRV "&Zainstaluj sterownik ponownie" + IDS_PROPERTIES "W?a£ciwo£c&i" + IDS_UPDATEDRV "&Aktualizuj sterownik..." + IDS_REBOOT "&Uruchom komputer ponownie..." END +/* error messages, source:
http://www.z123.org/techsupport/medm.htm
*/ +STRINGTABLE +BEGIN + IDS_DEV_NO_PROBLEM "To urz?dzenie dzia?a prawid?owo." + IDS_DEV_NOT_CONFIGURED "To urz?dzenie nie jest poprawnie skonfigurowane." + IDS_DEV_DEVLOADER_FAILED "ReactOS nie mo?e za?adowaµ sterownika dla tego urz?dzenia poniewa? system raportuje dwa rodzaje magistrali typu $1." + IDS_DEV_DEVLOADER_FAILED2 "System(y) ?adowania sprzÛtu $1 . Nie m¾g? za?adowaµ sterownika dla tego urz?dzenia." + IDS_DEV_OUT_OF_MEMORY "Sterownik dla tego urz?dzenia mo?e nie byµ prawid?owy, lub system mo?e nie pracowaµ poprawnie." + IDS_DEV_ENTRY_IS_WRONG_TYPE "Urz?dzenie nie dzia?a poprawnie poniewa? jeden ze sterownik¾w nie jest prawid?owy, lub jest fle zarejestrowany." + IDS_DEV_LACKED_ARBITRATOR "Sterownik urz?dzenia wymaga zasob¾w kt¾rych, ReactOS nie potrafi przydzieliµ." + IDS_DEV_BOOT_CONFIG_CONFLICT "Inne urz?dzenie u?ywa ??danych zasob¾w." + IDS_DEV_FAILED_FILTER "Sterownik dla tego urz?dzenia powinien byµ zainstalowany ponownie." + IDS_DEV_DEVLOADER_NOT_FOUND "Urz?dzenie nie dzia?a prawid?owo poniewa? ReactOS nie m¾g? za?adowaµ pliku $1 kt¾ry ?aduje sterownik dla tego urz?dzenia." + IDS_DEV_DEVLOADER_NOT_FOUND2 "Urz?dzenie nie dzia?a prawid?owo poniewa? plik $1 kt¾ry ?aduje sterownik dla tego urz?dzenia jest b? Ûdny." + IDS_DEV_DEVLOADER_NOT_FOUND3 "B??d urz?dzenia: Spr¾buj zmieniµ sterownik tego urz?dzenia. Je£li to nie pomo?e, poszukaj rozwi?zania w dokumentacji sprzÛtowej." + IDS_DEV_INVALID_DATA "Urz?dzenie nie dzia?a prawid?owo poniewa? BIOS twojego komputera raportuje ?e zasoby dla urz?dzenia nie s? prawid?owe." + IDS_DEV_INVALID_DATA2 "Urz?dzenie nie dzia?a prawid?owo poniewa? BIOS urz?dzenia raportuje ?e zasoby dla urz?dzenia nie s? prawid?owe. " + IDS_DEV_FAILED_START "Urz?dzenie nie jest obecne, nie dzia?a poprawnie lub nie wszystkie sterowniki urz?dzenia zosta?y zainstalowane." + IDS_DEV_LIAR "ReactOS zosta? zatrzymany podczs pr¾by uruchomienia urz?dzenia, dlatego nie bÛdzie pr¾bowa? uruchamiaµ tego urz?dzenia w przysz?o£ci." + IDS_DEV_NORMAL_CONFLICT "Urz?dzenie nie mog?o odnale£µ ?adnych wolnych zasob¾w $1." + IDS_DEV_NOT_VERIFIED "Urz?dzenie nie jest obecne, nie dzia?a poprawnie lub nie wszystkie sterowniki urz?dzenia zosta?y zainstalowane." + IDS_DEV_NEED_RESTART "Urz?dzenie nie bÛdzie dzia?aµ prawid?owo dopuki nie uruchomisz ponownie komputera." + IDS_DEV_REENUMERATION "To urz?dzenie powoduje konflikt zasob¾w." + IDS_DEV_PARTIAL_LOG_CONF "ReactOS nie m¾g? zidentyfikowaµ wszystkich zasob¾w kt¾rych u?ywa urz?dzenie." + IDS_DEV_UNKNOWN_RESOURCE "Plik informacji sterownika $1 informuje ?e urz?dzenie podrzÛdne u?ywa zasob¾w kt¾rych nie rozpoznaje urz?dzenie nadrzÛdne." + IDS_DEV_REINSTALL "Sterownik dla tego urz?dzenia powinien byµ zainstalowany ponownie." + IDS_DEV_REGISTRY "Wpis mo?e nie byµ prawid?owy." + IDS_DEV_WILL_BE_REMOVED "ReactOS usuwa to urz?dzenie." + IDS_DEV_DISABLED "Urz?dzenie nie zosta?o uruchomione." + IDS_DEV_DISABLED2 "Urz?dzenie jest Wy??czone." + IDS_DEV_DEVLOADER_NOT_READY "Systemy ?adowania sprzÛtu nie m¾g?y za?adowaµ wymaganego sterownika." + IDS_DEV_DEVLOADER_NOT_READY2 "Karta graficzna dzia?a prawid?owo." + IDS_DEV_DEVLOADER_NOT_READY3 "Systemy ?adowania sprzÛtu nie m¾g?y za?adowaµ wymaganego sterownika." + IDS_DEV_DEVICE_NOT_THERE "Urz?dzenie nie jest obecne, nie dzia?a poprawnie lub nie wszystkie sterowniki urz?dzenia zosta?y zainstalowane." + IDS_DEV_MOVED "ReactOS pr¾buje skonfigurowaµ to urz?dzenie." + IDS_DEV_TOO_EARLY "ReactOS pr¾buje skonfigurowaµ to urz?dzenie." + IDS_DEV_NO_VALID_LOG_CONF "ReactOS nie potrafi? odnale£µ zasob¾w dla tego urz?dzenia." + IDS_DEV_FAILED_INSTALL "Nie zainstalowano sterownika dla tego urz?dzenia." + IDS_DEV_HARDWARE_DISABLED "Urz?dzenie jest wy??czone poniewa? BIOS nie przydzieli? ?adnych zasob¾w dla tego urz?dzenia." + IDS_DEV_CANT_SHARE_IRQ "Urz?dzenie rz?da przerwa± (IRQ) kt¾rych u?ywa inne urz?dzenie i kt¾rych nie mo?na rozdzieliµ. "\ + "Musisz zmieniµ konfliktowe ustawienia lub usun?µ sterownik powoduj?cy konflikt." + IDS_DEV_FAILED_ADD "Urz?dzenie nie dzia?a prawid?owo poniewa? $1 r¾wnie? nie dzia?a poprawnie." + IDS_DEV_DISABLED_SERVICE "ReactOS nie m¾g? zainstalowaµ sterownika dla urz?dzenia poniewa? nie m¾g? uzyskaµ dostÛpu do lokacji zawartej w pliku instalacyjnym." + IDS_DEV_TRANSLATION_FAILED "Sterownik nie jest przeznaczony dla tego urz?dzenia." + IDS_DEV_NO_SOFTCONFIG "ReactOS nie m¾g? okre£liµ ustawie± dla tego urz?dzenia. poszukaj rozwi?zania w dokumentacji urz?dzenia i u?yj palety ustawie± zasob¾w aby skonfigurowaµ je rÛcznie." + IDS_DEV_BIOS_TABLE "Firmware twojego komputera zawiera zbyt ma?o informacji aby skonfigurowaµ i u?ywaµ tego urz?dzenia. "\ + "Aby uruchomiµ urzadzenie, skontaktuj siÛ z producentem w celu uaktualnienia firmware-u lub BIOS-u ." + IDS_DEV_IRQ_TRANSLATION_FAILED "Urz?dzenie rz?da przerwa± PCI chocia? znajduje siÛ w ISA (lub na odwr¾t). "\ + "Zmie± ustawienia przerwa± dla tego urz?dzenia korzystaj?c z konfiguratora systemu." + IDS_DEV_FAILED_DRIVER_ENTRY "ReactOS nie m¾g? uruchomiµ sterownika dla tego urz?dzenia." + IDS_DEV_DRIVER_FAILED_PRIOR_UNLOAD "ReactOS nie m¾g? uruchomiµ sterownika dla tego urz?dzenia poniewa? poprzedni sterownik jest nadal w pamiÛci." + IDS_DEV_DRIVER_FAILED_LOAD "ReactOS nie m¾g? uruchomiµ sterownika dla tego urz?dzenia. Brak sterownika lub sterownik mo?e byµ uszkodzony." + IDS_DEV_DRIVER_SERVICE_KEY_INVALID "ReactOS nie m¾g? uzyskaµ dostÛpu do sprzÛtu poniewa? brakuje klucza w rejestrze lub klucz nie jest zapisany prawid?owo." + IDS_DEV_LEGACY_SERVICE_NO_DEVICES "ReactOS pomy£lnie uruchomi? sterownik urz?dzenia ale nie odnalaz? go fizycznie." + IDS_DEV_DUPLICATE_DEVICE "ReactOS nie m¾g? uruchomiµ sterownika dla tego urz?dzenia poniewa? identyczne urz?dzenie pracuje obecnie w systemie." + IDS_DEV_FAILED_POST_START "ReactOS przerwa? pracÛ urz?dzenia poniewa? zosta?y zg?oszone problemy." + IDS_DEV_HALTED "Program lub us?uga przerwa?a dzia?anie urz?dzenia." + IDS_DEV_PHANTOM "Obecnie urz?dzenie nie jest pod??czone do komputera." + IDS_DEV_SYSTEM_SHUTDOWN "ReactOS nie mo?e uzyskaµ dostÛpu do urzadzenia poniewa? trwa zamykanie systemu." + IDS_DEV_HELD_FOR_EJECT "ReactOS nie mo?e uzyskaµ dostÛpu do urzadzenia poniewa? urz?dzenie to by?o przygotowane do \"bezpiecznego usuniÛcia\", ale nie zosta?o od??czone." + IDS_DEV_DRIVER_BLOCKED "Oprogramowanie urz?dzenia zosta?o zablokowane przy starcie poniewa? nie wsp¾?pracuje poprewnie z systemem ReactOS. Spr¾buj zainstalowaµ nowszy sterownik." + IDS_DEV_REGISTRY_TOO_LARGE "ReactOS nie mo?e uruchomiµ nowego urz?dzenia poniewa? j?dro systemu jest zbyt wielkie (przekracza limit rozmiaru rejestru)." + IDS_DEV_SETPROPERTIES_FAILED "ReactOS nie by? w stanie zmieniµ parametr¾w instalacyjnych tego urz?dzenia." +END + IDD_HARDWARE DIALOG DISCARDABLE 0, 0, 300, 400 STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" @@ -25,5 +105,25 @@ LTEXT "",IDC_STATUS,14,112,183,30 PUSHBUTTON "&Rozwi?zywanie problem¾w...",IDC_TROUBLESHOOT,85,140,54,14, BS_PUSHBUTTON | WS_CHILD | WS_DISABLED | WS_TABSTOP - PUSHBUTTON "&W?a£ciwo£ci",IDC_PROPERTIES,146,140,50,14 + PUSHBUTTON "W?a£ciwo£ci",IDC_PROPERTIES,146,140,50,14 END + +IDD_DEVICEGENERAL DIALOG DISCARDABLE 0, 0, 252, 218 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Og¾lne" +FONT 8, "MS Shell Dlg" +BEGIN + ICON "", IDC_DEVICON, 7, 7, 20, 20 + LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX + LTEXT "Typ urz?dzenia:", -1, 37, 39, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DEVTYPE, 100, 39, 146, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Producent:", -1, 37, 53, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DEVMANUFACTURER, 100, 53, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Lokalizacja:", -1, 37, 67, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DEVLOCATION, 100, 67, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + GROUPBOX "Stan urz?dzenia", IDC_DEVSTATUSGROUP, 7, 83, 238, 100 + EDITTEXT IDC_DEVSTATUS, 14, 96, 224, 61, NOT WS_TABSTOP | ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL + PUSHBUTTON "&Rozwi?zywanie problem¾w...", IDC_DEVPROBLEM, 148, 163, 90, 15 + LTEXT "&U?ycie urz?dzenia:", IDC_DEVUSAGELABEL, 7, 188, 222, 8, WS_DISABLED + COMBOBOX IDC_DEVUSAGE, 7, 198, 239, 40, CBS_DROPDOWNLIST | WS_VSCROLL | WS_DISABLED +END
18 years, 9 months
1
0
0
0
[hpoussin] 20269: Implement SetupDiGetActualSectionToInstallExA/W
by hpoussin@svn.reactos.com
Implement SetupDiGetActualSectionToInstallExA/W Modified: trunk/reactos/lib/setupapi/devinst.c Modified: trunk/reactos/lib/setupapi/setupapi.spec Modified: trunk/reactos/w32api/include/setupapi.h Modified: trunk/reactos/w32api/include/winnt.h _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-12-19 10:43:08 UTC (rev 20268) +++ trunk/reactos/lib/setupapi/devinst.c 2005-12-19 13:09:22 UTC (rev 20269) @@ -31,11 +31,8 @@ static const WCHAR DeviceInstance[] = {'D','e','v','i','c','e','I','n','s','t','a','n','c','e',0}; static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0}; static const WCHAR InterfaceInstall32[] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2' ,0}; -static const WCHAR NtExtension[] = {'.','N','T',0}; -static const WCHAR NtPlatformExtension[] = {'.','N','T','x','8','6',0}; static const WCHAR SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k',0}; static const WCHAR Version[] = {'V','e','r','s','i','o','n',0}; -static const WCHAR WinExtension[] = {'.','W','i','n',0}; /* FIXME: header mess */ DEFINE_GUID(GUID_NULL, @@ -823,16 +820,53 @@ /*********************************************************************** * SetupDiGetActualSectionToInstallA (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetActualSectionToInstallA( - HINF InfHandle, - PCSTR InfSectionName, - PSTR InfSectionWithExt, - DWORD InfSectionWithExtSize, - PDWORD RequiredSize, - PSTR *Extension) +BOOL WINAPI +SetupDiGetActualSectionToInstallA( + IN HINF InfHandle, + IN PCSTR InfSectionName, + OUT PSTR InfSectionWithExt OPTIONAL, + IN DWORD InfSectionWithExtSize, + OUT PDWORD RequiredSize OPTIONAL, + OUT PSTR *Extension OPTIONAL) { + return SetupDiGetActualSectionToInstallExA(InfHandle, InfSectionName, + NULL, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, + Extension, NULL); +} + +/********************************************************************** * + * SetupDiGetActualSectionToInstallW (SETUPAPI.@) + */ +BOOL WINAPI +SetupDiGetActualSectionToInstallW( + IN HINF InfHandle, + IN PCWSTR InfSectionName, + OUT PWSTR InfSectionWithExt OPTIONAL, + IN DWORD InfSectionWithExtSize, + OUT PDWORD RequiredSize OPTIONAL, + OUT PWSTR *Extension OPTIONAL) +{ + return SetupDiGetActualSectionToInstallExW(InfHandle, InfSectionName, + NULL, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, + Extension, NULL); +} + +/********************************************************************** * + * SetupDiGetActualSectionToInstallExA (SETUPAPI.@) + */ +BOOL WINAPI +SetupDiGetActualSectionToInstallExA( + IN HINF InfHandle, + IN PCSTR InfSectionName, + IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo OPTIONAL, + OUT PSTR InfSectionWithExt OPTIONAL, + IN DWORD InfSectionWithExtSize, + OUT PDWORD RequiredSize OPTIONAL, + OUT PSTR* Extension OPTIONAL, + IN PVOID Reserved) +{ LPWSTR InfSectionNameW = NULL; - PWSTR InfSectionWithExtW = NULL; + LPWSTR InfSectionWithExtW = NULL; PWSTR ExtensionW; BOOL bResult = FALSE; @@ -841,18 +875,23 @@ if (InfSectionName) { InfSectionNameW = MultiByteToUnicode(InfSectionName, CP_ACP); - if (InfSectionNameW == NULL) goto end; + if (InfSectionNameW == NULL) + goto cleanup; } if (InfSectionWithExt) { - InfSectionWithExtW = HeapAlloc(GetProcessHeap(), 0, InfSectionWithExtSize * sizeof(WCHAR)); - if (InfSectionWithExtW == NULL) goto end; + InfSectionWithExtW = MyMalloc(InfSectionWithExtSize * sizeof(WCHAR)); + if (InfSectionWithExtW == NULL) + goto cleanup; } - bResult = SetupDiGetActualSectionToInstallW(InfHandle, InfSectionNameW, - InfSectionWithExt ? InfSectionNameW : NULL, - InfSectionWithExtSize, RequiredSize, - Extension ? &ExtensionW : NULL); + bResult = SetupDiGetActualSectionToInstallExW( + InfHandle, InfSectionNameW, AlternatePlatformInfo, + InfSectionWithExt ? InfSectionWithExtW : NULL, + InfSectionWithExtSize, + RequiredSize, + Extension ? &ExtensionW : NULL, + Reserved); if (bResult && InfSectionWithExt) { @@ -867,93 +906,188 @@ *Extension = &InfSectionWithExt[ExtensionW - InfSectionWithExtW]; } -end: - if (InfSectionNameW) MyFree(InfSectionNameW); - if (InfSectionWithExtW) HeapFree(GetProcessHeap(), 0, InfSectionWithExtW); +cleanup: + MyFree(InfSectionNameW); + MyFree(InfSectionWithExtW); return bResult; } /*********************************************************************** - * SetupDiGetActualSectionToInstallW (SETUPAPI.@) + * SetupDiGetActualSectionToInstallExW (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetActualSectionToInstallW( - HINF InfHandle, - PCWSTR InfSectionName, - PWSTR InfSectionWithExt, - DWORD InfSectionWithExtSize, - PDWORD RequiredSize, - PWSTR *Extension) +BOOL WINAPI +SetupDiGetActualSectionToInstallExW( + IN HINF InfHandle, + IN PCWSTR InfSectionName, + IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo OPTIONAL, + OUT PWSTR InfSectionWithExt OPTIONAL, + IN DWORD InfSectionWithExtSize, + OUT PDWORD RequiredSize OPTIONAL, + OUT PWSTR* Extension OPTIONAL, + IN PVOID Reserved) { - WCHAR szBuffer[MAX_PATH]; - DWORD dwLength; - DWORD dwFullLength; - LONG lLineCount = -1; + BOOL ret = FALSE; - TRACE("%p %s %p %lu %p %p\n", InfHandle, debugstr_w(InfSectionName), - InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension); + TRACE("%p %s %p %p %lu %p %p %p\n", InfHandle, debugstr_w(InfSectionName), + AlternatePlatformInfo, InfSectionWithExt, InfSectionWithExtSize, + RequiredSize, Extension, Reserved); - lstrcpyW(szBuffer, InfSectionName); - dwLength = lstrlenW(szBuffer); - - if (OsVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) - { - /* Test section name with '.NTx86' extension */ - lstrcpyW(&szBuffer[dwLength], NtPlatformExtension); - lLineCount = SetupGetLineCountW(InfHandle, szBuffer); - - if (lLineCount == -1) - { - /* Test section name with '.NT' extension */ - lstrcpyW(&szBuffer[dwLength], NtExtension); - lLineCount = SetupGetLineCountW(InfHandle, szBuffer); - } - } + if (!InfHandle || InfHandle == (HINF)INVALID_HANDLE_VALUE) + SetLastError(ERROR_INVALID_HANDLE); + else if (!InfSectionName) + SetLastError(ERROR_INVALID_PARAMETER); + else if (AlternatePlatformInfo && AlternatePlatformInfo->cbSize != sizeof(SP_ALTPLATFORM_INFO)) + SetLastError(ERROR_INVALID_USER_BUFFER); + else if (Reserved != NULL) + SetLastError(ERROR_INVALID_PARAMETER); else { - /* Test section name with '.Win' extension */ - lstrcpyW(&szBuffer[dwLength], WinExtension); - lLineCount = SetupGetLineCountW(InfHandle, szBuffer); - } + static SP_ALTPLATFORM_INFO CurrentPlatform = { 0, }; + PSP_ALTPLATFORM_INFO pPlatformInfo = &CurrentPlatform; + LPCWSTR pExtensionPlatform, pExtensionArchitecture; + WCHAR SectionName[LINE_LEN + 1]; + LONG lLineCount = -1; + DWORD dwFullLength; - if (lLineCount == -1) - { - /* Test section name without extension */ - szBuffer[dwLength] = 0; - lLineCount = SetupGetLineCountW(InfHandle, szBuffer); - } + /* Fill platform info if needed */ + if (AlternatePlatformInfo) + pPlatformInfo = AlternatePlatformInfo; + else if (CurrentPlatform.cbSize != sizeof(SP_ALTPLATFORM_INFO)) + { + /* That's the first time we go here. We need to fill in the structure */ + OSVERSIONINFO VersionInfo; + SYSTEM_INFO SystemInfo; + VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + ret = GetVersionEx(&VersionInfo); + if (!ret) + goto done; + GetSystemInfo(&SystemInfo); + CurrentPlatform.cbSize = sizeof(SP_ALTPLATFORM_INFO); + CurrentPlatform.Platform = VersionInfo.dwPlatformId; + CurrentPlatform.MajorVersion = VersionInfo.dwMajorVersion; + CurrentPlatform.MinorVersion = VersionInfo.dwMinorVersion; + CurrentPlatform.ProcessorArchitecture = SystemInfo.wProcessorArchitecture; + CurrentPlatform.Reserved = 0; + } - if (lLineCount == -1) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } +static const WCHAR ExtensionPlatformNone[] = {'.',0}; +static const WCHAR ExtensionPlatformNT[] = {'.','N','T',0}; +static const WCHAR ExtensionPlatformWindows[] = {'.','W','i','n',0}; - dwFullLength = lstrlenW(szBuffer); +static const WCHAR ExtensionArchitectureNone[] = {0}; +static const WCHAR ExtensionArchitectureamd64[] = {'a','m','d','6','4',0}; +static const WCHAR ExtensionArchitectureppc[] = {'p','p','c',0}; +static const WCHAR ExtensionArchitecturex86[] = {'x','8','6',0}; - if (InfSectionWithExt != NULL && InfSectionWithExtSize != 0) - { - if (InfSectionWithExtSize < (dwFullLength + 1)) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } + /* Set various extensions values */ + switch (pPlatformInfo->Platform) + { + case VER_PLATFORM_WIN32_WINDOWS: + pExtensionPlatform = ExtensionPlatformWindows; + break; + case VER_PLATFORM_WIN32_NT: + pExtensionPlatform = ExtensionPlatformNT; + break; + default: + pExtensionPlatform = ExtensionPlatformNone; + break; + } + switch (pPlatformInfo->ProcessorArchitecture) + { + case PROCESSOR_ARCHITECTURE_AMD64: + pExtensionArchitecture = ExtensionArchitectureamd64; + break; + case PROCESSOR_ARCHITECTURE_INTEL: + pExtensionArchitecture = ExtensionArchitecturex86; + break; + case PROCESSOR_ARCHITECTURE_PPC: + pExtensionArchitecture = ExtensionArchitectureppc; + break; + default: + ERR("Unknown processor architecture 0x%x\n", pPlatformInfo->ProcessorArchitecture); + case PROCESSOR_ARCHITECTURE_UNKNOWN: + pExtensionArchitecture = ExtensionArchitectureNone; + break; + } - lstrcpyW(InfSectionWithExt, szBuffer); - if (Extension != NULL) - { - *Extension = (dwLength == dwFullLength) ? NULL : &InfSectionWithExt[dwLength]; - } - } + SectionName[LINE_LEN] = UNICODE_NULL; - if (RequiredSize != NULL) - { - *RequiredSize = dwFullLength + 1; + /* Test with platform.architecture.major.minor extension */ + snprintfW(SectionName, LINE_LEN, L"%s%s%s.%lu.%lu", InfSectionName, + pExtensionPlatform, pExtensionArchitecture, pPlatformInfo->MajorVersion, pPlatformInfo->MinorVersion); + lLineCount = SetupGetLineCountW(InfHandle, SectionName); + if (lLineCount != -1) goto sectionfound; + + /* Test with platform.major.minor extension */ + snprintfW(SectionName, LINE_LEN, L"%s%s.%lu.%lu", InfSectionName, + pExtensionPlatform, pPlatformInfo->MajorVersion, pPlatformInfo->MinorVersion); + lLineCount = SetupGetLineCountW(InfHandle, SectionName); + if (lLineCount != -1) goto sectionfound; + + /* Test with platform.architecture.major extension */ + snprintfW(SectionName, LINE_LEN, L"%s%s%s.%lu", InfSectionName, + pExtensionPlatform, pExtensionArchitecture, pPlatformInfo->MajorVersion); + lLineCount = SetupGetLineCountW(InfHandle, SectionName); + if (lLineCount != -1) goto sectionfound; + + /* Test with platform.major extension */ + snprintfW(SectionName, LINE_LEN, L"%s%s.%lu", InfSectionName, + pExtensionPlatform, pPlatformInfo->MajorVersion); + lLineCount = SetupGetLineCountW(InfHandle, SectionName); + if (lLineCount != -1) goto sectionfound; + + /* Test with platform.architecture extension */ + snprintfW(SectionName, LINE_LEN, L"%s%s%s", InfSectionName, + pExtensionPlatform, pExtensionArchitecture); + lLineCount = SetupGetLineCountW(InfHandle, SectionName); + if (lLineCount != -1) goto sectionfound; + + /* Test with platform extension */ + snprintfW(SectionName, LINE_LEN, L"%s%s", InfSectionName, + pExtensionPlatform); + lLineCount = SetupGetLineCountW(InfHandle, SectionName); + if (lLineCount != -1) goto sectionfound; + + /* Test without extension */ + snprintfW(SectionName, LINE_LEN, L"%s", InfSectionName); + lLineCount = SetupGetLineCountW(InfHandle, SectionName); + if (lLineCount != -1) goto sectionfound; + + /* No appropriate section found */ + SetLastError(ERROR_INVALID_PARAMETER); + goto done; + +sectionfound: + dwFullLength = lstrlenW(SectionName); + if (InfSectionWithExt != NULL && InfSectionWithExtSize != 0) + { + if (InfSectionWithExtSize < (dwFullLength + 1)) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + goto done; + } + + lstrcpyW(InfSectionWithExt, SectionName); + if (Extension != NULL) + { + DWORD dwLength = lstrlenW(SectionName); + *Extension = (dwLength == dwFullLength) ? NULL : &InfSectionWithExt[dwLength]; + } + } + + if (RequiredSize != NULL) + *RequiredSize = dwFullLength + 1; + + ret = TRUE; } - return TRUE; +done: + TRACE("Returning %d\n", ret); + return ret; } + /*********************************************************************** * SetupDiGetClassDescriptionA (SETUPAPI.@) */ _____ Modified: trunk/reactos/lib/setupapi/setupapi.spec --- trunk/reactos/lib/setupapi/setupapi.spec 2005-12-19 10:43:08 UTC (rev 20268) +++ trunk/reactos/lib/setupapi/setupapi.spec 2005-12-19 13:09:22 UTC (rev 20269) @@ -300,6 +300,8 @@ @ stdcall SetupDiEnumDriverInfoA(long ptr long long ptr) @ stdcall SetupDiEnumDriverInfoW(long ptr long long ptr) @ stdcall SetupDiGetActualSectionToInstallA(long str str long ptr ptr) +@ stdcall SetupDiGetActualSectionToInstallExA(long str ptr str long ptr ptr ptr) +@ stdcall SetupDiGetActualSectionToInstallExW(long wstr ptr wstr long ptr ptr ptr) @ stdcall SetupDiGetActualSectionToInstallW(long wstr wstr long ptr ptr) @ stub SetupDiGetClassBitmapIndex @ stdcall SetupDiGetClassDescriptionA(ptr str long ptr) _____ Modified: trunk/reactos/w32api/include/setupapi.h --- trunk/reactos/w32api/include/setupapi.h 2005-12-19 10:43:08 UTC (rev 20268) +++ trunk/reactos/w32api/include/setupapi.h 2005-12-19 13:09:22 UTC (rev 20269) @@ -1200,6 +1200,8 @@ WINSETUPAPI BOOL WINAPI SetupDiEnumDriverInfoA(HDEVINFO,PSP_DEVINFO_DATA,DWORD,DWORD,PSP_DRVINFO _DATA_A); WINSETUPAPI BOOL WINAPI SetupDiEnumDriverInfoW(HDEVINFO,PSP_DEVINFO_DATA,DWORD,DWORD,PSP_DRVINFO _DATA_W); WINSETUPAPI BOOL WINAPI SetupDiGetActualSectionToInstallA(HINF,PCSTR,PSTR,DWORD,PDWORD,PSTR*); +WINSETUPAPI BOOL WINAPI SetupDiGetActualSectionToInstallExA(HINF,PCSTR,PSP_ALTPLATFORM_INFO,PSTR ,DWORD,PDWORD,PSTR*,PVOID); +WINSETUPAPI BOOL WINAPI SetupDiGetActualSectionToInstallExW(HINF,PCWSTR,PSP_ALTPLATFORM_INFO,PWS TR,DWORD,PDWORD,PWSTR*,PVOID); WINSETUPAPI BOOL WINAPI SetupDiGetActualSectionToInstallW(HINF,PCWSTR,PWSTR,DWORD,PDWORD,PWSTR*) ; WINSETUPAPI BOOL WINAPI SetupDiGetClassBitmapIndex(CONST GUID*,PINT); WINSETUPAPI BOOL WINAPI SetupDiGetClassDescriptionA(CONST GUID*,PSTR,DWORD,PDWORD); @@ -1475,6 +1477,7 @@ #define SetupDiCreateDevRegKey SetupDiCreateDevRegKeyW #define SetupDiEnumDriverInfo SetupDiEnumDriverInfoW #define SetupDiGetActualSectionToInstall SetupDiGetActualSectionToInstallW +#define SetupDiGetActualSectionToInstallEx SetupDiGetActualSectionToInstallExW #define SetupDiGetClassDescriptionEx SetupDiGetClassDescriptionExW #define SetupDiGetClassDescription SetupDiGetClassDescriptionW #define SetupDiGetClassDevPropertySheets SetupDiGetClassDevPropertySheetsW @@ -1595,6 +1598,7 @@ #define SetupDiDeleteInterfaceDeviceData SetupDiDeleteDeviceInterfaceData #define SetupDiEnumDriverInfo SetupDiEnumDriverInfoA #define SetupDiGetActualSectionToInstall SetupDiGetActualSectionToInstallA +#define SetupDiGetActualSectionToInstallEx SetupDiGetActualSectionToInstallExA #define SetupDiGetClassDescription SetupDiGetClassDescriptionA #define SetupDiGetClassDescriptionEx SetupDiGetClassDescriptionExA #define SetupDiGetClassDevPropertySheets SetupDiGetClassDevPropertySheetsA _____ Modified: trunk/reactos/w32api/include/winnt.h --- trunk/reactos/w32api/include/winnt.h 2005-12-19 10:43:08 UTC (rev 20268) +++ trunk/reactos/w32api/include/winnt.h 2005-12-19 13:09:22 UTC (rev 20269) @@ -849,7 +849,8 @@ #define PROCESSOR_ARCHITECTURE_ARM 5 #define PROCESSOR_ARCHITECTURE_IA64 6 #define PROCESSOR_ARCHITECTURE_ALPHA64 7 -#define PROCESSOR_ARCHITECTURE_MSIL8 +#define PROCESSOR_ARCHITECTURE_MSIL 8 +#define PROCESSOR_ARCHITECTURE_AMD64 9 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF #define PF_FLOATING_POINT_PRECISION_ERRATA 0 #define PF_FLOATING_POINT_EMULATED 1
18 years, 9 months
1
0
0
0
[hpoussin] 20268: Install "ClassInstall32.Services" section in SetupDiInstallClassExW
by hpoussin@svn.reactos.com
Install "ClassInstall32.Services" section in SetupDiInstallClassExW Modified: trunk/reactos/lib/setupapi/devinst.c _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-12-19 10:15:06 UTC (rev 20267) +++ trunk/reactos/lib/setupapi/devinst.c 2005-12-19 10:43:08 UTC (rev 20268) @@ -29,6 +29,7 @@ static const WCHAR Class[] = {'C','l','a','s','s',0}; static const WCHAR ClassInstall32[] = {'C','l','a','s','s','I','n','s','t','a','l','l','3','2',0}; static const WCHAR DeviceInstance[] = {'D','e','v','i','c','e','I','n','s','t','a','n','c','e',0}; +static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0}; static const WCHAR InterfaceInstall32[] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2' ,0}; static const WCHAR NtExtension[] = {'.','N','T',0}; static const WCHAR NtPlatformExtension[] = {'.','N','T','x','8','6',0}; @@ -3039,6 +3040,122 @@ } +static BOOL +InstallServicesSection( + IN HINF hInf, + IN PCWSTR SectionName, + IN HDEVINFO DeviceInfoSet OPTIONAL, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + OUT PCWSTR* pAssociatedService OPTIONAL, + OUT PBOOL pRebootRequired OPTIONAL) +{ + INFCONTEXT ContextService; + DWORD RequiredSize; + INT Flags; + BOOL ret = FALSE; + + ret = SetupFindFirstLineW(hInf, SectionName, NULL, &ContextService); + while (ret) + { + LPWSTR ServiceName = NULL; + LPWSTR ServiceSection = NULL; + + ret = SetupGetStringFieldW( + &ContextService, + 1, /* Field index */ + NULL, 0, + &RequiredSize); + if (!ret) + goto nextservice; + if (RequiredSize > 0) + { + /* We got the needed size for the buffer */ + ServiceName = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); + if (!ServiceName) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto nextservice; + } + ret = SetupGetStringFieldW( + &ContextService, + 1, /* Field index */ + ServiceName, RequiredSize, + &RequiredSize); + if (!ret) + goto nextservice; + } + ret = SetupGetIntField( + &ContextService, + 2, /* Field index */ + &Flags); + if (!ret) + { + /* The field may be empty. Ignore the error */ + Flags = 0; + } + ret = SetupGetStringFieldW( + &ContextService, + 3, /* Field index */ + NULL, 0, + &RequiredSize); + if (!ret) + { + if (GetLastError() == ERROR_INVALID_PARAMETER) + { + /* This first is probably missing. It is not + * required, so ignore the error */ + RequiredSize = 0; + ret = TRUE; + } + else + goto nextservice; + } + if (RequiredSize > 0) + { + /* We got the needed size for the buffer */ + ServiceSection = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); + if (!ServiceSection) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto nextservice; + } + ret = SetupGetStringFieldW( + &ContextService, + 3, /* Field index */ + ServiceSection, RequiredSize, + &RequiredSize); + if (!ret) + goto nextservice; + + SetLastError(ERROR_SUCCESS); + ret = SetupInstallServicesFromInfSectionExW( + hInf, + ServiceSection, Flags, DeviceInfoSet, DeviceInfoData, ServiceName, NULL); + } + if (ret && (Flags & SPSVCINST_ASSOCSERVICE)) + { + if (pAssociatedService) + { + *pAssociatedService = ServiceName; + ServiceName = NULL; + } + if (pRebootRequired && GetLastError() == ERROR_SUCCESS_REBOOT_REQUIRED) + *pRebootRequired = TRUE; + } +nextservice: + HeapFree(GetProcessHeap(), 0, ServiceName); + HeapFree(GetProcessHeap(), 0, ServiceSection); + if (!ret) + goto done; + ret = SetupFindNextLine(&ContextService, &ContextService); + } + + ret = TRUE; + +done: + return ret; +} + /*********************************************************************** * SetupDiInstallClassExW (SETUPAPI.@) */ @@ -3058,8 +3175,6 @@ if (!InfFileName && !InterfaceClassGuid) SetLastError(ERROR_INVALID_PARAMETER); - else if (InfFileName && InterfaceClassGuid) - SetLastError(ERROR_INVALID_PARAMETER); else if (Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL)) { TRACE("Unknown flags: 0x%08lx\n", Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL)); @@ -3080,17 +3195,9 @@ if (InterfaceClassGuid) { - /* Retrieve the actual section name */ - ret = SetupDiGetActualSectionToInstallW(hInf, - InterfaceInstall32, - SectionName, - MAX_PATH, - NULL, - NULL); - if (!ret) - goto cleanup; - + /* SetupDiCreateDeviceInterface??? */ FIXME("Installing an interface is not implemented\n"); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); } else { @@ -3123,7 +3230,7 @@ hInf, ClassInstall32, SectionName, - MAX_PATH, + MAX_PATH - wcslen(DotServices), NULL, NULL); if (!ret) @@ -3148,7 +3255,11 @@ if (!ret) goto cleanup; - /* FIXME: Install .Services section */ + /* Install .Services section */ + lstrcatW(SectionName, DotServices); + ret = InstallServicesSection(hInf, SectionName, NULL, NULL, NULL, NULL); + if (!ret) + goto cleanup; ret = TRUE; } @@ -6965,8 +7076,6 @@ WCHAR Buffer[32]; DWORD SectionNameLength = 0; BOOL Result = FALSE; - INFCONTEXT ContextService; - INT Flags; ULONG DoAction; DWORD RequiredSize; LPCWSTR AssociatedService = NULL; @@ -7025,7 +7134,7 @@ SelectedDriver->InfFileDetails->hInf, SelectedDriver->Details.SectionName, SectionName, MAX_PATH, &SectionNameLength, NULL); - if (!Result || SectionNameLength > MAX_PATH - 9) + if (!Result || SectionNameLength > MAX_PATH - wcslen(DotServices)) goto cleanup; pSectionName = &SectionName[wcslen(SectionName)]; @@ -7133,100 +7242,17 @@ /* FIXME: Process .LogConfigOverride section */ /* Install .Services section */ - wcscpy(pSectionName, L".Services"); - Result = SetupFindFirstLineW(SelectedDriver->InfFileDetails->hInf, SectionName, NULL, &ContextService); - while (Result) - { - LPWSTR ServiceName = NULL; - LPWSTR ServiceSection = NULL; + wcscpy(pSectionName, DotServices); + Result = InstallServicesSection( + SelectedDriver->InfFileDetails->hInf, + SectionName, + DeviceInfoSet, + DeviceInfoData, + &AssociatedService, + &RebootRequired); + if (!Result) + goto cleanup; - Result = SetupGetStringFieldW( - &ContextService, - 1, /* Field index */ - NULL, 0, - &RequiredSize); - if (!Result) - goto nextservice; - if (RequiredSize > 0) - { - /* We got the needed size for the buffer */ - ServiceName = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); - if (!ServiceName) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto nextservice; - } - Result = SetupGetStringFieldW( - &ContextService, - 1, /* Field index */ - ServiceName, RequiredSize, - &RequiredSize); - if (!Result) - goto nextservice; - } - Result = SetupGetIntField( - &ContextService, - 2, /* Field index */ - &Flags); - if (!Result) - { - /* The field may be empty. Ignore the error */ - Flags = 0; - } - Result = SetupGetStringFieldW( - &ContextService, - 3, /* Field index */ - NULL, 0, - &RequiredSize); - if (!Result) - { - if (GetLastError() == ERROR_INVALID_PARAMETER) - { - /* This first is probably missing. It is not - * required, so ignore the error */ - RequiredSize = 0; - Result = TRUE; - } - else - goto nextservice; - } - if (RequiredSize > 0) - { - /* We got the needed size for the buffer */ - ServiceSection = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); - if (!ServiceSection) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto nextservice; - } - Result = SetupGetStringFieldW( - &ContextService, - 3, /* Field index */ - ServiceSection, RequiredSize, - &RequiredSize); - if (!Result) - goto nextservice; - - SetLastError(ERROR_SUCCESS); - Result = SetupInstallServicesFromInfSectionExW( - SelectedDriver->InfFileDetails->hInf, - ServiceSection, Flags, DeviceInfoSet, DeviceInfoData, ServiceName, NULL); - } - if (Result && (Flags & SPSVCINST_ASSOCSERVICE)) - { - AssociatedService = ServiceName; - ServiceName = NULL; - if (GetLastError() == ERROR_SUCCESS_REBOOT_REQUIRED) - RebootRequired = TRUE; - } -nextservice: - HeapFree(GetProcessHeap(), 0, ServiceName); - HeapFree(GetProcessHeap(), 0, ServiceSection); - if (!Result) - goto cleanup; - Result = SetupFindNextLine(&ContextService, &ContextService); - } - /* Copy .inf file to Inf\ directory (if needed) */ Result = InfIsFromOEMLocation(SelectedDriver->InfFileDetails->FullInfFileName, &NeedtoCopyFile); if (!Result)
18 years, 9 months
1
0
0
0
[hpoussin] 20267: Implement SetupDiInstallClassExA
by hpoussin@svn.reactos.com
Implement SetupDiInstallClassExA Implement parts of SetupDiInstallClassExW 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-12-19 01:50:51 UTC (rev 20266) +++ trunk/reactos/lib/setupapi/devinst.c 2005-12-19 10:15:06 UTC (rev 20267) @@ -2913,31 +2913,67 @@ return ret; } + /*********************************************************************** * SetupDiInstallClassA (SETUPAPI.@) */ BOOL WINAPI SetupDiInstallClassA( - HWND hwndParent, - PCSTR InfFileName, - DWORD Flags, - HSPFILEQ FileQueue) + IN HWND hwndParent OPTIONAL, + IN PCSTR InfFileName, + IN DWORD Flags, + IN HSPFILEQ FileQueue OPTIONAL) { - UNICODE_STRING FileNameW; + return SetupDiInstallClassExA(hwndParent, InfFileName, Flags, FileQueue, NULL, NULL, NULL); +} + + +/********************************************************************** * + * SetupDiInstallClassW (SETUPAPI.@) + */ +BOOL WINAPI SetupDiInstallClassW( + IN HWND hwndParent OPTIONAL, + IN PCWSTR InfFileName, + IN DWORD Flags, + IN HSPFILEQ FileQueue OPTIONAL) +{ + return SetupDiInstallClassExW(hwndParent, InfFileName, Flags, FileQueue, NULL, NULL, NULL); +} + + +/********************************************************************** * + * SetupDiInstallClassExA (SETUPAPI.@) + */ +BOOL WINAPI SetupDiInstallClassExA( + IN HWND hwndParent OPTIONAL, + IN PCSTR InfFileName OPTIONAL, + IN DWORD Flags, + IN HSPFILEQ FileQueue OPTIONAL, + IN const GUID* InterfaceClassGuid OPTIONAL, + IN PVOID Reserved1, + IN PVOID Reserved2) +{ + PWSTR InfFileNameW = NULL; BOOL Result; - if (!RtlCreateUnicodeStringFromAsciiz(&FileNameW, InfFileName)) + if (InfFileName) { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; + InfFileNameW = MultiByteToUnicode(InfFileName, CP_ACP); + if (InfFileNameW == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } } - Result = SetupDiInstallClassW(hwndParent, FileNameW.Buffer, Flags, FileQueue); + Result = SetupDiInstallClassExW(hwndParent, InfFileNameW, Flags, + FileQueue, InterfaceClassGuid, Reserved1, Reserved2); - RtlFreeUnicodeString(&FileNameW); + MyFree(InfFileNameW); return Result; } + static HKEY CreateClassKey(HINF hInf) { WCHAR FullBuffer[MAX_PATH]; @@ -3002,103 +3038,131 @@ return hClassKey; } + /*********************************************************************** - * SetupDiInstallClassW (SETUPAPI.@) + * SetupDiInstallClassExW (SETUPAPI.@) */ -BOOL WINAPI SetupDiInstallClassW( - HWND hwndParent, - PCWSTR InfFileName, - DWORD Flags, - HSPFILEQ FileQueue) +BOOL WINAPI SetupDiInstallClassExW( + IN HWND hwndParent OPTIONAL, + IN PCWSTR InfFileName OPTIONAL, + IN DWORD Flags, + IN HSPFILEQ FileQueue OPTIONAL, + IN const GUID* InterfaceClassGuid OPTIONAL, + IN PVOID Reserved1, + IN PVOID Reserved2) { - WCHAR SectionName[MAX_PATH]; - DWORD SectionNameLength = 0; - HINF hInf; - BOOL bFileQueueCreated = FALSE; - HKEY hClassKey; + BOOL ret = FALSE; - TRACE("%p %s 0x%lx %p\n", hwndParent, debugstr_w(InfFileName), - Flags, FileQueue); + TRACE("%p %s 0x%lx %p %s %p %p\n", hwndParent, debugstr_w(InfFileName), Flags, + FileQueue, debugstr_guid(InterfaceClassGuid), Reserved1, Reserved2); - FIXME("not fully implemented\n"); - - if ((Flags & DI_NOVCP) && (FileQueue == NULL || FileQueue == INVALID_HANDLE_VALUE)) + if (!InfFileName && !InterfaceClassGuid) + SetLastError(ERROR_INVALID_PARAMETER); + else if (InfFileName && InterfaceClassGuid) + SetLastError(ERROR_INVALID_PARAMETER); + else if (Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL)) { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + TRACE("Unknown flags: 0x%08lx\n", Flags & ~(DI_NOVCP | DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL)); + SetLastError(ERROR_INVALID_FLAGS); } - - /* Open the .inf file */ - hInf = SetupOpenInfFileW(InfFileName, - NULL, - INF_STYLE_WIN4, - NULL); - if (hInf == INVALID_HANDLE_VALUE) + else if ((Flags & DI_NOVCP) && FileQueue == NULL) + SetLastError(ERROR_INVALID_PARAMETER); + else if (Reserved1 != NULL) + SetLastError(ERROR_INVALID_PARAMETER); + else if (Reserved2 != NULL) + SetLastError(ERROR_INVALID_PARAMETER); + else { + WCHAR SectionName[MAX_PATH]; + HINF hInf = INVALID_HANDLE_VALUE; + HKEY hClassKey = INVALID_HANDLE_VALUE; + PVOID callback_context = NULL; - return FALSE; - } + if (InterfaceClassGuid) + { + /* Retrieve the actual section name */ + ret = SetupDiGetActualSectionToInstallW(hInf, + InterfaceInstall32, + SectionName, + MAX_PATH, + NULL, + NULL); + if (!ret) + goto cleanup; - /* Create or open the class registry key 'HKLM\\CurrentControlSet\\Class\\{GUID}' */ - hClassKey = CreateClassKey(hInf); - if (hClassKey == INVALID_HANDLE_VALUE) - { - SetupCloseInfFile(hInf); - return FALSE; - } + FIXME("Installing an interface is not implemented\n"); + } + else + { + if (Flags & DI_NOVCP) + FIXME("FileQueue argument ignored\n"); + if (Flags & (DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL)) + FIXME("Flags 0x%lx ignored\n", Flags & (DI_NOBROWSE | DI_FORCECOPY | DI_QUIETINSTALL)); + /* Open the .inf file */ + hInf = SetupOpenInfFileW( + InfFileName, + NULL, + INF_STYLE_WIN4, + NULL); + if (hInf == INVALID_HANDLE_VALUE) + goto cleanup; + /* Create or open the class registry key 'HKLM\CurrentControlSet\Class\{GUID}' */ + hClassKey = CreateClassKey(hInf); + if (hClassKey == INVALID_HANDLE_VALUE) + goto cleanup; - /* Try to append a layout file */ -#if 0 - SetupOpenAppendInfFileW(NULL, hInf, NULL); -#endif + /* Try to append a layout file */ + ret = SetupOpenAppendInfFileW(NULL, hInf, NULL); + if (!ret) + goto cleanup; - /* Retrieve the actual section name */ - SetupDiGetActualSectionToInstallW(hInf, - ClassInstall32, - SectionName, - MAX_PATH, - &SectionNameLength, - NULL); + /* Retrieve the actual section name */ + ret = SetupDiGetActualSectionToInstallW( + hInf, + ClassInstall32, + SectionName, + MAX_PATH, + NULL, + NULL); + if (!ret) + goto cleanup; -#if 0 - if (!(Flags & DI_NOVCP)) - { - FileQueue = SetupOpenFileQueue(); - if (FileQueue == INVALID_HANDLE_VALUE) - { - SetupCloseInfFile(hInf); - RegCloseKey(hClassKey); - return FALSE; - } + callback_context = SetupInitDefaultQueueCallback(hwndParent); + if (!callback_context) + goto cleanup; - bFileQueueCreated = TRUE; + ret = SetupInstallFromInfSectionW( + hwndParent, + hInf, + SectionName, + SPINST_REGISTRY | SPINST_FILES | SPINST_BITREG | SPINST_INIFILES | SPINST_INI2REG, + hClassKey, + NULL, /* SourceRootPath */ + 0, /* CopyFlags */ + SetupDefaultQueueCallbackW, + callback_context, + NULL, + NULL); + if (!ret) + goto cleanup; - } -#endif + /* FIXME: Install .Services section */ - SetupInstallFromInfSectionW(NULL, - hInf, - SectionName, - SPINST_REGISTRY, - hClassKey, - NULL, - 0, - NULL, - NULL, - INVALID_HANDLE_VALUE, - NULL); + ret = TRUE; + } - /* FIXME: Process InterfaceInstall32 section */ +cleanup: + if (hInf != INVALID_HANDLE_VALUE) + SetupCloseInfFile(hInf); + if (hClassKey != INVALID_HANDLE_VALUE) + RegCloseKey(hClassKey); + SetupTermDefaultQueueCallback(callback_context); + } - if (bFileQueueCreated) - SetupCloseFileQueue(FileQueue); - - SetupCloseInfFile(hInf); - - RegCloseKey(hClassKey); - return TRUE; + TRACE("Returning %d\n", ret); + return ret; } @@ -4639,7 +4703,6 @@ if (KeyType == DIREG_DEV) { /* We're done. Just return the hKey handle */ - CHECKPOINT1; ret = hKey; goto cleanup; } @@ -7213,7 +7276,7 @@ rc = RegSetValueEx(hKey, REGSTR_VAL_DEVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (wcslen(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) rc = RegSetValueEx(hKey, REGSTR_VAL_MFG, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.MfgName, (wcslen(SelectedDriver->Info.MfgName) + 1) * sizeof(WCHAR)); - if (rc == ERROR_SUCCESS && *AssociatedService) + if (rc == ERROR_SUCCESS && AssociatedService && *AssociatedService) rc = RegSetValueEx(hKey, REGSTR_VAL_SERVICE, 0, REG_SZ, (const BYTE *)AssociatedService, (wcslen(AssociatedService) + 1) * sizeof(WCHAR)); if (rc != ERROR_SUCCESS) { _____ Modified: trunk/reactos/lib/setupapi/setupapi.spec --- trunk/reactos/lib/setupapi/setupapi.spec 2005-12-19 01:50:51 UTC (rev 20266) +++ trunk/reactos/lib/setupapi/setupapi.spec 2005-12-19 10:15:06 UTC (rev 20267) @@ -348,8 +348,8 @@ @ stdcall SetupDiGetSelectedDriverW(ptr ptr ptr) @ stub SetupDiGetWizardPage @ stdcall SetupDiInstallClassA(long str long ptr) -@ stub SetupDiInstallClassExA -@ stub SetupDiInstallClassExW +@ stdcall SetupDiInstallClassExA(long str long ptr ptr ptr ptr) +@ stdcall SetupDiInstallClassExW(long wstr long ptr ptr ptr ptr) @ stdcall SetupDiInstallClassW(long wstr long ptr) @ stdcall SetupDiInstallDevice(ptr ptr) @ stdcall SetupDiInstallDeviceInterfaces(ptr ptr)
18 years, 9 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
71
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
Results per page:
10
25
50
100
200