Author: hpoussin Date: Wed Apr 12 02:01:08 2006 New Revision: 21556
URL: http://svn.reactos.ru/svn/reactos?rev=21556&view=rev Log: First step to automatically generate registry entries for network protocols (TcpIp...) Registry settings are moved to media/inf/nettcpip.inf, which is installed for each netcard detected.
Added: trunk/reactos/media/inf/nettcpip.inf Modified: trunk/reactos/boot/bootdata/hivesys.inf trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/netcfgx/netcfgx.c trunk/reactos/media/inf/inf.rbuild
Modified: trunk/reactos/boot/bootdata/hivesys.inf URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/boot/bootdata/hivesys.inf?re... ============================================================================== --- trunk/reactos/boot/bootdata/hivesys.inf (original) +++ trunk/reactos/boot/bootdata/hivesys.inf Wed Apr 12 02:01:08 2006 @@ -78,16 +78,6 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E974-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetService" HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Protocol" HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetTrans" -; The following entries should be generated from .inf files during installation -; TCPIP Protocol -HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","Characteristics",0x00010001,0x00000080 -HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","ComponentId",0x00000000,"ms_tcpip" -HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","Description",0x00000000,"Internet Protocol (TCP/IP)" -HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","InfPath",0x00000000,"BUGBUG_Create from Inffile.inf" -HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","InfSection",0x00000000,"BUGBUG_Create from Inffile.inf" -HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}\Ndi","ClsId",0x00000000,"{A907657F-6FDF-11D0-8EFB-00C04FD912B2}" -HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}\Ndi","HelpText",0x00000000,"Transmission Control Protocol/Internet Protocol" -HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}\Ndi","Service",0x00000000,"Tcpip"
@@ -708,32 +698,6 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","Start",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","Type",0x00010001,0x00000001
-; TCP/IP driver -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","Group",0x00000000,"PNP_TDI" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","ImagePath",0x00020000,"system32\drivers\tcpip.sys" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","Start",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","Type",0x00010001,0x00000001 -; NOTE: These settings should be added by the network setup -; These bindings are of the windows 2000 type, and will probably need to be -; twiddled to get 3rd-party network-related software to work. -; NT4 puts additional stuff in the Bind, Export, and Route values. -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","DataBasePath",0x00010000,"DataBasePath" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Domain",0x00010000,"" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Hostname",0x00010000,"ROSHost" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","NameServer",0x00010000,"0.0.0.0" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","ForwardBroadcasts",0x00010001,0x00000000 -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","IPEnableRouter",0x00010001,0x00000000 -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","SearchList",0x00010000,"" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","EnableSecurityFilters",0x00010001,0x00000000 -;HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes",,0x00000010 -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","UseDelayedAcceptance",0x00010001,0x00000000 -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","MaxSockAddrLength",0x00010001,0x00000010 -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","MinSockAddrLength",0x00010001,0x00000010 -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","HelperDllName",0x00000000,"%SystemRoot%\System32\wshtcpip.dll" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","Mapping",0x00000001,0c,00,00,00,03,00,00,00,02,00,00,00,01,00,00,00,06,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,06,00,00,00,00,00,00,00,00,00,00,00,06,00,00,00,00,00,00,00,01,00,00,00,06,00,00,00,02,00,00,00,02,00,00,00,11,00,00,00,02,00,00,00,02,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,11,00,00,00,00,00,00,00,00,00,00,00,11,00,00,00,00,00,00,00,02,00,00,00,11,00,00,00,02,00,00,00,03,00,00,00,00,00,00,00,02,00,00,00,03,00,00,00,01,00,00 -HKLM,"SYSTEM\CurrentControlSet\Services\Winsock\Parameters","Transports",0x00010000,"Tcpip" - ; Simple TCP services HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Description",0x00000000,"Supports the following TCP/IP services: Chargen, Daytime, Discard, Echo, QOTD" HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","DisplayName",0x00000000,"Simple TCP/IP Services"
Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/boot/bootdata/packages/react... ============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff Wed Apr 12 02:01:08 2006 @@ -351,6 +351,7 @@ media\inf\netamd.inf 6 media\inf\netisa.inf 6 media\inf\netrtpnt.inf 6 +media\inf\nettcpip.inf 6 media\inf\ports.inf 6 media\inf\scsi.inf 6 media\inf\syssetup.inf 6
Modified: trunk/reactos/dll/win32/netcfgx/netcfgx.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/netcfgx/netcfgx.c?... ============================================================================== --- trunk/reactos/dll/win32/netcfgx/netcfgx.c (original) +++ trunk/reactos/dll/win32/netcfgx/netcfgx.c Wed Apr 12 02:01:08 2006 @@ -90,6 +90,83 @@ cleanup: HeapFree(GetProcessHeap(), 0, Buffer); return rc; +} + +/* Install a section of a .inf file + * Returns TRUE if success, FALSE if failure. Error code can + * be retrieved with GetLastError() + */ +static BOOL +InstallInfSection( + IN HWND hWnd, + IN LPCWSTR InfFile, + IN LPCWSTR InfSection) +{ + WCHAR Buffer[MAX_PATH]; + HINF hInf = INVALID_HANDLE_VALUE; + UINT BufferSize; + PVOID Context = NULL; + BOOL ret = FALSE; + + /* Get Windows directory */ + BufferSize = MAX_PATH - 5 - wcslen(InfFile); + if (GetWindowsDirectoryW(Buffer, BufferSize) > BufferSize) + { + /* Function failed */ + SetLastError(ERROR_GEN_FAILURE); + goto cleanup; + } + /* We have enough space to add some information in the buffer */ + if (Buffer[wcslen(Buffer) - 1] != '\') + wcscat(Buffer, L"\"); + wcscat(Buffer, L"Inf\"); + wcscat(Buffer, InfFile); + + /* Install specified section */ + hInf = SetupOpenInfFileW(Buffer, NULL, INF_STYLE_WIN4, NULL); + if (hInf == INVALID_HANDLE_VALUE) + goto cleanup; + + Context = SetupInitDefaultQueueCallback(hWnd); + if (Context == NULL) + goto cleanup; + + ret = SetupInstallFromInfSectionW( + hWnd, hInf, + InfSection, SPINST_ALL, + NULL, NULL, SP_COPY_NEWER, + SetupDefaultQueueCallbackW, Context, + NULL, NULL); + +cleanup: + if (Context) + SetupTermDefaultQueueCallback(Context); + if (hInf != INVALID_HANDLE_VALUE) + SetupCloseInfFile(hInf); + return ret; +} + +/* Add default services for network cards */ +static DWORD +InstallAdditionalServices( + IN HWND hWnd) +{ + BOOL ret; + + /* Install TCP/IP protocol */ + ret = InstallInfSection( + hWnd, + L"nettcpip.inf", + L"MS_TCPIP.PrimaryInstall"); + if (!ret && GetLastError() != ERROR_FILE_NOT_FOUND) + { + DPRINT("InstallInfSection() failed with error 0x%lx\n", GetLastError()); + return GetLastError(); + } + + /* You can add here more clients (SMB...) and services (DHCP server...) */ + + return ERROR_SUCCESS; }
DWORD WINAPI @@ -346,6 +423,15 @@ goto cleanup; }
+ /* Install additionnal services */ + /* FIXME: do it only if it is a network adapter! */ + rc = InstallAdditionalServices(NULL); + if (rc != ERROR_SUCCESS) + { + DPRINT("InstallAdditionalServices() failed with error 0x%lx\n", rc); + goto cleanup; + } + /* HACK: hpoussin, Dec 2005. TCP/IP driver is not able to manage devices * which are installed after its startup. So, we have to reboot to take * this new netcard into account.
Modified: trunk/reactos/media/inf/inf.rbuild URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/media/inf/inf.rbuild?rev=215... ============================================================================== --- trunk/reactos/media/inf/inf.rbuild (original) +++ trunk/reactos/media/inf/inf.rbuild Wed Apr 12 02:01:08 2006 @@ -11,6 +11,7 @@ <installfile base="inf">netamd.inf</installfile> <installfile base="inf">netisa.inf</installfile> <installfile base="inf">netrtpnt.inf</installfile> +<installfile base="inf">nettcpip.inf</installfile> <installfile base="inf">ports.inf</installfile> <installfile base="inf">scsi.inf</installfile> <installfile base="inf">syssetup.inf</installfile>
Added: trunk/reactos/media/inf/nettcpip.inf URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/media/inf/nettcpip.inf?rev=2... ============================================================================== --- trunk/reactos/media/inf/nettcpip.inf (added) +++ trunk/reactos/media/inf/nettcpip.inf Wed Apr 12 02:01:08 2006 @@ -1,0 +1,61 @@ +; NETTCPIP.INF + +; Installation file for TCP/IP protocol + +[Version] +Signature = "$Windows NT$" +;Signature = "$ReactOS$" +LayoutFile = layout.inf +Class = NetTrans +ClassGUID = {4D36E975-E325-11CE-BFC1-08002BE10318} +Provider = %ReactOS% +DriverVer = 04/12/2006,1.00 + +;----------------------------- TCP/IP DRIVER ---------------------------- + +[MS_TCPIP.PrimaryInstall.NT] +AddReg = TCPIP_AddReg.NT + +[TCPIP_AddReg.NT] +; The following entries should be generated from .inf files during installation +; TCPIP Protocol +HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","Characteristics",0x00010001,0x00000080 +HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","ComponentId",0x00000000,"ms_tcpip" +HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","Description",0x00000000,"Internet Protocol (TCP/IP)" +HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","InfPath",0x00000000,"BUGBUG_Create from Inffile.inf" +HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}","InfSection",0x00000000,"BUGBUG_Create from Inffile.inf" +HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}\Ndi","ClsId",0x00000000,"{A907657F-6FDF-11D0-8EFB-00C04FD912B2}" +HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}\Ndi","HelpText",0x00000000,"Transmission Control Protocol/Internet Protocol" +HKLM,"SYSTEM\CurrentControlSet\Control\Network{4D36E975-E325-11CE-BFC1-08002BE10318}{RandomProtocolGUID_TCPIP}\Ndi","Service",0x00000000,"Tcpip" + +; TCP/IP driver +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","Group",0x00000000,"PNP_TDI" +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","ImagePath",0x00020000,"system32\drivers\tcpip.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip","Type",0x00010001,0x00000001 +; NOTE: These settings should be added by the network setup +; These bindings are of the windows 2000 type, and will probably need to be +; twiddled to get 3rd-party network-related software to work. +; NT4 puts additional stuff in the Bind, Export, and Route values. +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","DataBasePath",0x00010000,"DataBasePath" +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Domain",0x00010000,"" +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Hostname",0x00010000,"ROSHost" +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","NameServer",0x00010000,"0.0.0.0" +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","ForwardBroadcasts",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","IPEnableRouter",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","SearchList",0x00010000,"" +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","EnableSecurityFilters",0x00010001,0x00000000 +;HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes",,0x00000010 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","UseDelayedAcceptance",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","MaxSockAddrLength",0x00010001,0x00000010 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","MinSockAddrLength",0x00010001,0x00000010 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","HelperDllName",0x00000000,"%SystemRoot%\System32\wshtcpip.dll" +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","Mapping",0x00000001,0c,00,00,00,03,00,00,00,02,00,00,00,01,00,00,00,06,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,06,00,00,00,00,00,00,00,00,00,00,00,06,00,00,00,00,00,00,00,01,00,00,00,06,00,00,00,02,00,00,00,02,00,00,00,11,00,00,00,02,00,00,00,02,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,11,00,00,00,00,00,00,00,00,00,00,00,11,00,00,00,00,00,00,00,02,00,00,00,11,00,00,00,02,00,00,00,03,00,00,00,00,00,00,00,02,00,00,00,03,00,00,00,01,00,00 +HKLM,"SYSTEM\CurrentControlSet\Services\Winsock\Parameters","Transports",0x00010000,"Tcpip" + +;-------------------------------- STRINGS ------------------------------- + +[Strings] +ReactOS = "ReactOS Team" +