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
May 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
377 discussions
Start a n
N
ew thread
[janderwald] 21866: add library output paths to linker implement project dependency tracking - now we can build modules with dependend subprojects from ReactOS.sln
by janderwald@svn.reactos.org
Author: janderwald Date: Tue May 9 16:22:33 2006 New Revision: 21866 URL:
http://svn.reactos.ru/svn/reactos?rev=21866&view=rev
Log: add library output paths to linker implement project dependency tracking - now we can build modules with dependend subprojects from ReactOS.sln Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/v…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp (original) +++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Tue May 9 16:22:33 2006 @@ -152,18 +152,8 @@ const vector<Library*>& libs = data.libraries; for ( i = 0; i < libs.size(); i++ ) { -#if 0 - // this code is deactivated untill the tree builds fine with msvc - // --- is appended to each library path which is later - // replaced by the configuration - // i.e. ../output-i386/lib/rtl/vcXX/---/rtl.lib becomes - // ../output-i386/lib/rtl/vcXX/Debug/rtl.lib - // etc string libpath = outdir + "\\" + libs[i]->importedModule->GetBasePath() + "\\" + _get_vc_dir() + "\\---\\" + libs[i]->name + ".lib"; libraries.push_back ( libpath ); -#else - libraries.push_back ( libs[i]->name + ".lib" ); -#endif } const vector<Define*>& defs = data.defines; for ( i = 0; i < defs.size(); i++ ) @@ -381,17 +371,24 @@ { if ( i > 0 ) fprintf ( OUT, " " ); -#if 0 - // this code is deactivated untill - // msvc can build the whole tree string libpath = libraries[i].c_str(); - libpath.replace (libpath.find("---"), //See HACK + libpath = libpath.erase (0, libpath.find_last_of ("\\") + 1 ); + fprintf ( OUT, "%s", libpath.c_str() ); + } + fprintf ( OUT, "\"\r\n" ); + + fprintf ( OUT, "\t\t\t\tAdditionalLibraryDirectories=\"" ); + for (i = 0; i < libraries.size (); i++) + { + if ( i > 0 ) + fprintf ( OUT, ";" ); + + string libpath = libraries[i].c_str(); + libpath.replace (libpath.find("---"), 3, cfg); + libpath = libpath.substr (0, libpath.find_last_of ("\\") ); fprintf ( OUT, "%s", libpath.c_str() ); -#else - fprintf ( OUT, "%s", libraries[i].c_str() ); -#endif } fprintf ( OUT, "\"\r\n" ); @@ -649,20 +646,41 @@ std::string vcproj_guid, const std::vector<Dependency*>& dependencies ) { - vcproj_file = DosSeparator ( std::string(".\\") + vcproj_file ); - - fprintf ( OUT, "Project(\"%s\") = \"%s\", \"%s\", \"%s\"\r\n", sln_guid.c_str() , module.name.c_str(), vcproj_file.c_str(), vcproj_guid.c_str() ); + //vcproj_file = DosSeparator ( std::string(".\\") + vcproj_file ); + + fprintf ( OUT, "Project(\"%s\") = \"%s\", \"%s\", \"{%s}\"\r\n", sln_guid.c_str() , module.name.c_str(), vcproj_file.c_str(), vcproj_guid.c_str() ); + + vector<const IfableData*> ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + //FIXME: only omit ProjectDependencies in VS 2005 when there are no dependencies //NOTE: VS 2002 do not use ProjectSection; it uses GlobalSection instead - if ((configuration.VSProjectVersion == "7.10") || (dependencies.size() > 0)) { - fprintf ( OUT, "\tProjectSection(ProjectDependencies) = postProject\r\n" ); - for ( size_t i = 0; i < dependencies.size(); i++ ) - { - Dependency& dependency = *dependencies[i]; - fprintf ( OUT, "\t\t%s = %s\r\n", dependency.module.guid.c_str(), dependency.module.guid.c_str() ); - } - fprintf ( OUT, "\tEndProjectSection\r\n" ); + if (configuration.VSProjectVersion != "7.00") { + + bool has_dependencies = false; + + + + + while ( ifs_list.size() ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector<Library*>& libs = data.libraries; + for ( unsigned i = 0; i < libs.size(); i++ ) + { + if ( !has_dependencies ) { + fprintf ( OUT, "\tProjectSection(ProjectDependencies) = postProject\r\n" ); + has_dependencies = true; + } + + fprintf ( OUT, "\t\t{%s} = {%s}\r\n", libs[i]->importedModule->guid.c_str(), libs[i]->importedModule->guid.c_str()); + } + } + if ( has_dependencies ) + fprintf ( OUT, "\tEndProjectSection\r\n" ); } fprintf ( OUT, "EndProject\r\n" );
18 years, 7 months
1
0
0
0
[janderwald] 21865: exclude wine/w32api headers from msvc include paths
by janderwald@svn.reactos.org
Author: janderwald Date: Tue May 9 13:23:20 2006 New Revision: 21865 URL:
http://svn.reactos.ru/svn/reactos?rev=21865&view=rev
Log: exclude wine/w32api headers from msvc include paths Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/v…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp (original) +++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Tue May 9 13:23:20 2006 @@ -131,11 +131,17 @@ for ( i = 0; i < incs.size(); i++ ) { // explicitly omit win32api directories - if ( !strncmp(incs[i]->directory.c_str(), "w32api", 6 ) ) + if ( !strncmp(incs[i]->directory.c_str(), "include\\ddk", 11 ) ) + continue; + + if ( !strncmp(incs[i]->directory.c_str(), "include\\crt", 11 ) ) continue; + if ( !strncmp(incs[i]->directory.c_str(), "include\\GL", 10 ) ) + continue; + // explicitly omit include/wine directories - if ( !strncmp(incs[i]->directory.c_str(), "include\\wine", 12 ) ) + if ( !strncmp(incs[i]->directory.c_str(), "include\\reactos\\wine", 20 ) ) continue; string path = Path::RelativeFromDirectory (
18 years, 7 months
1
0
0
0
[greatlrd] 21864: correct the ntoskrnl to the new LARGE_MCB strucrt
by greatlrd@svn.reactos.org
Author: greatlrd Date: Tue May 9 10:02:26 2006 New Revision: 21864 URL:
http://svn.reactos.ru/svn/reactos?rev=21864&view=rev
Log: correct the ntoskrnl to the new LARGE_MCB strucrt Modified: trunk/reactos/ntoskrnl/fs/mcb.c Modified: trunk/reactos/ntoskrnl/fs/mcb.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/fs/mcb.c?rev=21864…
============================================================================== --- trunk/reactos/ntoskrnl/fs/mcb.c (original) +++ trunk/reactos/ntoskrnl/fs/mcb.c Tue May 9 10:02:26 2006 @@ -106,7 +106,7 @@ IN POOL_TYPE PoolType) { UNIMPLEMENTED; - Mcb->BaseMcb.PoolType = PoolType; + Mcb->PoolType = PoolType; } /* @@ -262,7 +262,7 @@ { ULONG NumberOfRuns; ExAcquireFastMutex (Mcb->FastMutex); - NumberOfRuns = Mcb->BaseMcb.PairCount; + NumberOfRuns = Mcb->PairCount; ExReleaseFastMutex (Mcb->FastMutex); return(NumberOfRuns); }
18 years, 7 months
1
0
0
0
[greatlrd] 21863: fixing right define of struct typedef LARGE_MCB *PLARGE_MCB
by greatlrd@svn.reactos.org
Author: greatlrd Date: Tue May 9 10:01:32 2006 New Revision: 21863 URL:
http://svn.reactos.ru/svn/reactos?rev=21863&view=rev
Log: fixing right define of struct typedef LARGE_MCB *PLARGE_MCB Modified: trunk/reactos/include/ddk/ntifs.h Modified: trunk/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=218…
============================================================================== --- trunk/reactos/include/ddk/ntifs.h (original) +++ trunk/reactos/include/ddk/ntifs.h Tue May 9 10:01:32 2006 @@ -1230,10 +1230,12 @@ } BASE_MCB; typedef BASE_MCB *PBASE_MCB; -typedef struct _LARGE_MCB -{ +typedef struct _LARGE_MCB { PFAST_MUTEX FastMutex; - BASE_MCB BaseMcb; + ULONG MaximumPairCount; + ULONG PairCount; + POOL_TYPE PoolType; + PVOID Mapping; } LARGE_MCB; typedef LARGE_MCB *PLARGE_MCB;
18 years, 7 months
1
0
0
0
[jimtabor] 21862: I fixed a mistake?
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue May 9 07:55:10 2006 New Revision: 21862 URL:
http://svn.reactos.ru/svn/reactos?rev=21862&view=rev
Log: I fixed a mistake? Modified: trunk/reactos/ntoskrnl/fs/mcb.c Modified: trunk/reactos/ntoskrnl/fs/mcb.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/fs/mcb.c?rev=21862…
============================================================================== --- trunk/reactos/ntoskrnl/fs/mcb.c (original) +++ trunk/reactos/ntoskrnl/fs/mcb.c Tue May 9 07:55:10 2006 @@ -262,7 +262,7 @@ { ULONG NumberOfRuns; ExAcquireFastMutex (Mcb->FastMutex); - NumberOfRuns=Mcb->PairCount; + NumberOfRuns = Mcb->BaseMcb.PairCount; ExReleaseFastMutex (Mcb->FastMutex); return(NumberOfRuns); }
18 years, 7 months
1
0
0
0
[hpoussin] 21861: Add CommonFilesDir and ProgramFilesDir to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue May 9 03:54:03 2006 New Revision: 21861 URL:
http://svn.reactos.ru/svn/reactos?rev=21861&view=rev
Log: Add CommonFilesDir and ProgramFilesDir to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion Modified: trunk/reactos/dll/win32/shell32/shellpath.c Modified: trunk/reactos/dll/win32/shell32/shellpath.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/shell32/shellpath…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellpath.c (original) +++ trunk/reactos/dll/win32/shell32/shellpath.c Tue May 9 03:54:03 2006 @@ -804,6 +804,7 @@ static const WCHAR AllUsersProfileValueW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'}; static const WCHAR szSHFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; static const WCHAR szSHUserFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; +static const WCHAR szSHSetupFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\0'}; /* This defaults to L"Documents and Settings" on Windows 2000/XP, but we're * acting more Windows 9x-like for now. */ @@ -1768,6 +1769,8 @@ path); else if (CSIDL_Data[folders[i]].type == CSIDL_Type_AllUsers) _SHGetAllUsersProfilePath(SHGFP_TYPE_DEFAULT, folders[i], path); + else if (CSIDL_Data[folders[i]].type == CSIDL_Type_CurrVer) + _SHGetDefaultValue(folders[i], path); else hr = E_FAIL; if (*path) @@ -1878,6 +1881,21 @@ return hr; } +static HRESULT _SHRegisterSetupShellFolders(void) +{ + static const UINT folders[] = { + CSIDL_PROGRAM_FILES_COMMON, + CSIDL_PROGRAM_FILES, + }; + HRESULT hr; + + TRACE("\n"); + hr = _SHRegisterFolders(HKEY_LOCAL_MACHINE, NULL, szSHSetupFolders, + szSHSetupFolders, folders, sizeof(folders) / sizeof(folders[0])); + TRACE("returning 0x%08lx\n", hr); + return hr; +} + /* Register the default values in the registry, as some apps seem to depend * on their presence. The set registered was taken from Windows XP. */ @@ -1889,6 +1907,8 @@ hr = _SHRegisterUserShellFolders(FALSE); if (SUCCEEDED(hr)) hr = _SHRegisterCommonShellFolders(); + if (SUCCEEDED(hr)) + hr = _SHRegisterSetupShellFolders(); return hr; }
18 years, 7 months
1
0
0
0
[greatlrd] 21860: FsRtlNumberOfRunsInLargeMcb compare http://www.jankratochvil.net/captive source changes of ReactOS ntoskrnl and we found a bug in ReactOS ntoskrnl.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Tue May 9 02:07:09 2006 New Revision: 21860 URL:
http://svn.reactos.ru/svn/reactos?rev=21860&view=rev
Log: FsRtlNumberOfRunsInLargeMcb compare
http://www.jankratochvil.net/captive
source changes of ReactOS ntoskrnl and we found a bug in ReactOS ntoskrnl. Modified: trunk/reactos/ntoskrnl/fs/mcb.c Modified: trunk/reactos/ntoskrnl/fs/mcb.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/fs/mcb.c?rev=21860…
============================================================================== --- trunk/reactos/ntoskrnl/fs/mcb.c (original) +++ trunk/reactos/ntoskrnl/fs/mcb.c Tue May 9 02:07:09 2006 @@ -262,7 +262,7 @@ { ULONG NumberOfRuns; ExAcquireFastMutex (Mcb->FastMutex); - NumberOfRuns=Mcb->BaseMcb.MaximumPairCount; + NumberOfRuns=Mcb->PairCount; ExReleaseFastMutex (Mcb->FastMutex); return(NumberOfRuns); }
18 years, 7 months
1
0
0
0
[hpoussin] 21859: Patch by Thomas Weidermueller (w3seek at reactos dot com) - Fix some parameter names and IN/OUT/OPTIONAL
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue May 9 01:32:36 2006 New Revision: 21859 URL:
http://svn.reactos.ru/svn/reactos?rev=21859&view=rev
Log: Patch by Thomas Weidermueller (w3seek at reactos dot com) - Fix some parameter names and IN/OUT/OPTIONAL Modified: trunk/reactos/dll/win32/setupapi/devinst.c Modified: trunk/reactos/dll/win32/setupapi/devinst.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst.…
============================================================================== --- trunk/reactos/dll/win32/setupapi/devinst.c (original) +++ trunk/reactos/dll/win32/setupapi/devinst.c Tue May 9 01:32:36 2006 @@ -93,7 +93,7 @@ IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, IN DWORD ClassInstallParamsSize); -static UPDATE_CLASS_PARAM_HANDLER UpdateClassInstallParamHandlers[] = { +static const UPDATE_CLASS_PARAM_HANDLER UpdateClassInstallParamHandlers[] = { NULL, /* DIF_SELECTDEVICE */ NULL, /* DIF_INSTALLDEVICE */ NULL, /* DIF_ASSIGNRESOURCES */ @@ -141,11 +141,12 @@ /*********************************************************************** * SetupDiBuildClassInfoList (SETUPAPI.@) */ -BOOL WINAPI SetupDiBuildClassInfoList( - DWORD Flags, - LPGUID ClassGuidList, - DWORD ClassGuidListSize, - PDWORD RequiredSize) +BOOL WINAPI +SetupDiBuildClassInfoList( + IN DWORD Flags, + OUT LPGUID ClassGuidList OPTIONAL, + IN DWORD ClassGuidListSize, + OUT PDWORD RequiredSize) { TRACE("\n"); return SetupDiBuildClassInfoListExW(Flags, ClassGuidList, @@ -156,13 +157,14 @@ /*********************************************************************** * SetupDiBuildClassInfoListExA (SETUPAPI.@) */ -BOOL WINAPI SetupDiBuildClassInfoListExA( - DWORD Flags, - LPGUID ClassGuidList, - DWORD ClassGuidListSize, - PDWORD RequiredSize, - LPCSTR MachineName, - PVOID Reserved) +BOOL WINAPI +SetupDiBuildClassInfoListExA( + IN DWORD Flags, + OUT LPGUID ClassGuidList OPTIONAL, + IN DWORD ClassGuidListSize, + OUT PDWORD RequiredSize, + IN PCSTR MachineName OPTIONAL, + IN PVOID Reserved) { LPWSTR MachineNameW = NULL; BOOL bResult; @@ -188,13 +190,14 @@ /*********************************************************************** * SetupDiBuildClassInfoListExW (SETUPAPI.@) */ -BOOL WINAPI SetupDiBuildClassInfoListExW( - DWORD Flags, - LPGUID ClassGuidList, - DWORD ClassGuidListSize, - PDWORD RequiredSize, - LPCWSTR MachineName, - PVOID Reserved) +BOOL WINAPI +SetupDiBuildClassInfoListExW( + IN DWORD Flags, + OUT LPGUID ClassGuidList OPTIONAL, + IN DWORD ClassGuidListSize, + OUT PDWORD RequiredSize, + IN PCWSTR MachineName OPTIONAL, + IN PVOID Reserved) { WCHAR szKeyName[MAX_GUID_STRING_LEN + 1]; HKEY hClassesKey = INVALID_HANDLE_VALUE; @@ -318,11 +321,12 @@ /*********************************************************************** * SetupDiClassGuidsFromNameA (SETUPAPI.@) */ -BOOL WINAPI SetupDiClassGuidsFromNameA( - LPCSTR ClassName, - LPGUID ClassGuidList, - DWORD ClassGuidListSize, - PDWORD RequiredSize) +BOOL WINAPI +SetupDiClassGuidsFromNameA( + IN PCSTR ClassName, + OUT LPGUID ClassGuidList, + IN DWORD ClassGuidListSize, + OUT PDWORD RequiredSize) { return SetupDiClassGuidsFromNameExA(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize, @@ -333,10 +337,10 @@ * SetupDiClassGuidsFromNameW (SETUPAPI.@) */ BOOL WINAPI SetupDiClassGuidsFromNameW( - LPCWSTR ClassName, - LPGUID ClassGuidList, - DWORD ClassGuidListSize, - PDWORD RequiredSize) + IN PCWSTR ClassName, + OUT LPGUID ClassGuidList, + IN DWORD ClassGuidListSize, + OUT PDWORD RequiredSize) { return SetupDiClassGuidsFromNameExW(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize, @@ -346,13 +350,14 @@ /*********************************************************************** * SetupDiClassGuidsFromNameExA (SETUPAPI.@) */ -BOOL WINAPI SetupDiClassGuidsFromNameExA( - LPCSTR ClassName, - LPGUID ClassGuidList, - DWORD ClassGuidListSize, - PDWORD RequiredSize, - LPCSTR MachineName, - PVOID Reserved) +BOOL WINAPI +SetupDiClassGuidsFromNameExA( + IN PCSTR ClassName, + OUT LPGUID ClassGuidList, + IN DWORD ClassGuidListSize, + OUT PDWORD RequiredSize, + IN PCSTR MachineName OPTIONAL, + IN PVOID Reserved) { LPWSTR ClassNameW = NULL; LPWSTR MachineNameW = NULL; @@ -389,13 +394,14 @@ /*********************************************************************** * SetupDiClassGuidsFromNameExW (SETUPAPI.@) */ -BOOL WINAPI SetupDiClassGuidsFromNameExW( - LPCWSTR ClassName, - LPGUID ClassGuidList, - DWORD ClassGuidListSize, - PDWORD RequiredSize, - LPCWSTR MachineName, - PVOID Reserved) +BOOL WINAPI +SetupDiClassGuidsFromNameExW( + IN PCWSTR ClassName, + OUT LPGUID ClassGuidList, + IN DWORD ClassGuidListSize, + OUT PDWORD RequiredSize, + IN PCWSTR MachineName OPTIONAL, + IN PVOID Reserved) { WCHAR szKeyName[MAX_GUID_STRING_LEN + 1]; WCHAR szClassName[256]; @@ -501,11 +507,12 @@ /*********************************************************************** * SetupDiClassNameFromGuidA (SETUPAPI.@) */ -BOOL WINAPI SetupDiClassNameFromGuidA( - const GUID* ClassGuid, - PSTR ClassName, - DWORD ClassNameSize, - PDWORD RequiredSize) +BOOL WINAPI +SetupDiClassNameFromGuidA( + IN CONST GUID* ClassGuid, + OUT PSTR ClassName, + IN DWORD ClassNameSize, + OUT PDWORD RequiredSize OPTIONAL) { return SetupDiClassNameFromGuidExA(ClassGuid, ClassName, ClassNameSize, RequiredSize, @@ -515,11 +522,12 @@ /*********************************************************************** * SetupDiClassNameFromGuidW (SETUPAPI.@) */ -BOOL WINAPI SetupDiClassNameFromGuidW( - const GUID* ClassGuid, - PWSTR ClassName, - DWORD ClassNameSize, - PDWORD RequiredSize) +BOOL WINAPI +SetupDiClassNameFromGuidW( + IN CONST GUID* ClassGuid, + OUT PWSTR ClassName, + IN DWORD ClassNameSize, + OUT PDWORD RequiredSize OPTIONAL) { return SetupDiClassNameFromGuidExW(ClassGuid, ClassName, ClassNameSize, RequiredSize, @@ -529,13 +537,14 @@ /*********************************************************************** * SetupDiClassNameFromGuidExA (SETUPAPI.@) */ -BOOL WINAPI SetupDiClassNameFromGuidExA( - const GUID* ClassGuid, - PSTR ClassName, - DWORD ClassNameSize, - PDWORD RequiredSize, - PCSTR MachineName, - PVOID Reserved) +BOOL WINAPI +SetupDiClassNameFromGuidExA( + IN CONST GUID* ClassGuid, + OUT PSTR ClassName, + IN DWORD ClassNameSize, + OUT PDWORD RequiredSize OPTIONAL, + IN PCSTR MachineName OPTIONAL, + IN PVOID Reserved) { WCHAR ClassNameW[MAX_CLASS_NAME_LEN]; LPWSTR MachineNameW = NULL; @@ -560,13 +569,14 @@ /*********************************************************************** * SetupDiClassNameFromGuidExW (SETUPAPI.@) */ -BOOL WINAPI SetupDiClassNameFromGuidExW( - const GUID* ClassGuid, - PWSTR ClassName, - DWORD ClassNameSize, - PDWORD RequiredSize, - PCWSTR MachineName, - PVOID Reserved) +BOOL WINAPI +SetupDiClassNameFromGuidExW( + IN CONST GUID* ClassGuid, + OUT PWSTR ClassName, + IN DWORD ClassNameSize, + OUT PDWORD RequiredSize OPTIONAL, + IN PCWSTR MachineName OPTIONAL, + IN PVOID Reserved) { HKEY hKey; DWORD dwLength; @@ -627,8 +637,9 @@ * SetupDiCreateDeviceInfoList (SETUPAPI.@) */ HDEVINFO WINAPI -SetupDiCreateDeviceInfoList(const GUID *ClassGuid, - HWND hwndParent) +SetupDiCreateDeviceInfoList( + IN CONST GUID *ClassGuid OPTIONAL, + IN HWND hwndParent OPTIONAL) { return SetupDiCreateDeviceInfoListExW(ClassGuid, hwndParent, NULL, NULL); } @@ -637,10 +648,11 @@ * SetupDiCreateDeviceInfoListExA (SETUPAPI.@) */ HDEVINFO WINAPI -SetupDiCreateDeviceInfoListExA(const GUID *ClassGuid, - HWND hwndParent, - PCSTR MachineName, - PVOID Reserved) +SetupDiCreateDeviceInfoListExA( + IN CONST GUID *ClassGuid OPTIONAL, + IN HWND hwndParent OPTIONAL, + IN PCSTR MachineName OPTIONAL, + IN PVOID Reserved) { LPWSTR MachineNameW = NULL; HDEVINFO hDevInfo; @@ -696,10 +708,11 @@ * SetupDiCreateDeviceInfoListExW (SETUPAPI.@) */ HDEVINFO WINAPI -SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, - HWND hwndParent, - PCWSTR MachineName, - PVOID Reserved) +SetupDiCreateDeviceInfoListExW( + IN CONST GUID *ClassGuid OPTIONAL, + IN HWND hwndParent OPTIONAL, + IN PCWSTR MachineName OPTIONAL, + IN PVOID Reserved) { struct DeviceInfoSet *list; LPWSTR UNCServerName = NULL; @@ -796,10 +809,11 @@ /*********************************************************************** * SetupDiEnumDeviceInfo (SETUPAPI.@) */ -BOOL WINAPI SetupDiEnumDeviceInfo( - HDEVINFO DeviceInfoSet, - DWORD MemberIndex, - PSP_DEVINFO_DATA DeviceInfoData) +BOOL WINAPI +SetupDiEnumDeviceInfo( + IN HDEVINFO DeviceInfoSet, + IN DWORD MemberIndex, + OUT PSP_DEVINFO_DATA DeviceInfoData) { BOOL ret = FALSE; @@ -843,12 +857,12 @@ */ BOOL WINAPI SetupDiGetActualSectionToInstallA( - IN HINF InfHandle, - IN PCSTR InfSectionName, - OUT PSTR InfSectionWithExt OPTIONAL, - IN DWORD InfSectionWithExtSize, - OUT PDWORD RequiredSize OPTIONAL, - OUT PSTR *Extension OPTIONAL) + 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, @@ -860,12 +874,12 @@ */ BOOL WINAPI SetupDiGetActualSectionToInstallW( - IN HINF InfHandle, - IN PCWSTR InfSectionName, - OUT PWSTR InfSectionWithExt OPTIONAL, - IN DWORD InfSectionWithExtSize, - OUT PDWORD RequiredSize OPTIONAL, - OUT PWSTR *Extension OPTIONAL) + 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, @@ -877,14 +891,14 @@ */ 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) + 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; LPWSTR InfSectionWithExtW = NULL; @@ -939,14 +953,14 @@ */ 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) + 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) { BOOL ret = FALSE; @@ -1133,11 +1147,12 @@ /*********************************************************************** * SetupDiGetClassDescriptionA (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassDescriptionA( - const GUID* ClassGuid, - PSTR ClassDescription, - DWORD ClassDescriptionSize, - PDWORD RequiredSize) +BOOL WINAPI +SetupDiGetClassDescriptionA( + IN CONST GUID *ClassGuid, + OUT PSTR ClassDescription, + IN DWORD ClassDescriptionSize, + OUT PDWORD RequiredSize OPTIONAL) { return SetupDiGetClassDescriptionExA(ClassGuid, ClassDescription, ClassDescriptionSize, @@ -1147,11 +1162,12 @@ /*********************************************************************** * SetupDiGetClassDescriptionW (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassDescriptionW( - const GUID* ClassGuid, - PWSTR ClassDescription, - DWORD ClassDescriptionSize, - PDWORD RequiredSize) +BOOL WINAPI +SetupDiGetClassDescriptionW( + IN CONST GUID *ClassGuid, + OUT PWSTR ClassDescription, + IN DWORD ClassDescriptionSize, + OUT PDWORD RequiredSize OPTIONAL) { return SetupDiGetClassDescriptionExW(ClassGuid, ClassDescription, ClassDescriptionSize, @@ -1161,13 +1177,14 @@ /*********************************************************************** * SetupDiGetClassDescriptionExA (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassDescriptionExA( - const GUID* ClassGuid, - PSTR ClassDescription, - DWORD ClassDescriptionSize, - PDWORD RequiredSize, - PCSTR MachineName, - PVOID Reserved) +BOOL WINAPI +SetupDiGetClassDescriptionExA( + IN CONST GUID *ClassGuid, + OUT PSTR ClassDescription, + IN DWORD ClassDescriptionSize, + OUT PDWORD RequiredSize OPTIONAL, + IN PCSTR MachineName OPTIONAL, + IN PVOID Reserved) { PWCHAR ClassDescriptionW; LPWSTR MachineNameW = NULL; @@ -1218,13 +1235,14 @@ /*********************************************************************** * SetupDiGetClassDescriptionExW (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassDescriptionExW( - const GUID* ClassGuid, - PWSTR ClassDescription, - DWORD ClassDescriptionSize, - PDWORD RequiredSize, - PCWSTR MachineName, - PVOID Reserved) +BOOL WINAPI +SetupDiGetClassDescriptionExW( + IN CONST GUID *ClassGuid, + OUT PWSTR ClassDescription, + IN DWORD ClassDescriptionSize, + OUT PDWORD RequiredSize OPTIONAL, + IN PCWSTR MachineName OPTIONAL, + IN PVOID Reserved) { HKEY hKey = INVALID_HANDLE_VALUE; DWORD dwLength; @@ -1283,68 +1301,71 @@ /*********************************************************************** * SetupDiGetClassDevsA (SETUPAPI.@) */ -HDEVINFO WINAPI SetupDiGetClassDevsA( - CONST GUID *class, - LPCSTR enumstr, - HWND parent, - DWORD flags) -{ - return SetupDiGetClassDevsExA(class, enumstr, parent, - flags, NULL, NULL, NULL); +HDEVINFO WINAPI +SetupDiGetClassDevsA( + IN CONST GUID *ClassGuid OPTIONAL, + IN PCSTR Enumerator OPTIONAL, + IN HWND hwndParent OPTIONAL, + IN DWORD Flags) +{ + return SetupDiGetClassDevsExA(ClassGuid, Enumerator, hwndParent, + Flags, NULL, NULL, NULL); } /*********************************************************************** * SetupDiGetClassDevsW (SETUPAPI.@) */ -HDEVINFO WINAPI SetupDiGetClassDevsW( - CONST GUID *class, - LPCWSTR enumstr, - HWND parent, - DWORD flags) -{ - return SetupDiGetClassDevsExW(class, enumstr, parent, - flags, NULL, NULL, NULL); +HDEVINFO WINAPI +SetupDiGetClassDevsW( + IN CONST GUID *ClassGuid OPTIONAL, + IN PCWSTR Enumerator OPTIONAL, + IN HWND hwndParent OPTIONAL, + IN DWORD Flags) +{ + return SetupDiGetClassDevsExW(ClassGuid, Enumerator, hwndParent, + Flags, NULL, NULL, NULL); } /*********************************************************************** * SetupDiGetClassDevsExA (SETUPAPI.@) */ -HDEVINFO WINAPI SetupDiGetClassDevsExA( - CONST GUID *class, - LPCSTR enumstr, - HWND parent, - DWORD flags, - HDEVINFO deviceset, - LPCSTR machine, - PVOID reserved) +HDEVINFO WINAPI +SetupDiGetClassDevsExA( + IN CONST GUID *ClassGuid OPTIONAL, + IN PCSTR Enumerator OPTIONAL, + IN HWND hwndParent OPTIONAL, + IN DWORD Flags, + IN HDEVINFO DeviceInfoSet OPTIONAL, + IN PCSTR MachineName OPTIONAL, + IN PVOID Reserved) { HDEVINFO ret; LPWSTR enumstrW = NULL; LPWSTR machineW = NULL; - if (enumstr) - { - int len = MultiByteToWideChar(CP_ACP, 0, enumstr, -1, NULL, 0); + if (Enumerator) + { + int len = MultiByteToWideChar(CP_ACP, 0, Enumerator, -1, NULL, 0); enumstrW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (!enumstrW) { ret = (HDEVINFO)INVALID_HANDLE_VALUE; goto end; } - MultiByteToWideChar(CP_ACP, 0, enumstr, -1, enumstrW, len); - } - if (machine) - { - int len = MultiByteToWideChar(CP_ACP, 0, machine, -1, NULL, 0); + MultiByteToWideChar(CP_ACP, 0, Enumerator, -1, enumstrW, len); + } + if (MachineName) + { + int len = MultiByteToWideChar(CP_ACP, 0, MachineName, -1, NULL, 0); machineW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (!machineW) { ret = (HDEVINFO)INVALID_HANDLE_VALUE; goto end; } - MultiByteToWideChar(CP_ACP, 0, machine, -1, machineW, len); - } - ret = SetupDiGetClassDevsExW(class, enumstrW, parent, flags, deviceset, machineW, reserved); + MultiByteToWideChar(CP_ACP, 0, MachineName, -1, machineW, len); + } + ret = SetupDiGetClassDevsExW(ClassGuid, enumstrW, hwndParent, Flags, DeviceInfoSet, machineW, Reserved); end: HeapFree(GetProcessHeap(), 0, enumstrW); @@ -1422,11 +1443,12 @@ return TRUE; } -static LONG SETUP_CreateDevListFromEnumerator( - struct DeviceInfoSet *list, - LPCGUID pClassGuid OPTIONAL, - LPCWSTR Enumerator, - HKEY hEnumeratorKey) /* handle to Enumerator registry key */ +static LONG +SETUP_CreateDevListFromEnumerator( + struct DeviceInfoSet *list, + CONST GUID *pClassGuid OPTIONAL, + LPCWSTR Enumerator, + HKEY hEnumeratorKey) /* handle to Enumerator registry key */ { HKEY hDeviceIdKey = NULL, hInstanceIdKey; WCHAR KeyBuffer[MAX_PATH]; @@ -1535,11 +1557,12 @@ return rc; } -static LONG SETUP_CreateDevList( - struct DeviceInfoSet *list, - PCWSTR MachineName OPTIONAL, - LPGUID class OPTIONAL, - PCWSTR Enumerator OPTIONAL) +static LONG +SETUP_CreateDevList( + struct DeviceInfoSet *list, + PCWSTR MachineName OPTIONAL, + CONST GUID *class OPTIONAL, + PCWSTR Enumerator OPTIONAL) { HKEY HKLM = HKEY_LOCAL_MACHINE; HKEY hEnumKey = NULL; @@ -1624,19 +1647,20 @@ return rc; } -static BOOL DestroyDeviceInterface(struct DeviceInterface* deviceInterface) -{ - HeapFree(GetProcessHeap(), 0, deviceInterface); - return TRUE; -} - -static LONG SETUP_CreateInterfaceList( - struct DeviceInfoSet *list, - PCWSTR MachineName, - LPGUID InterfaceGuid, - PCWSTR DeviceInstanceW /* OPTIONAL */, - BOOL OnlyPresentInterfaces - ) +static BOOL +DestroyDeviceInterface( + struct DeviceInterface* deviceInterface) +{ + return HeapFree(GetProcessHeap(), 0, deviceInterface); +} + +static LONG +SETUP_CreateInterfaceList( + struct DeviceInfoSet *list, + PCWSTR MachineName, + CONST GUID *InterfaceGuid, + PCWSTR DeviceInstanceW /* OPTIONAL */, + BOOL OnlyPresentInterfaces) { HKEY hInterfaceKey; /* HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{GUID} */ HKEY hDeviceInstanceKey; /* HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{GUID}\##?#{InstancePath} */ @@ -1861,40 +1885,41 @@ /*********************************************************************** * SetupDiGetClassDevsExW (SETUPAPI.@) */ -HDEVINFO WINAPI SetupDiGetClassDevsExW( - CONST GUID *class OPTIONAL, - LPCWSTR enumstr OPTIONAL, - HWND parent OPTIONAL, - DWORD flags, - HDEVINFO deviceset OPTIONAL, - LPCWSTR machine OPTIONAL, - PVOID reserved) +HDEVINFO WINAPI +SetupDiGetClassDevsExW( + IN CONST GUID *ClassGuid OPTIONAL, + IN PCWSTR Enumerator OPTIONAL, + IN HWND hwndParent OPTIONAL, + IN DWORD Flags, + IN HDEVINFO DeviceInfoSet OPTIONAL, + IN PCWSTR MachineName OPTIONAL, + IN PVOID Reserved) { HDEVINFO hDeviceInfo = INVALID_HANDLE_VALUE; struct DeviceInfoSet *list; - LPGUID pClassGuid; + CONST GUID *pClassGuid; LONG rc; HDEVINFO ret = INVALID_HANDLE_VALUE; - TRACE("%s %s %p 0x%08lx %p %s %p\n", debugstr_guid(class), debugstr_w(enumstr), - parent, flags, deviceset, debugstr_w(machine), reserved); + TRACE("%s %s %p 0x%08lx %p %s %p\n", debugstr_guid(ClassGuid), debugstr_w(Enumerator), + hwndParent, Flags, DeviceInfoSet, debugstr_w(MachineName), Reserved); /* Create the deviceset if not set */ - if (deviceset) - { - list = (struct DeviceInfoSet *)deviceset; + if (DeviceInfoSet) + { + list = (struct DeviceInfoSet *)DeviceInfoSet; if (list->magic != SETUP_DEV_INFO_SET_MAGIC) { SetLastError(ERROR_INVALID_HANDLE); goto cleanup; } - hDeviceInfo = deviceset; + hDeviceInfo = DeviceInfoSet; } else { hDeviceInfo = SetupDiCreateDeviceInfoListExW( - flags & DIGCF_DEVICEINTERFACE ? NULL : class, - NULL, machine, NULL); + Flags & DIGCF_DEVICEINTERFACE ? NULL : ClassGuid, + NULL, MachineName, NULL); if (hDeviceInfo == INVALID_HANDLE_VALUE) goto cleanup; list = (struct DeviceInfoSet *)hDeviceInfo; @@ -1905,12 +1930,12 @@ else pClassGuid = &list->ClassGuid; - if (flags & DIGCF_PROFILE) + if (Flags & DIGCF_PROFILE) FIXME(": flag DIGCF_PROFILE ignored\n"); - if (flags & DIGCF_ALLCLASSES) - { - rc = SETUP_CreateDevList(list, machine, pClassGuid, enumstr); + if (Flags & DIGCF_ALLCLASSES) + { + rc = SETUP_CreateDevList(list, MachineName, pClassGuid, Enumerator); if (rc != ERROR_SUCCESS) { SetLastError(rc); @@ -1918,15 +1943,15 @@ } ret = hDeviceInfo; } - else if (flags & DIGCF_DEVICEINTERFACE) - { - if (class == NULL) + else if (Flags & DIGCF_DEVICEINTERFACE) + { + if (ClassGuid == NULL) { SetLastError(ERROR_INVALID_PARAMETER); goto cleanup; } - rc = SETUP_CreateInterfaceList(list, machine, (LPGUID)class, enumstr, flags & DIGCF_PRESENT); + rc = SETUP_CreateInterfaceList(list, MachineName, ClassGuid, Enumerator, Flags & DIGCF_PRESENT); if (rc != ERROR_SUCCESS) { SetLastError(rc); @@ -1936,7 +1961,7 @@ } else { - rc = SETUP_CreateDevList(list, machine, (LPGUID)class, enumstr); + rc = SETUP_CreateDevList(list, MachineName, ClassGuid, Enumerator); if (rc != ERROR_SUCCESS) { SetLastError(rc); @@ -1946,7 +1971,7 @@ } cleanup: - if (!deviceset && hDeviceInfo != INVALID_HANDLE_VALUE && hDeviceInfo != ret) + if (!DeviceInfoSet && hDeviceInfo != INVALID_HANDLE_VALUE && hDeviceInfo != ret) SetupDiDestroyDeviceInfoList(hDeviceInfo); return ret; } @@ -1955,9 +1980,10 @@ * SetupDiGetClassImageIndex (SETUPAPI.@) */ -static BOOL GetIconIndex( - IN HKEY hClassKey, - OUT PINT ImageIndex) +static BOOL +GetIconIndex( + IN HKEY hClassKey, + OUT PINT ImageIndex) { LPWSTR Buffer = NULL; DWORD dwRegType, dwLength; @@ -1999,10 +2025,11 @@ return ret; } -BOOL WINAPI SetupDiGetClassImageIndex( - IN PSP_CLASSIMAGELIST_DATA ClassImageListData, - IN CONST GUID *ClassGuid, - OUT PINT ImageIndex) +BOOL WINAPI +SetupDiGetClassImageIndex( + IN PSP_CLASSIMAGELIST_DATA ClassImageListData, + IN CONST GUID *ClassGuid, + OUT PINT ImageIndex) { struct ClassImageList *list; BOOL ret = FALSE; @@ -2052,8 +2079,9 @@ /*********************************************************************** * SetupDiGetClassImageList(SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassImageList( - OUT PSP_CLASSIMAGELIST_DATA ClassImageListData) +BOOL WINAPI +SetupDiGetClassImageList( + OUT PSP_CLASSIMAGELIST_DATA ClassImageListData) { return SetupDiGetClassImageListExW(ClassImageListData, NULL, NULL); } @@ -2061,10 +2089,11 @@ /*********************************************************************** * SetupDiGetClassImageListExA(SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassImageListExA( - OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, - IN PCSTR MachineName OPTIONAL, - IN PVOID Reserved) +BOOL WINAPI +SetupDiGetClassImageListExA( + OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, + IN PCSTR MachineName OPTIONAL, + IN PVOID Reserved) { PWSTR MachineNameW = NULL; BOOL ret; @@ -2087,10 +2116,11 @@ /*********************************************************************** * SetupDiGetClassImageListExW(SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassImageListExW( - OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, - IN PCWSTR MachineName OPTIONAL, - IN PVOID Reserved) +BOOL WINAPI +SetupDiGetClassImageListExW( + OUT PSP_CLASSIMAGELIST_DATA ClassImageListData, + IN PCWSTR MachineName OPTIONAL, + IN PVOID Reserved) { BOOL ret = FALSE; @@ -2143,10 +2173,11 @@ /*********************************************************************** * SetupDiLoadClassIcon(SETUPAPI.@) */ -BOOL WINAPI SetupDiLoadClassIcon( - IN CONST GUID *ClassGuid, - OUT HICON *LargeIcon OPTIONAL, - OUT PINT MiniIconIndex OPTIONAL) +BOOL WINAPI +SetupDiLoadClassIcon( + IN CONST GUID *ClassGuid, + OUT HICON *LargeIcon OPTIONAL, + OUT PINT MiniIconIndex OPTIONAL) { BOOL ret = FALSE; @@ -2257,12 +2288,13 @@ /*********************************************************************** * SetupDiEnumDeviceInterfaces (SETUPAPI.@) */ -BOOL WINAPI SetupDiEnumDeviceInterfaces( - HDEVINFO DeviceInfoSet, - PSP_DEVINFO_DATA DeviceInfoData, - CONST GUID * InterfaceClassGuid, - DWORD MemberIndex, - PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) +BOOL WINAPI +SetupDiEnumDeviceInterfaces( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN CONST GUID *InterfaceClassGuid, + IN DWORD MemberIndex, + OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) { BOOL ret = FALSE; @@ -2327,12 +2359,14 @@ return ret; } -static VOID ReferenceInfFile(struct InfFileDetails* infFile) +static VOID +ReferenceInfFile(struct InfFileDetails* infFile) { InterlockedIncrement(&infFile->References); } -static VOID DereferenceInfFile(struct InfFileDetails* infFile) +static VOID +DereferenceInfFile(struct InfFileDetails* infFile) { if (InterlockedDecrement(&infFile->References) == 0) { @@ -2341,7 +2375,8 @@ } } -static BOOL DestroyDriverInfoElement(struct DriverInfoElement* driverInfo) +static BOOL +DestroyDriverInfoElement(struct DriverInfoElement* driverInfo) { DereferenceInfFile(driverInfo->InfFileDetails); HeapFree(GetProcessHeap(), 0, driverInfo->MatchingId); @@ -2349,13 +2384,14 @@ return TRUE; } -static BOOL DestroyClassInstallParams(struct ClassInstallParams* installParams) -{ - HeapFree(GetProcessHeap(), 0, installParams->PropChange); - return TRUE; -} - -static BOOL DestroyDeviceInfoElement(struct DeviceInfoElement* deviceInfo) +static BOOL +DestroyClassInstallParams(struct ClassInstallParams* installParams) +{ + return HeapFree(GetProcessHeap(), 0, installParams->PropChange); +} + +static BOOL +DestroyDeviceInfoElement(struct DeviceInfoElement* deviceInfo) { PLIST_ENTRY ListEntry; struct DriverInfoElement *driverInfo; @@ -2376,11 +2412,11 @@ return FALSE; } DestroyClassInstallParams(&deviceInfo->ClassInstallParams); - HeapFree(GetProcessHeap(), 0, deviceInfo); - return TRUE; -} - -static BOOL DestroyDeviceInfoSet(struct DeviceInfoSet* list) + return HeapFree(GetProcessHeap(), 0, deviceInfo); +} + +static BOOL +DestroyDeviceInfoSet(struct DeviceInfoSet* list) { PLIST_ENTRY ListEntry; struct DeviceInfoElement *deviceInfo; @@ -2396,21 +2432,22 @@ RegCloseKey(list->HKLM); CM_Disconnect_Machine(list->hMachine); DestroyClassInstallParams(&list->ClassInstallParams); - HeapFree(GetProcessHeap(), 0, list); - return TRUE; + return HeapFree(GetProcessHeap(), 0, list); } /*********************************************************************** * SetupDiDestroyDeviceInfoList (SETUPAPI.@) */ -BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo) +BOOL WINAPI +SetupDiDestroyDeviceInfoList( + IN HDEVINFO DeviceInfoSet) { BOOL ret = FALSE; - TRACE("%p\n", devinfo); - if (devinfo && devinfo != (HDEVINFO)INVALID_HANDLE_VALUE) - { - struct DeviceInfoSet *list = (struct DeviceInfoSet *)devinfo; + TRACE("%p\n", DeviceInfoSet); + if (DeviceInfoSet && DeviceInfoSet != (HDEVINFO)INVALID_HANDLE_VALUE) + { + struct DeviceInfoSet *list = (struct DeviceInfoSet *)DeviceInfoSet; if (list->magic == SETUP_DEV_INFO_SET_MAGIC) ret = DestroyDeviceInfoSet(list); @@ -2427,13 +2464,14 @@ /*********************************************************************** * SetupDiGetDeviceInterfaceDetailA (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceInterfaceDetailA( - HDEVINFO DeviceInfoSet, - PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, - PSP_DEVICE_INTERFACE_DETAIL_DATA_A DeviceInterfaceDetailData, - DWORD DeviceInterfaceDetailDataSize, - PDWORD RequiredSize, - PSP_DEVINFO_DATA DeviceInfoData) +BOOL WINAPI +SetupDiGetDeviceInterfaceDetailA( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, + OUT PSP_DEVICE_INTERFACE_DETAIL_DATA_A DeviceInterfaceDetailData OPTIONAL, + IN DWORD DeviceInterfaceDetailDataSize, + OUT PDWORD RequiredSize OPTIONAL, + OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) { PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailDataW = NULL; DWORD sizeW = 0, sizeA; @@ -2497,13 +2535,14 @@ /*********************************************************************** * SetupDiGetDeviceInterfaceDetailW (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceInterfaceDetailW( - HDEVINFO DeviceInfoSet, - PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, - PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData, - DWORD DeviceInterfaceDetailDataSize, - PDWORD RequiredSize, - PSP_DEVINFO_DATA DeviceInfoData) +BOOL WINAPI +SetupDiGetDeviceInterfaceDetailW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, + OUT PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData OPTIONAL, + IN DWORD DeviceInterfaceDetailDataSize, + OUT PDWORD RequiredSize OPTIONAL, + OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) { BOOL ret = FALSE; @@ -2563,31 +2602,40 @@ /*********************************************************************** * SetupDiGetDeviceRegistryPropertyA (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceRegistryPropertyA( - HDEVINFO devinfo, - PSP_DEVINFO_DATA DeviceInfoData, - DWORD Property, - PDWORD PropertyRegDataType, - PBYTE PropertyBuffer, - DWORD PropertyBufferSize, - PDWORD RequiredSize) +BOOL WINAPI +SetupDiGetDeviceRegistryPropertyA( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData, + IN DWORD Property, + OUT PDWORD PropertyRegDataType OPTIONAL, + OUT PBYTE PropertyBuffer OPTIONAL, + IN DWORD PropertyBufferSize, + OUT PDWORD RequiredSize OPTIONAL) { BOOL bResult; BOOL bIsStringProperty; DWORD RegType; DWORD RequiredSizeA, RequiredSizeW; - DWORD PropertyBufferSizeW; - PBYTE PropertyBufferW; - - TRACE("%p %p %ld %p %p %ld %p\n", devinfo, DeviceInfoData, + DWORD PropertyBufferSizeW = 0; + PBYTE PropertyBufferW = NULL; + + TRACE("%p %p %ld %p %p %ld %p\n", DeviceInfoSet, DeviceInfoData, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize); - PropertyBufferSizeW = PropertyBufferSize * 2; - PropertyBufferW = HeapAlloc(GetProcessHeap(), 0, PropertyBufferSizeW); + if (PropertyBufferSize != 0) + { + PropertyBufferSizeW = PropertyBufferSize * 2; + PropertyBufferW = HeapAlloc(GetProcessHeap(), 0, PropertyBufferSizeW); + if (!PropertyBufferW) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + } bResult = SetupDiGetDeviceRegistryPropertyW( - devinfo, + DeviceInfoSet, DeviceInfoData, Property, &RegType, @@ -2641,14 +2689,15 @@ /*********************************************************************** * SetupDiGetDeviceRegistryPropertyW (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceRegistryPropertyW( - HDEVINFO DeviceInfoSet, - PSP_DEVINFO_DATA DeviceInfoData, - DWORD Property, - PDWORD PropertyRegDataType, - PBYTE PropertyBuffer, - DWORD PropertyBufferSize, - PDWORD RequiredSize) +BOOL WINAPI +SetupDiGetDeviceRegistryPropertyW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData, + IN DWORD Property, + OUT PDWORD PropertyRegDataType OPTIONAL, + OUT PBYTE PropertyBuffer OPTIONAL, + IN DWORD PropertyBufferSize, + OUT PDWORD RequiredSize OPTIONAL) { HKEY hEnumKey, hKey; DWORD rc; @@ -2839,12 +2888,13 @@ /*********************************************************************** * SetupDiSetDeviceRegistryPropertyA (SETUPAPI.@) */ -BOOL WINAPI SetupDiSetDeviceRegistryPropertyA( - IN HDEVINFO DeviceInfoSet, - IN OUT PSP_DEVINFO_DATA DeviceInfoData, - IN DWORD Property, - IN CONST BYTE *PropertyBuffer, - IN DWORD PropertyBufferSize) +BOOL WINAPI +SetupDiSetDeviceRegistryPropertyA( + IN HDEVINFO DeviceInfoSet, + IN OUT PSP_DEVINFO_DATA DeviceInfoData, + IN DWORD Property, + IN CONST BYTE *PropertyBuffer OPTIONAL, + IN DWORD PropertyBufferSize) { FIXME("%p %p 0x%lx %p 0x%lx\n", DeviceInfoSet, DeviceInfoData, Property, PropertyBuffer, PropertyBufferSize); @@ -2855,12 +2905,13 @@ /*********************************************************************** * SetupDiSetDeviceRegistryPropertyW (SETUPAPI.@) */ -BOOL WINAPI SetupDiSetDeviceRegistryPropertyW( - IN HDEVINFO DeviceInfoSet, - IN OUT PSP_DEVINFO_DATA DeviceInfoData, - IN DWORD Property, - IN const BYTE *PropertyBuffer, - IN DWORD PropertyBufferSize) +BOOL WINAPI +SetupDiSetDeviceRegistryPropertyW( + IN HDEVINFO DeviceInfoSet, + IN OUT PSP_DEVINFO_DATA DeviceInfoData, + IN DWORD Property, + IN CONST BYTE *PropertyBuffer OPTIONAL, + IN DWORD PropertyBufferSize) { struct DeviceInfoSet *list; BOOL ret = FALSE; @@ -2989,11 +3040,12 @@ /*********************************************************************** * SetupDiInstallClassA (SETUPAPI.@) */ -BOOL WINAPI SetupDiInstallClassA( - IN HWND hwndParent OPTIONAL, - IN PCSTR InfFileName, - IN DWORD Flags, - IN HSPFILEQ FileQueue OPTIONAL) +BOOL WINAPI +SetupDiInstallClassA( + IN HWND hwndParent OPTIONAL, + IN PCSTR InfFileName, + IN DWORD Flags, + IN HSPFILEQ FileQueue OPTIONAL) { return SetupDiInstallClassExA(hwndParent, InfFileName, Flags, FileQueue, NULL, NULL, NULL); } @@ -3002,11 +3054,12 @@ /*********************************************************************** * SetupDiInstallClassW (SETUPAPI.@) */ -BOOL WINAPI SetupDiInstallClassW( - IN HWND hwndParent OPTIONAL, - IN PCWSTR InfFileName, - IN DWORD Flags, - IN HSPFILEQ FileQueue OPTIONAL) +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); } @@ -3015,14 +3068,15 @@ /*********************************************************************** * 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) +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; @@ -3046,7 +3100,8 @@ } -static HKEY CreateClassKey(HINF hInf) +static HKEY +CreateClassKey(HINF hInf) { WCHAR FullBuffer[MAX_PATH]; WCHAR Buffer[MAX_PATH]; @@ -3119,14 +3174,15 @@ /*********************************************************************** * SetupDiInstallClassExW (SETUPAPI.@) */ -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) +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) { BOOL ret = FALSE; @@ -3278,9 +3334,10 @@ /*********************************************************************** * SetupDiOpenClassRegKey (SETUPAPI.@) */ -HKEY WINAPI SetupDiOpenClassRegKey( - const GUID* ClassGuid, - REGSAM samDesired) +HKEY WINAPI +SetupDiOpenClassRegKey( + IN CONST GUID *ClassGuid OPTIONAL, + IN REGSAM samDesired) { return SetupDiOpenClassRegKeyExW(ClassGuid, samDesired, DIOCR_INSTALLER, NULL, NULL); @@ -3290,12 +3347,13 @@ /*********************************************************************** * SetupDiOpenClassRegKeyExA (SETUPAPI.@) */ -HKEY WINAPI SetupDiOpenClassRegKeyExA( - const GUID* ClassGuid OPTIONAL, - REGSAM samDesired, - DWORD Flags, - PCSTR MachineName OPTIONAL, - PVOID Reserved) +HKEY WINAPI +SetupDiOpenClassRegKeyExA( + IN CONST GUID *ClassGuid OPTIONAL, + IN REGSAM samDesired, + IN DWORD Flags, + IN PCSTR MachineName OPTIONAL, + IN PVOID Reserved) { PWSTR MachineNameW = NULL; HKEY hKey; @@ -3322,12 +3380,13 @@ /*********************************************************************** * SetupDiOpenClassRegKeyExW (SETUPAPI.@) */ -HKEY WINAPI SetupDiOpenClassRegKeyExW( - const GUID* ClassGuid OPTIONAL, - REGSAM samDesired, - DWORD Flags, - PCWSTR MachineName OPTIONAL, - PVOID Reserved) +HKEY WINAPI +SetupDiOpenClassRegKeyExW( + IN CONST GUID* ClassGuid OPTIONAL, + IN REGSAM samDesired, + IN DWORD Flags, + IN PCWSTR MachineName OPTIONAL, + IN PVOID Reserved) { LPWSTR lpGuidString = NULL; LPWSTR lpFullGuidString = NULL; @@ -3430,11 +3489,12 @@ /*********************************************************************** * SetupDiOpenDeviceInterfaceW (SETUPAPI.@) */ -BOOL WINAPI SetupDiOpenDeviceInterfaceW( - HDEVINFO DeviceInfoSet, - PCWSTR DevicePath, - DWORD OpenFlags, - PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) +BOOL WINAPI +SetupDiOpenDeviceInterfaceW( + IN HDEVINFO DeviceInfoSet, + IN PCWSTR DevicePath, + IN DWORD OpenFlags, + OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData OPTIONAL) { FIXME("%p %s %08lx %p\n", DeviceInfoSet, debugstr_w(DevicePath), OpenFlags, DeviceInterfaceData); @@ -3444,11 +3504,12 @@ /*********************************************************************** * SetupDiOpenDeviceInterfaceA (SETUPAPI.@) */ -BOOL WINAPI SetupDiOpenDeviceInterfaceA( - HDEVINFO DeviceInfoSet, - PCSTR DevicePath, - DWORD OpenFlags, - PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) +BOOL WINAPI +SetupDiOpenDeviceInterfaceA( + IN HDEVINFO DeviceInfoSet, + IN PCSTR DevicePath, + IN DWORD OpenFlags, + OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData OPTIONAL) { LPWSTR DevicePathW = NULL; BOOL bResult; @@ -3470,11 +3531,12 @@ /*********************************************************************** * SetupDiSetClassInstallParamsA (SETUPAPI.@) */ -BOOL WINAPI SetupDiSetClassInstallParamsA( - HDEVINFO DeviceInfoSet, - PSP_DEVINFO_DATA DeviceInfoData, - PSP_CLASSINSTALL_HEADER ClassInstallParams, - DWORD ClassInstallParamsSize) +BOOL WINAPI +SetupDiSetClassInstallParamsA( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, + IN DWORD ClassInstallParamsSize) { FIXME("%p %p %x %lu\n",DeviceInfoSet, DeviceInfoData, ClassInstallParams->InstallFunction, ClassInstallParamsSize); @@ -3484,11 +3546,12 @@ /*********************************************************************** * SetupDiSetClassInstallParamsW (SETUPAPI.@) */ -BOOL WINAPI SetupDiSetClassInstallParamsW( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, - IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, - IN DWORD ClassInstallParamsSize) +BOOL WINAPI +SetupDiSetClassInstallParamsW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, + IN DWORD ClassInstallParamsSize) { struct DeviceInfoSet *list; BOOL ret = FALSE; @@ -3553,11 +3616,12 @@ return ret; } -static BOOL PropertyChangeHandler( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData, - IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, - IN DWORD ClassInstallParamsSize) +static BOOL +PropertyChangeHandler( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData, + IN PSP_CLASSINSTALL_HEADER ClassInstallParams OPTIONAL, + IN DWORD ClassInstallParamsSize) { PSP_PROPCHANGE_PARAMS PropChangeParams = (PSP_PROPCHANGE_PARAMS)ClassInstallParams; BOOL ret = FALSE; @@ -3614,9 +3678,9 @@ static DWORD GetFunctionPointer( - IN PWSTR InstallerName, - OUT HMODULE* ModulePointer, - OUT PVOID* FunctionPointer) + IN PWSTR InstallerName, + OUT HMODULE* ModulePointer, + OUT PVOID* FunctionPointer) { HMODULE hModule = NULL; LPSTR FunctionNameA = NULL; @@ -3675,8 +3739,8 @@ static DWORD FreeFunctionPointer( - IN HMODULE ModulePointer, - IN PVOID FunctionPointer) + IN HMODULE ModulePointer, + IN PVOID FunctionPointer) { if (ModulePointer == NULL) return ERROR_SUCCESS; @@ -3697,10 +3761,11 @@ /*********************************************************************** * SetupDiCallClassInstaller (SETUPAPI.@) */ -BOOL WINAPI SetupDiCallClassInstaller( - IN DI_FUNCTION InstallFunction, - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) +BOOL WINAPI +SetupDiCallClassInstaller( + IN DI_FUNCTION InstallFunction, + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) { BOOL ret = FALSE; @@ -4052,9 +4117,10 @@ /*********************************************************************** * SetupDiGetDeviceInfoListClass (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceInfoListClass( - IN HDEVINFO DeviceInfoSet, - OUT LPGUID ClassGuid) +BOOL WINAPI +SetupDiGetDeviceInfoListClass( + IN HDEVINFO DeviceInfoSet, + OUT LPGUID ClassGuid) { struct DeviceInfoSet *list; BOOL ret = FALSE; @@ -4081,9 +4147,10 @@ /*********************************************************************** * SetupDiGetDeviceInfoListDetailW (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceInfoListDetailW( - IN HDEVINFO DeviceInfoSet, - OUT PSP_DEVINFO_LIST_DETAIL_DATA_W DeviceInfoListDetailData) +BOOL WINAPI +SetupDiGetDeviceInfoListDetailW( + IN HDEVINFO DeviceInfoSet, + OUT PSP_DEVINFO_LIST_DETAIL_DATA_W DeviceInfoListDetailData) { struct DeviceInfoSet *list; BOOL ret = FALSE; @@ -4120,10 +4187,11 @@ /*********************************************************************** * SetupDiGetDeviceInstallParamsA (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceInstallParamsA( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, - OUT PSP_DEVINSTALL_PARAMS_A DeviceInstallParams) +BOOL WINAPI +SetupDiGetDeviceInstallParamsA( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + OUT PSP_DEVINSTALL_PARAMS_A DeviceInstallParams) { SP_DEVINSTALL_PARAMS_W deviceInstallParamsW; BOOL ret = FALSE; @@ -4162,10 +4230,11 @@ /*********************************************************************** * SetupDiGetDeviceInstallParamsW (SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceInstallParamsW( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, - OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams) +BOOL WINAPI +SetupDiGetDeviceInstallParamsW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams) { struct DeviceInfoSet *list; BOOL ret = FALSE; @@ -4200,7 +4269,7 @@ static BOOL CheckDeviceInstallParameters( - IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams) + IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams) { DWORD SupportedFlags = DI_NOVCP | /* 0x00000008 */ @@ -4255,10 +4324,11 @@ /*********************************************************************** * SetupDiSetDeviceInstallParamsW (SETUPAPI.@) */ -BOOL WINAPI SetupDiSetDeviceInstallParamsW( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData, - IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams) +BOOL WINAPI +SetupDiSetDeviceInstallParamsW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams) { struct DeviceInfoSet *list; BOOL ret = FALSE; @@ -4294,12 +4364,13 @@ /*********************************************************************** * SetupDiGetDeviceInstanceIdA(SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceInstanceIdA( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData, - OUT PSTR DeviceInstanceId OPTIONAL, - IN DWORD DeviceInstanceIdSize, - OUT PDWORD RequiredSize OPTIONAL) +BOOL WINAPI +SetupDiGetDeviceInstanceIdA( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData, + OUT PSTR DeviceInstanceId OPTIONAL, + IN DWORD DeviceInstanceIdSize, + OUT PDWORD RequiredSize OPTIONAL) { PWSTR DeviceInstanceIdW = NULL; BOOL ret = FALSE; @@ -4340,12 +4411,13 @@ /*********************************************************************** * SetupDiGetDeviceInstanceIdW(SETUPAPI.@) */ -BOOL WINAPI SetupDiGetDeviceInstanceIdW( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData, - OUT PWSTR DeviceInstanceId OPTIONAL, - IN DWORD DeviceInstanceIdSize, - OUT PDWORD RequiredSize OPTIONAL) +BOOL WINAPI +SetupDiGetDeviceInstanceIdW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData, + OUT PWSTR DeviceInstanceId OPTIONAL, + IN DWORD DeviceInstanceIdSize, + OUT PDWORD RequiredSize OPTIONAL) { BOOL ret = FALSE; @@ -4389,13 +4461,14 @@ /*********************************************************************** * SetupDiGetClassDevPropertySheetsA(SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassDevPropertySheetsA( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, - IN LPPROPSHEETHEADERA PropertySheetHeader, - IN DWORD PropertySheetHeaderPageListSize, - OUT PDWORD RequiredSize OPTIONAL, - IN DWORD PropertySheetType) +BOOL WINAPI +SetupDiGetClassDevPropertySheetsA( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN LPPROPSHEETHEADERA PropertySheetHeader, + IN DWORD PropertySheetHeaderPageListSize, + OUT PDWORD RequiredSize OPTIONAL, + IN DWORD PropertySheetType) { PROPSHEETHEADERW psh; BOOL ret = FALSE; @@ -4427,9 +4500,10 @@ DWORD NumberOfPages; }; -static BOOL WINAPI GetClassDevPropertySheetsCallback( - IN HPROPSHEETPAGE hPropSheetPage, - IN OUT LPARAM lParam) +static BOOL WINAPI +GetClassDevPropertySheetsCallback( + IN HPROPSHEETPAGE hPropSheetPage, + IN OUT LPARAM lParam) { struct ClassDevPropertySheetsData *PropPageData; @@ -4448,13 +4522,14 @@ /*********************************************************************** * SetupDiGetClassDevPropertySheetsW(SETUPAPI.@) */ -BOOL WINAPI SetupDiGetClassDevPropertySheetsW( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, - IN OUT LPPROPSHEETHEADERW PropertySheetHeader, - IN DWORD PropertySheetHeaderPageListSize, - OUT PDWORD RequiredSize OPTIONAL, - IN DWORD PropertySheetType) +BOOL WINAPI +SetupDiGetClassDevPropertySheetsW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN OUT LPPROPSHEETHEADERW PropertySheetHeader, + IN DWORD PropertySheetHeaderPageListSize, + OUT PDWORD RequiredSize OPTIONAL, + IN DWORD PropertySheetType) { struct DeviceInfoSet *list; BOOL ret = FALSE; @@ -4579,14 +4654,15 @@ /*********************************************************************** * SetupDiCreateDevRegKeyA (SETUPAPI.@) */ -HKEY WINAPI SetupDiCreateDevRegKeyA( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData, - IN DWORD Scope, - IN DWORD HwProfile, - IN DWORD KeyType, - IN HINF InfHandle OPTIONAL, - IN PCSTR InfSectionName OPTIONAL) +HKEY WINAPI +SetupDiCreateDevRegKeyA( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData, + IN DWORD Scope, + IN DWORD HwProfile, + IN DWORD KeyType, + IN HINF InfHandle OPTIONAL, + IN PCSTR InfSectionName OPTIONAL) { PCWSTR InfSectionNameW = NULL; HKEY ret = INVALID_HANDLE_VALUE; @@ -4613,9 +4689,9 @@ static HKEY OpenHardwareProfileKey( - IN HKEY HKLM, - IN DWORD HwProfile, - IN DWORD samDesired) + IN HKEY HKLM, + IN DWORD HwProfile, + IN DWORD samDesired) { HKEY hHWProfilesKey = NULL; HKEY hHWProfileKey = NULL; @@ -4671,14 +4747,15 @@ /*********************************************************************** * SetupDiCreateDevRegKeyW (SETUPAPI.@) */ -HKEY WINAPI SetupDiCreateDevRegKeyW( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData, - IN DWORD Scope, - IN DWORD HwProfile, - IN DWORD KeyType, - IN HINF InfHandle OPTIONAL, - IN PCWSTR InfSectionName OPTIONAL) +HKEY WINAPI +SetupDiCreateDevRegKeyW( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData, + IN DWORD Scope, + IN DWORD HwProfile, + IN DWORD KeyType, + IN HINF InfHandle OPTIONAL, + IN PCWSTR InfSectionName OPTIONAL) { struct DeviceInfoSet *list; HKEY ret = INVALID_HANDLE_VALUE; @@ -4871,13 +4948,14 @@ /*********************************************************************** * SetupDiOpenDevRegKey (SETUPAPI.@) */ -HKEY WINAPI SetupDiOpenDevRegKey( - HDEVINFO DeviceInfoSet, - PSP_DEVINFO_DATA DeviceInfoData, - DWORD Scope, - DWORD HwProfile, - DWORD KeyType, - REGSAM samDesired) +HKEY WINAPI +SetupDiOpenDevRegKey( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DeviceInfoData, + IN DWORD Scope, + IN DWORD HwProfile, + IN DWORD KeyType, + IN REGSAM samDesired) { struct DeviceInfoSet *list; HKEY ret = INVALID_HANDLE_VALUE; @@ -5016,14 +5094,15 @@ /*********************************************************************** * SetupDiCreateDeviceInfoA (SETUPAPI.@) */ -BOOL WINAPI SetupDiCreateDeviceInfoA( - HDEVINFO DeviceInfoSet, - PCSTR DeviceName, - CONST GUID *ClassGuid, - PCSTR DeviceDescription, - HWND hwndParent, - DWORD CreationFlags, - PSP_DEVINFO_DATA DeviceInfoData) +BOOL WINAPI +SetupDiCreateDeviceInfoA( + IN HDEVINFO DeviceInfoSet, + IN PCSTR DeviceName, + IN CONST GUID *ClassGuid, + IN PCSTR DeviceDescription OPTIONAL, + IN HWND hwndParent OPTIONAL, + IN DWORD CreationFlags, + OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) { LPWSTR DeviceNameW = NULL; LPWSTR DeviceDescriptionW = NULL; @@ -5060,14 +5139,15 @@ /*********************************************************************** * SetupDiCreateDeviceInfoW (SETUPAPI.@) */ -BOOL WINAPI SetupDiCreateDeviceInfoW( - HDEVINFO DeviceInfoSet, - PCWSTR DeviceName, - CONST GUID *ClassGuid, - PCWSTR DeviceDescription, - HWND hwndParent, - DWORD CreationFlags, - PSP_DEVINFO_DATA DeviceInfoData) +BOOL WINAPI +SetupDiCreateDeviceInfoW( + IN HDEVINFO DeviceInfoSet, + IN PCWSTR DeviceName, + IN CONST GUID *ClassGuid, + IN PCWSTR DeviceDescription OPTIONAL, + IN HWND hwndParent OPTIONAL, + IN DWORD CreationFlags, + OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) { struct DeviceInfoSet *list; BOOL ret = FALSE; @@ -5570,7 +5650,7 @@ BOOL WINAPI SetupDiBuildDriverInfoList( IN HDEVINFO DeviceInfoSet, - IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType) { struct DeviceInfoSet *list; @@ -5993,7 +6073,7 @@ BOOL WINAPI SetupDiDestroyDriverInfoList( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType) { struct DeviceInfoSet *list; @@ -6080,7 +6160,7 @@ IN PCSTR DeviceInstanceId, IN HWND hwndParent OPTIONAL, IN DWORD OpenFlags, - OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) + OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) { LPWSTR DeviceInstanceIdW = NULL; BOOL bResult; @@ -6109,7 +6189,7 @@ IN PCWSTR DeviceInstanceId, IN HWND hwndParent OPTIONAL, IN DWORD OpenFlags, - OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) + OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) { struct DeviceInfoSet *list; HKEY hEnumKey, hKey = NULL; @@ -6218,7 +6298,7 @@ BOOL WINAPI SetupDiEnumDriverInfoA( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType, IN DWORD MemberIndex, OUT PSP_DRVINFO_DATA_A DriverInfoData) @@ -6282,7 +6362,7 @@ BOOL WINAPI SetupDiEnumDriverInfoW( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType, IN DWORD MemberIndex, OUT PSP_DRVINFO_DATA_W DriverInfoData) @@ -6386,7 +6466,7 @@ BOOL WINAPI SetupDiGetSelectedDriverA( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DRVINFO_DATA_A DriverInfoData) { SP_DRVINFO_DATA_V2_W driverInfoData2W; @@ -6446,7 +6526,7 @@ BOOL WINAPI SetupDiGetSelectedDriverW( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DRVINFO_DATA_W DriverInfoData) { BOOL ret = FALSE; @@ -6530,8 +6610,8 @@ BOOL WINAPI SetupDiSetSelectedDriverA( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, - IN OUT PSP_DRVINFO_DATA_A DriverInfoData OPTIONAL) + IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN OUT PSP_DRVINFO_DATA_A DriverInfoData OPTIONAL) { SP_DRVINFO_DATA_V1_W DriverInfoDataW; PSP_DRVINFO_DATA_W pDriverInfoDataW = NULL; @@ -6593,8 +6673,8 @@ BOOL WINAPI SetupDiSetSelectedDriverW( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, - IN OUT PSP_DRVINFO_DATA_W DriverInfoData OPTIONAL) + IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN OUT PSP_DRVINFO_DATA_W DriverInfoData OPTIONAL) { BOOL ret = FALSE; @@ -6680,11 +6760,11 @@ BOOL WINAPI SetupDiGetDriverInfoDetailA( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DRVINFO_DATA_A DriverInfoData, - OUT PSP_DRVINFO_DETAIL_DATA_A DriverInfoDetailData OPTIONAL, + IN OUT PSP_DRVINFO_DETAIL_DATA_A DriverInfoDetailData OPTIONAL, IN DWORD DriverInfoDetailDataSize, - OUT PDWORD RequiredSize OPTIONAL) + OUT PDWORD RequiredSize OPTIONAL) { SP_DRVINFO_DATA_V2_W DriverInfoDataW; PSP_DRVINFO_DETAIL_DATA_W DriverInfoDetailDataW = NULL; @@ -6881,11 +6961,11 @@ BOOL WINAPI SetupDiGetDriverInfoDetailW( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, + IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DRVINFO_DATA_W DriverInfoData, - OUT PSP_DRVINFO_DETAIL_DATA_W DriverInfoDetailData OPTIONAL, + IN OUT PSP_DRVINFO_DETAIL_DATA_W DriverInfoDetailData OPTIONAL, IN DWORD DriverInfoDetailDataSize, - OUT PDWORD RequiredSize OPTIONAL) + OUT PDWORD RequiredSize OPTIONAL) { BOOL ret = FALSE; @@ -7093,7 +7173,7 @@ BOOL WINAPI SetupDiChangeState( IN HDEVINFO DeviceInfoSet, - IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) + IN OUT PSP_DEVINFO_DATA DeviceInfoData) { PSP_PROPCHANGE_PARAMS PropChange; HKEY hKey = INVALID_HANDLE_VALUE; @@ -7205,7 +7285,7 @@ BOOL WINAPI SetupDiSelectBestCompatDrv( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData) + IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) { SP_DRVINFO_DATA_W drvInfoData; BOOL ret; @@ -7241,7 +7321,7 @@ BOOL WINAPI SetupDiInstallDriverFiles( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) + IN PSP_DEVINFO_DATA DeviceInfoData) { BOOL ret = FALSE; @@ -7573,7 +7653,7 @@ return ret; } -BOOL +static BOOL InfIsFromOEMLocation( IN PCWSTR FullName, OUT LPBOOL IsOEMLocation) @@ -7618,7 +7698,7 @@ BOOL WINAPI SetupDiInstallDevice( IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DeviceInfoData) + IN OUT PSP_DEVINFO_DATA DeviceInfoData) { SP_DEVINSTALL_PARAMS_W InstallParams; struct DriverInfoElement *SelectedDriver;
18 years, 7 months
1
0
0
0
[janderwald] 21858: fix msvc build bug with project having assemblers
by janderwald@svn.reactos.org
Author: janderwald Date: Tue May 9 00:13:29 2006 New Revision: 21858 URL:
http://svn.reactos.ru/svn/reactos?rev=21858&view=rev
Log: fix msvc build bug with project having assemblers Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/m…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp (original) +++ trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp Tue May 9 00:13:29 2006 @@ -344,7 +344,6 @@ out.push_back ( cfgs[i] + "\\" + module.name + ".lib" ); out.push_back ( cfgs[i] + "\\" + module.name + ".exp" ); out.push_back ( cfgs[i] + "\\" + module.name + ".ilk" ); - out.push_back ( cfgs[i] + "\\" + "(InputName).obj" ); //MSVC2003 build bug } } Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/v…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp (original) +++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Tue May 9 00:13:29 2006 @@ -517,13 +517,13 @@ if (source_file.find(".idl") != string::npos) { fprintf ( OUT, "\t\t\t\t\t\tName=\"VCCustomBuildTool\"\r\n" ); - fprintf ( OUT, "\t\t\t\t\t\tOutputs=\"$(OutDir)\\(InputName).obj\"/>\r\n" ); + fprintf ( OUT, "\t\t\t\t\t\tOutputs=\"$(OutDir)\\$(InputName).obj\"/>\r\n" ); } else if ((source_file.find(".asm") != string::npos || tolower(source_file.at(source_file.size() - 1)) == 's')) { fprintf ( OUT, "\t\t\t\t\t\tName=\"VCCustomBuildTool\"\r\n" ); - fprintf ( OUT, "\t\t\t\t\t\tCommandLine=\"cl /E "$(InputPath)" %s /D__ASM__ | as -o "$(OutDir)\\(InputName).obj"\"\r\n",include_string.c_str() ); - fprintf ( OUT, "\t\t\t\t\t\tOutputs=\"$(OutDir)\\(InputName).obj\"/>\r\n" ); + fprintf ( OUT, "\t\t\t\t\t\tCommandLine=\"cl /E "$(InputPath)" %s /D__ASM__ | as -o "$(OutDir)\\$(InputName).obj"\"\r\n",include_string.c_str() ); + fprintf ( OUT, "\t\t\t\t\t\tOutputs=\"$(OutDir)\\$(InputName).obj\"/>\r\n" ); } fprintf ( OUT, "\t\t\t\t</FileConfiguration>\r\n" ); }
18 years, 7 months
1
0
0
0
[arty] 21857: Sorry, reverted my changes. I didn't realize other work was going on in here.
by arty@svn.reactos.org
Author: arty Date: Mon May 8 22:16:44 2006 New Revision: 21857 URL:
http://svn.reactos.ru/svn/reactos?rev=21857&view=rev
Log: Sorry, reverted my changes. I didn't realize other work was going on in here. Modified: trunk/reactos/dll/cpl/ncpa/ncpa.c trunk/reactos/dll/cpl/ncpa/tcpip_properties.c Modified: trunk/reactos/dll/cpl/ncpa/ncpa.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/ncpa/ncpa.c?rev=218…
============================================================================== --- trunk/reactos/dll/cpl/ncpa/ncpa.c (original) +++ trunk/reactos/dll/cpl/ncpa/ncpa.c Mon May 8 22:16:44 2006 @@ -322,24 +322,22 @@ if(_tcscmp(tpszTCPIPClsID,tpszClsIDText)==0) { - IP_ADAPTER_INFO *Adapters = LocalAlloc( LMEM_FIXED, sizeof(IP_ADAPTER_INFO) * 64 ); + IP_ADAPTER_INFO Adapters[64]; IP_ADAPTER_INFO *pAdapter; TCHAR *tpszCfgInstanceID; - DWORD dwSize = sizeof(*Adapters) * 64; - memset(Adapters,0x00,dwSize); + DWORD dwSize = sizeof(Adapters); + memset(&Adapters,0x00,sizeof(Adapters)); if(GetAdaptersInfo(Adapters,&dwSize)!=ERROR_SUCCESS) - break; + break;; pAdapter = Adapters; tpszCfgInstanceID = (TCHAR*)pPage->lParam; while(pAdapter) { - TCHAR tpszAdatperName[MAX_PATH]; - swprintf(tpszAdatperName,L"%S",pAdapter->AdapterName); - DPRINT("IPHLPAPI returned: %S\n", tpszAdatperName); - if(_tcscmp(tpszAdatperName,tpszCfgInstanceID)==0) + TCHAR tpszAdatperName[MAX_PATH]; + swprintf(tpszAdatperName,L"%S",pAdapter->AdapterName); + DPRINT("IPHLPAPI returned: %S\n", tpszAdatperName); + if(_tcscmp(tpszAdatperName,tpszCfgInstanceID)==0) { - memcpy(Adapters,pAdapter,sizeof(*pAdapter)); - pAdapter = Adapters; DisplayTCPIPProperties(hwndDlg,pAdapter); break; } else Modified: trunk/reactos/dll/cpl/ncpa/tcpip_properties.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/ncpa/tcpip_properti…
============================================================================== --- trunk/reactos/dll/cpl/ncpa/tcpip_properties.c (original) +++ trunk/reactos/dll/cpl/ncpa/tcpip_properties.c Mon May 8 22:16:44 2006 @@ -1,29 +1,10 @@ /* - * ReactOS - * Copyright (C) 2004 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * PROJECT: ReactOS Network Control Panel - * FILE: lib/cpl/system/tcpip_properties.c - * PURPOSE: ReactOS Network Control Panel - * PROGRAMMER: Gero Kuehn (reactos.filter(a)gkware.com) - * UPDATE HISTORY: - * 08-15-2004 Created + * PROJECT: ReactOS Network Control Panel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: lib/cpl/system/tcpip_properties.c + * PURPOSE: ReactOS Network Control Panel + * COPYRIGHT: Copyright 2004 Gero Kuehn (reactos.filter(a)gkware.com) + * Copyright 2006 Ge van Geldorp <gvg(a)reactos.org> */ #include <stdlib.h> @@ -49,263 +30,368 @@ #endif - #include "resource.h" #include "ncpa.h" -extern void InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPARAM lParam); - -void EnableDHCP( HWND hwndDlg, BOOL Enabled ) { - CheckDlgButton(hwndDlg,IDC_USEDHCP,Enabled ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg,IDC_NODHCP,Enabled ? BST_UNCHECKED : BST_CHECKED); -} - -void ManualDNS( HWND hwndDlg, BOOL Enabled ) { - CheckDlgButton(hwndDlg,IDC_FIXEDDNS,Enabled ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg,IDC_AUTODNS,Enabled ? BST_UNCHECKED : BST_CHECKED); - EnableWindow(GetDlgItem(hwndDlg,IDC_DNS1),Enabled); - EnableWindow(GetDlgItem(hwndDlg,IDC_DNS2),Enabled); -} - -BOOL GetAddressFromField( HWND hwndDlg, UINT CtlId, - DWORD *dwIPAddr, - const char **AddressString ) { - LRESULT lResult; - struct in_addr inIPAddr; - - *AddressString = NULL; - - lResult = SendMessage(GetDlgItem(hwndDlg, IDC_IPADDR), IPM_GETADDRESS, 0, - (ULONG_PTR)dwIPAddr); - if( lResult != 4 ) return FALSE; +#define NDEBUG +#include <debug.h> + +typedef struct _TCPIP_PROPERTIES_DATA { + DWORD AdapterIndex; + char *AdapterName; + BOOL DhcpEnabled; + DWORD IpAddress; + DWORD SubnetMask; + DWORD Gateway; + DWORD Dns1; + DWORD Dns2; + BOOL OldDhcpEnabled; + DWORD OldIpAddress; + DWORD OldSubnetMask; + DWORD OldGateway; + DWORD OldDns1; + DWORD OldDns2; +} TCPIP_PROPERTIES_DATA, *PTCPIP_PROPERTIES_DATA; + +void InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc); +DWORD APIENTRY DhcpNotifyConfigChange(LPWSTR ServerName, LPWSTR AdapterName, + BOOL NewIpAddress, DWORD IpIndex, + DWORD IpAddress, DWORD SubnetMask, + int DhcpAction); + + +static void +ManualDNS(HWND Dlg, BOOL Enabled) { + CheckDlgButton(Dlg, IDC_FIXEDDNS, + Enabled ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(Dlg, IDC_AUTODNS, + Enabled ? BST_UNCHECKED : BST_CHECKED); + EnableWindow(GetDlgItem(Dlg, IDC_DNS1), Enabled); + EnableWindow(GetDlgItem(Dlg, IDC_DNS2), Enabled); + if (! Enabled) { + SendDlgItemMessage(Dlg, IDC_DNS1, IPM_CLEARADDRESS, 0, 0); + SendDlgItemMessage(Dlg, IDC_DNS2, IPM_CLEARADDRESS, 0, 0); + } +} + +static void +EnableDHCP(HWND Dlg, BOOL Enabled) { + CheckDlgButton(Dlg, IDC_USEDHCP, Enabled ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(Dlg, IDC_NODHCP, Enabled ? BST_UNCHECKED : BST_CHECKED); + EnableWindow(GetDlgItem(Dlg, IDC_IPADDR), ! Enabled); + EnableWindow(GetDlgItem(Dlg, IDC_SUBNETMASK), ! Enabled); + EnableWindow(GetDlgItem(Dlg, IDC_DEFGATEWAY), ! Enabled); + EnableWindow(GetDlgItem(Dlg, IDC_AUTODNS), Enabled); + if (Enabled) { + SendDlgItemMessage(Dlg, IDC_IPADDR, IPM_CLEARADDRESS, 0, 0); + SendDlgItemMessage(Dlg, IDC_SUBNETMASK, IPM_CLEARADDRESS, 0, 0); + SendDlgItemMessage(Dlg, IDC_DEFGATEWAY, IPM_CLEARADDRESS, 0, 0); + } else { + ManualDNS(Dlg, TRUE); + } +} + +static void +ShowError(HWND Parent, UINT MsgId) +{ + WCHAR Error[32], Msg[64]; + + if (0 == LoadStringW((HINSTANCE) GetWindowLongPtrW(Parent, GWLP_HINSTANCE), + IDS_ERROR, Error, sizeof(Error) / sizeof(Error[0]))) { + wcscpy(Error, L"Error"); + } + if (0 == LoadStringW((HINSTANCE) GetWindowLongPtrW(Parent, GWLP_HINSTANCE), + MsgId, Msg, sizeof(Msg) / sizeof(Msg[0]))) { + wcscpy(Msg, L"Unknown error"); + } + MessageBoxW(Parent, Msg, Error, MB_OK | MB_ICONSTOP); +} + +static BOOL +ValidateAndStore(HWND Dlg, PTCPIP_PROPERTIES_DATA DlgData) +{ + DWORD IpAddress; + + DlgData->DhcpEnabled = (BST_CHECKED == + IsDlgButtonChecked(Dlg, IDC_USEDHCP)); + if (! DlgData->DhcpEnabled) { + if (4 != SendMessageW(GetDlgItem(Dlg, IDC_IPADDR), IPM_GETADDRESS, + 0, (LPARAM) &IpAddress)) { + ShowError(Dlg, IDS_ENTER_VALID_IPADDRESS); + SetFocus(GetDlgItem(Dlg, IDC_IPADDR)); + return FALSE; + } + DlgData->IpAddress = htonl(IpAddress); + if (4 != SendMessageW(GetDlgItem(Dlg, IDC_SUBNETMASK), IPM_GETADDRESS, + 0, (LPARAM) &IpAddress)) { + ShowError(Dlg, IDS_ENTER_VALID_SUBNET); + SetFocus(GetDlgItem(Dlg, IDC_SUBNETMASK)); + return FALSE; + } + DlgData->SubnetMask = htonl(IpAddress); + if (4 != SendMessageW(GetDlgItem(Dlg, IDC_DEFGATEWAY), IPM_GETADDRESS, + 0, (LPARAM) &IpAddress)) { + DlgData->Gateway = INADDR_NONE; + } else { + DlgData->Gateway = htonl(IpAddress); + } + ASSERT(BST_CHECKED == IsDlgButtonChecked(Dlg, IDC_FIXEDDNS)); + } else { + DlgData->IpAddress = INADDR_NONE; + DlgData->SubnetMask = INADDR_NONE; + DlgData->Gateway = INADDR_NONE; + } + + if (BST_CHECKED == IsDlgButtonChecked(Dlg, IDC_FIXEDDNS)) { + if (4 != SendMessageW(GetDlgItem(Dlg, IDC_DNS1), IPM_GETADDRESS, + 0, (LPARAM) &IpAddress)) { + DlgData->Dns1 = INADDR_NONE; + } else { + DlgData->Dns1 = htonl(IpAddress); + } + if (4 != SendMessageW(GetDlgItem(Dlg, IDC_DNS2), IPM_GETADDRESS, + 0, (LPARAM) &IpAddress)) { + DlgData->Dns2 = INADDR_NONE; + } else { + DlgData->Dns2 = htonl(IpAddress); + } + } else { + DlgData->Dns1 = INADDR_NONE; + DlgData->Dns2 = INADDR_NONE; + } + + return TRUE; +} + +static BOOL +InternTCPIPSettings(HWND Dlg, PTCPIP_PROPERTIES_DATA DlgData) { + BOOL Changed; + BOOL IpChanged; + int DhcpAction; + LPWSTR AdapterName; - *dwIPAddr = htonl(*dwIPAddr); - inIPAddr.s_addr = *dwIPAddr; - *AddressString = inet_ntoa(inIPAddr); - if( !*AddressString ) return FALSE; - + if (! ValidateAndStore(Dlg, DlgData)) { + /* Should never happen, we should have validated at PSN_KILLACTIVE */ + ASSERT(FALSE); + return FALSE; + } + + Changed = FALSE; + if (DlgData->DhcpEnabled) { + Changed = ! DlgData->OldDhcpEnabled; + IpChanged = FALSE; + DhcpAction = 1; + } else { + Changed = DlgData->OldDhcpEnabled || + DlgData->IpAddress != DlgData->OldIpAddress || + DlgData->SubnetMask != DlgData->OldSubnetMask; + IpChanged = DlgData->OldDhcpEnabled || + DlgData->IpAddress != DlgData->OldIpAddress; + DhcpAction = 2; + } + + if (Changed) { + AdapterName = HeapAlloc(GetProcessHeap(), 0, + (strlen(DlgData->AdapterName) + 1) * + sizeof(WCHAR)); + if (NULL == AdapterName) { + ShowError(Dlg, IDS_OUT_OF_MEMORY); + return FALSE; + } + MultiByteToWideChar(CP_THREAD_ACP, 0, DlgData->AdapterName, -1, + AdapterName, strlen(DlgData->AdapterName) + 1); + if (0 == DhcpNotifyConfigChange(NULL, AdapterName, IpChanged, + DlgData->AdapterIndex, + DlgData->IpAddress, + DlgData->SubnetMask, DhcpAction)) { + HeapFree(GetProcessHeap(), 0, AdapterName); + ShowError(Dlg, IDS_CANNOT_SAVE_CHANGES); + return FALSE; + } + HeapFree(GetProcessHeap(), 0, AdapterName); + } + + /* FIXME Save default gateway and DNS entries */ return TRUE; } - - -BOOL InternTCPIPSettings( HWND hwndDlg ) { - PROPSHEETPAGE *pPage = (PROPSHEETPAGE *)GetWindowLongPtr(hwndDlg,GWL_USERDATA); - IP_ADAPTER_INFO *pInfo = NULL; - TCHAR pszRegKey[MAX_PATH]; - HKEY hKey = NULL; - DWORD IpAddress, NetMask, Gateway, Disposition; - const char *AddressString; - BOOL RetVal = FALSE; - BOOL DhcpEnabled = FALSE; - MIB_IPFORWARDROW RowToAdd = { 0 }; - - DbgPrint("TCPIP_PROPERTIES: InternTCPIPSettings\n"); - - if(pPage) - pInfo = (IP_ADAPTER_INFO *)pPage->lParam; - - DbgPrint("TCPIP_PROPERTIES: pPage: 0x%x pInfo: 0x%x\n", pPage, pInfo); - - if( !pPage || !pInfo ) goto cleanup; - - DbgPrint("TCPIP_PROPERTIES: AdapterName: %s\n", pInfo->AdapterName); - - _stprintf(pszRegKey,_T("SYSTEM\\CurrentControlSet\\Services\\TCPIP\\Parameters\\Interfaces\\%S"),pInfo->AdapterName); - if(RegCreateKeyEx - (HKEY_LOCAL_MACHINE,pszRegKey,0,NULL, - REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,&Disposition)!=ERROR_SUCCESS) { - DbgPrint("TCPIP_PROPERTIES: Could not open HKLM\\%S\n", pszRegKey); - goto cleanup; - } - - if( !GetAddressFromField - ( hwndDlg, IDC_IPADDR, &IpAddress, &AddressString ) || - RegSetValueEx - ( hKey, _T("IPAddress"), 0, REG_SZ, AddressString, - strlen(AddressString) ) != ERROR_SUCCESS ) - goto cleanup; - - DbgPrint("TCPIP_PROPERTIES: IpAddress: %x\n", IpAddress); - - if( !GetAddressFromField - ( hwndDlg, IDC_SUBNETMASK, &NetMask, &AddressString ) || - RegSetValueEx - ( hKey, _T("SubnetMask"), 0, REG_SZ, AddressString, - strlen(AddressString) ) != ERROR_SUCCESS ) - goto cleanup; - - DbgPrint("TCPIP_PROPERTIES: NetMask: %x\n", NetMask); - - if( !GetAddressFromField - ( hwndDlg, IDC_DEFGATEWAY, &Gateway, &AddressString ) || - RegSetValueEx - ( hKey, _T("DefaultGateway"), 0, REG_SZ, AddressString, - strlen(AddressString) ) != ERROR_SUCCESS ) - goto cleanup; - - if( DhcpEnabled ) { - DbgPrint("TCPIP_PROPERTIES: Lease address\n"); - DhcpLeaseIpAddress( pInfo->Index ); - } else { - /* If not on DHCP then add a default gateway, assuming one was specified */ - DbgPrint("TCPIP_PROPERTIES: Adding gateway entry\n"); - DhcpReleaseIpAddressLease( pInfo->Index ); - DhcpStaticRefreshParams( pInfo->Index, IpAddress, NetMask ); - - RowToAdd.dwForwardMask = 0; - RowToAdd.dwForwardMetric1 = 1; - RowToAdd.dwForwardNextHop = Gateway; - - CreateIpForwardEntry( &RowToAdd ); - } - - DbgPrint("TCPIP_PROPERTIES: Done changing settings\n"); - -cleanup: - if( hKey ) RegCloseKey( hKey ); - - return RetVal; -} - -INT_PTR CALLBACK -TCPIPPropertyPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - PROPSHEETPAGE *pPage = (PROPSHEETPAGE *)GetWindowLongPtr(hwndDlg,GWL_USERDATA); - IP_ADAPTER_INFO *pInfo = NULL; - int StaticDNS = 0; - char *NextDNSServer; - - if(pPage) - pInfo = (IP_ADAPTER_INFO *)pPage->lParam; - - switch(uMsg) - { +static INT_PTR CALLBACK +TCPIPPropertyPageProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + LPPROPSHEETPAGEW Page; + PTCPIP_PROPERTIES_DATA DlgData; + LPNMHDR Nmhdr; + + DlgData = (PTCPIP_PROPERTIES_DATA) GetWindowLongPtrW(Dlg, GWL_USERDATA); + switch(uMsg) { case WM_INITDIALOG: - { - pPage = (PROPSHEETPAGE *)lParam; - pInfo = (IP_ADAPTER_INFO *)pPage->lParam; - EnableWindow(GetDlgItem(hwndDlg,IDC_ADVANCED),FALSE); - SetWindowLongPtr(hwndDlg,GWL_USERDATA, (LPARAM)pPage); - - EnableDHCP( hwndDlg, pInfo->DhcpEnabled ); - + Page = (LPPROPSHEETPAGEW) lParam; + DlgData = (PTCPIP_PROPERTIES_DATA) Page->lParam; + SetWindowLongPtrW(Dlg, GWL_USERDATA, Page->lParam); + + EnableWindow(GetDlgItem(Dlg, IDC_ADVANCED), FALSE); + + EnableDHCP(Dlg, DlgData->OldDhcpEnabled); + + if (! DlgData->OldDhcpEnabled) { - DWORD dwIPAddr; - IP_ADDR_STRING *pString; - pString = &pInfo->IpAddressList; - while(pString->Next) - pString = pString->Next; - dwIPAddr = ntohl(inet_addr(pString->IpAddress.String)); - SendDlgItemMessage(hwndDlg,IDC_IPADDR,IPM_SETADDRESS,0,dwIPAddr); - dwIPAddr = ntohl(inet_addr(pString->IpMask.String)); - SendDlgItemMessage(hwndDlg,IDC_SUBNETMASK,IPM_SETADDRESS,0,dwIPAddr); - - pString = &pInfo->GatewayList; - while(pString->Next) - pString = pString->Next; - dwIPAddr = ntohl(inet_addr(pString->IpAddress.String)); - SendDlgItemMessage(hwndDlg,IDC_DEFGATEWAY,IPM_SETADDRESS,0,dwIPAddr); - - } - { - TCHAR pszRegKey[MAX_PATH]; - HKEY hKey; - _stprintf(pszRegKey,_T("SYSTEM\\CurrentControlSet\\Services\\TCPIP\\Parameters\\Interfaces\\%S"),pInfo->AdapterName); - if(RegOpenKey(HKEY_LOCAL_MACHINE,pszRegKey,&hKey)==ERROR_SUCCESS) - { - char pszDNS[MAX_PATH]; - DWORD dwSize = sizeof(pszDNS); - DWORD dwType = REG_SZ; - DWORD dwIPAddr; - RegQueryValueExA(hKey,"NameServer",NULL,&dwType,(BYTE*)pszDNS,&dwSize); - RegCloseKey(hKey); - - NextDNSServer = pszDNS; - - while( NextDNSServer && StaticDNS < 2 ) { - dwIPAddr = ntohl(inet_addr(NextDNSServer)); - if( dwIPAddr != INADDR_NONE ) { - SendDlgItemMessage(hwndDlg,IDC_DNS1 + StaticDNS,IPM_SETADDRESS,0,dwIPAddr); - StaticDNS++; - } - NextDNSServer = strchr( pszDNS, ',' ); - if( NextDNSServer ) - NextDNSServer++; - } - - ManualDNS( hwndDlg, StaticDNS ); - } - } - } - break; - case WM_DESTROY: + if (INADDR_NONE != DlgData->OldIpAddress) { + SendDlgItemMessage(Dlg, IDC_IPADDR, IPM_SETADDRESS, 0, + ntohl(DlgData->OldIpAddress)); + } + if (INADDR_NONE != DlgData->OldSubnetMask) { + SendDlgItemMessage(Dlg, IDC_SUBNETMASK, IPM_SETADDRESS, 0, + ntohl(DlgData->OldSubnetMask)); + } + if (INADDR_NONE != DlgData->OldGateway) { + SendDlgItemMessage(Dlg, IDC_DEFGATEWAY, IPM_SETADDRESS, 0, + ntohl(DlgData->OldGateway)); + } + } + + if (INADDR_NONE != DlgData->OldDns1) { + SendDlgItemMessage(Dlg, IDC_DNS1, IPM_SETADDRESS, 0, + ntohl(DlgData->OldDns1)); + if (INADDR_NONE != DlgData->OldDns2) { + SendDlgItemMessage(Dlg, IDC_DNS2, IPM_SETADDRESS, 0, + ntohl(DlgData->OldDns2)); + } + } + ManualDNS(Dlg, INADDR_NONE != DlgData->OldDns1); + break; + case WM_COMMAND: - switch(LOWORD(wParam)) - { + switch(LOWORD(wParam)) { case IDC_FIXEDDNS: - ManualDNS( hwndDlg, TRUE ); - break; + ManualDNS(Dlg, TRUE); + return TRUE; case IDC_AUTODNS: - ManualDNS( hwndDlg, FALSE ); - break; + ManualDNS(Dlg, FALSE); + return TRUE; case IDC_USEDHCP: - EnableDHCP( hwndDlg, TRUE ); - break; + EnableDHCP(Dlg, TRUE); + return TRUE; case IDC_NODHCP: - EnableDHCP( hwndDlg, FALSE ); - break; - - case 0: + EnableDHCP(Dlg, FALSE); + return TRUE; + } + break; + + case WM_NOTIFY: + Nmhdr = (LPNMHDR) lParam; + + switch(Nmhdr->code) { + case PSN_KILLACTIVE: + /* Do validation here, must set FALSE to continue */ + SetWindowLongPtrW(Dlg, DWL_MSGRESULT, + (LONG_PTR) ! ValidateAndStore(Dlg, DlgData)); + return TRUE; + + case PSN_APPLY: /* Set the IP Address and DNS Information so we won't * be doing all this for nothing */ - InternTCPIPSettings( hwndDlg ); - LocalFree((void *)pPage->lParam); - LocalFree(pPage); - break; + SetWindowLongPtrW(Dlg, DWL_MSGRESULT, + InternTCPIPSettings(Dlg, DlgData) ? + PSNRET_NOERROR : PSNRET_INVALID); + return TRUE; } break; } + return FALSE; } -void DisplayTCPIPProperties(HWND hParent,IP_ADAPTER_INFO *pInfo) -{ - PROPSHEETPAGE *psp = LocalAlloc( LMEM_FIXED, sizeof(PROPSHEETPAGE) ); - PROPSHEETHEADER psh; - INITCOMMONCONTROLSEX cce; - - DbgPrint("TCPIP_PROPERTIES: psp = %x\n", psp); - - cce.dwSize = sizeof(INITCOMMONCONTROLSEX); - cce.dwICC = ICC_INTERNET_CLASSES; - InitCommonControlsEx(&cce); - - ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; - psh.hwndParent = hParent; - psh.hInstance = hApplet; - psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM)); - psh.pszCaption = NULL;//Caption; - psh.nPages = 1; - psh.nStartPage = 0; - psh.ppsp = psp; - psh.pfnCallback = NULL; - - DbgPrint("TCPIP_PROPERTIES: About to InitPropSheetPage (pInfo: %x)\n", pInfo); - - InitPropSheetPage(psp, IDD_TCPIPPROPERTIES, TCPIPPropertyPageProc, (LPARAM)pInfo); - - DbgPrint("TCPIP_PROPERTIES: About to realize property sheet\n", psp); - - if (PropertySheet(&psh) == -1) - { - MessageBox(hParent,_T("Unable to create property sheet"),_T("Error"),MB_ICONSTOP); - } - - return; -} +static BOOL +LoadDataFromInfo(PTCPIP_PROPERTIES_DATA DlgData, IP_ADAPTER_INFO *Info) +{ + IP_ADDR_STRING *pString; + WCHAR RegKey[MAX_PATH]; + HKEY hKey; + char Dns[MAX_PATH]; + DWORD Size; + DWORD Type; + char *NextDnsServer; + + DlgData->AdapterName = Info->AdapterName; + DlgData->AdapterIndex = Info->Index; + + DlgData->OldDhcpEnabled = Info->DhcpEnabled; + + pString = &Info->IpAddressList; + while (NULL != pString->Next) { + pString = pString->Next; + } + DlgData->OldIpAddress = inet_addr(pString->IpAddress.String); + DlgData->OldSubnetMask = inet_addr(pString->IpMask.String); + pString = &Info->GatewayList; + while (NULL != pString->Next) { + pString = pString->Next; + } + DlgData->OldGateway = inet_addr(pString->IpAddress.String); + + DlgData->OldDns1 = INADDR_NONE; + DlgData->OldDns2 = INADDR_NONE; + swprintf(RegKey, + L"SYSTEM\\CurrentControlSet\\Services\\TCPIP\\Parameters\\Interfaces\\%S", + Info->AdapterName); + if (ERROR_SUCCESS == RegOpenKeyW(HKEY_LOCAL_MACHINE, RegKey, &hKey)) { + Size = sizeof(Dns); + RegQueryValueExA(hKey, "NameServer", NULL, &Type, (BYTE *)Dns, + &Size); + RegCloseKey(hKey); + + if ('\0' != Dns[0]) { + DlgData->OldDns1 = inet_addr(Dns); + NextDnsServer = strchr(Dns, ','); + if (NULL != NextDnsServer && '\0' != *NextDnsServer) { + DlgData->OldDns2 = inet_addr(NextDnsServer); + } + } + } + + return TRUE; +} + +void +DisplayTCPIPProperties(HWND hParent, IP_ADAPTER_INFO *pInfo) +{ + PROPSHEETPAGEW psp[1]; + PROPSHEETHEADERW psh; + INITCOMMONCONTROLSEX cce; + TCPIP_PROPERTIES_DATA DlgData; + + if (! LoadDataFromInfo(&DlgData, pInfo)) + { + ShowError(hParent, IDS_CANNOT_LOAD_CONFIG); + return; + } + + cce.dwSize = sizeof(INITCOMMONCONTROLSEX); + cce.dwICC = ICC_INTERNET_CLASSES; + InitCommonControlsEx(&cce); + + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; + psh.hwndParent = hParent; + psh.hInstance = hApplet; + psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM)); + psh.pszCaption = NULL;//Caption; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.ppsp = psp; + psh.pfnCallback = NULL; + + InitPropSheetPage(&psp[0], IDD_TCPIPPROPERTIES, TCPIPPropertyPageProc); + psp[0].lParam = (LPARAM) &DlgData; + + if (PropertySheetW(&psh) == -1) + { + ShowError(hParent, IDS_CANNOT_CREATE_PROPSHEET); + } + + return; +}
18 years, 7 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
38
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
Results per page:
10
25
50
100
200