macshuffle

WinPE 4.0 - Enable Wireless Support

11 posts in this topic

I've successfully used the various guides out there to build a WinPE 3.0 build with wireless support. In addition, I got it to the point where I could image a new laptop form start to finish completely over the wireless network with SCCM.

I'm trying to do the same thing with WinPE 4.0 x64, but the same hacks don't work. It appears that the wlansvc depends on the wcmsvc in order to launch in WinPE 4.0 (Windows 8). Here is what I've done so far.

I've done the following with WinPE 4.0 x64 boot.wim file mounted to c:\mount

WinPE 4.0 x64 Packages

----------------------------------

Added dot3svc package. This is needed as the dot3svc service needs to be running in order to start wlansvc and wcmsvc.

dism /Image:C:\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\WINPE-DOT3SVC.CAB"

dism /Image:C:\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\en-us\WINPE-DOT3SVC_EN-US.CAB"

Registry Edits

-------------------

reg load HKLM\PE-BUILD-SYSTEM "C:\mount\Windows\System32\config\SYSTEM"

reg load HKLM\PE-BUILD-SOFTWARE "C:\mount\Windows\System32\config\SOFTWARE"

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v DisplayName /t REG_SZ /d "@%%SystemRoot%%\System32\Wcmsvc.dll,-4097" /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v ErrorControl /t REG_DWORD /d 1 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v Group /t REG_SZ /d TDI /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v ImagePath /t REG_EXPAND_SZ /d "%%SystemRoot%%\system32\svchost.exe -k LocalServiceNetworkRestricted" /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v Start /t REG_DWORD /d 2 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v Type /t REG_DWORD /d 32 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v Description /t REG_SZ /d "@%%SystemRoot%%\System32\Wcmsvc.dll,-4098" /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v DependOnService /t REG_MULTI_SZ /d "RpcSs" /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v ObjectName /t REG_SZ /d "NT Authority\LocalService" /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v ServiceSidType /t REG_DWORD /d 1 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v RequiredPrivileges /t REG_MULTI_SZ /d "SeChangeNotifyPrivilege\0SeImpersonatePrivilege" /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc /v FailureActions /t REG_BINARY /d 805101000000000000000000030000001400000001000000C0D4010001000000E09304000000000000000000 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc\Parameters /v ServiceDll /t REG_EXPAND_SZ /d "%%SystemRoot%%\System32\Wcmsvc.dll" /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc\Parameters /v ServiceDllUnloadOnStop /t REG_DWORD /d 1 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\services\Wcmsvc\Parameters /v ServiceMain /t REG_SZ /d WcmSvcMain /f

FIles Copied from Windows 8 x64 to PE 4.0 x64 wim

-----------------------------------------------------------------------

*NOTE - for the catroot files...not sure if ALL of these are needed....but some of the files need them due to Win 8 signing all the files*

From Under system32\catroot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}

Microsoft-Windows-Client-Drivers-Package-base~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package-base~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package-drivers~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package-drivers~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package-net~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package-net~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package-windows~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package-windows~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Drivers-Package~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-base~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-base~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-drivers~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-drivers~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-inetcore~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-inetcore~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-inetsrv~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-net~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-net~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-windows~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package-windows~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cat

Microsoft-Windows-Client-Features-Package~31bf3856ad364e35~amd64~~6.2.9200.16384.cat

Under system32\drivers

wcmsvc.dll

Under system32\drivers\en-US

wcmsvc.dll.mui

Up to this point, the services wont start.....here is where I start breaking things.....and need help.

I then made these registry changes:

reg add "HKLM\PE-BUILD-SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost" /v LocalSystemNetworkRestricted /t REG_MULTI_SZ /d Netman\0hidserv\0svsvc\0dot3svc\0wlansvc /f

reg add "HKLM\PE-BUILD-SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost" /v LocalServiceNetworkRestricted /t REG_MULTI_SZ /d DHCP\0eventlog\0LmHosts\0wcmsvc /f

I tried mirroring the LocalServiceNetworkRestricted off of how LocalSystemNetworkRestricted was done for the WinPE 3.0. Please note that I did update LocalSystemNetworkRestricted to reflect the service names for WinPE 4.0 / Win 8.

I kept these changes from the WinPE 3.0 wifi configuration, but didn't know if something similar needed to be made for the wcmsvc service. One thing to note was that registry permissions prevented me from making these changes at first...I had to take ownership and modify the permissions and then I was able to add them. This could be were things got worse. At some point my WinPE 4.0 did recognize ANY network adapters (wired or wireless)

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\Enum\Root\LEGACY_WLANSVC /v NextInstance /t REG_DWORD /d 1 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\Enum\Root\LEGACY_WLANSVC\0000 /v Service /t REG_SZ /d Wlansvc /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\Enum\Root\LEGACY_WLANSVC\0000 /v Legacy /t REG_DWORD /d 1 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\Enum\Root\LEGACY_WLANSVC\0000 /v ConfigFlags /t REG_DWORD /d 0 /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\Enum\Root\LEGACY_WLANSVC\0000 /v Class /t REG_SZ /d LegacyDriver /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\Enum\Root\LEGACY_WLANSVC\0000 /v ClassGUID /t REG_SZ /d {8ECC055D-047F-11D1-A537-0000F8753ED1} /f

reg add HKLM\PE-BUILD-SYSTEM\ControlSet001\Enum\Root\LEGACY_WLANSVC\0000 /v DeviceDesc /t REG_SZ /d "@%%SystemRoot%%\System32\wlansvc.dll,-257" /f

So, after working with it a while I was able to get the dot3svc, wcmsvc and wlansvc to all start, but it did not appear that the wireless device was being seen. In addition, at least once when trying to start wlansvc it would throw an error. I didn't copy it down, but I can provide some more info when I'm back at this tomorrow.

So, that is where things are at. If anyone has cracked this yet I'd be interested to know what needs to be done! Thanks!

Edited by macshuffle
0

Share this post


Link to post
Share on other sites

I think ChrisR's project has this ability. Maybe look at his PE project and see how he does it.

0

Share this post


Link to post
Share on other sites

MacShuffle,

I've got the missing piece of your puzzle.

Thanks to your extended information, and the info I too found for WinPE 3.0, I now have it working correctly on WinPE 4.0 and 5.0.

First, you do not need to implement "WcmSvc", or "Windows Connection Manager", service. When you create the wlansvc service and it's listed in the "DependsOnService" entry of the server, just remove the entry wcmsvc from the reg_multi_sz key.

Second, the error wlansvc cannot start with error "The handle is invalid (error 6) is because you're missing a file in your configuration.

You need an additional schema file copied into your WinPE 4.0/5.0 image: "WLAN_profile_v2.xsd". Source location in your full blown Windows is: "C:\Windows\L2Schemas\WLAN_profile_v2.xsd" .

Third, certain wireless adapter drivers have an "Include" in their .inf file to include an additional virtual adapter driver, like Intel have. When you open such a driver file, search for "Include=".

In all latest Intel Wireless drivers, you'll see listed: "Include=netvwifibus.inf"

To add this to your WinPE 4.0/5.0 image, copy the following files to the following locations in your WinPE image:

Windows ---> WinPE image

C:\Windows\Inf\netvwifibus.inf ---> <mountdir>\Windows\Inf\netvwifibus.inf

C:\Windows\System32\Drivers\vwifibus.sys ---> <mountdir>\Windows\System32\Drivers\vwifibus.sys

And, very important:

C:\Windows\System32\Drivers\vwifibus.sys --> <mountdir>\Windows\Inf\vwifibus.sys

Somehow, it only works properly when the .sys file is (also) included in the <WinPE>\Windows\Inf folder.

Fourth, the drvload command to load netnwifi.inf, netvwififlt.inf and netvwifimp.inf won't work. You get the signature error, and copying the catalog files won't help.

Though, I did now copy them as well, here's how to load the services from the 3 net*.inf files once WinPE 4.0/5.0 is booted:

netcfg -l %SystemRoot%\Inf\netnwifi.inf -c s -i MS_NativeWifiP

netcfg -l %SystemRoot%\Inf\netvwififlt.inf -c s -i ms_vwifi

And, voila... you now are able to start the wlansvc without a problem and use netshell command (netsh) to see and add wireless network profiles to connect to.

Oh, little detail: sometimes the wireless driver doesn't load fully, most likely due to the two stage install of the virtual adapter driver. I used devcon rescan to let WinPE do a redetection and than it automatically started working properly.

Have fun!!!

Herman v3

0

Share this post


Link to post
Share on other sites

And, voila... you now are able to start the wlansvc without a problem and use netshell command (netsh) to see and add wireless network profiles to connect to.

Oh, little detail: sometimes the wireless driver doesn't load fully, most likely due to the two stage install of the virtual adapter driver. I used devcon rescan to let WinPE do a redetection and than it automatically started working properly.

Have fun!!!

Herman v3

Nice! :thumbup

Fourth, the drvload command to load netnwifi.inf, netvwififlt.inf and netvwifimp.inf won't work. You get the signature error, and copying the catalog files won't help.

Though, I did now copy them as well, here's how to load the services from the 3 net*.inf files once WinPE 4.0/5.0 is booted:

1) netcfg -l %SystemRoot%\Inf\netnwifi.inf -c s -i MS_NativeWifiP

2) netcfg -l %SystemRoot%\Inf\netvwififlt.inf -c s -i ms_vwifi

3) ? :w00t:

Which is the command for the third file netvwifimp.inf ? :unsure:

jaclaz

Edited by jaclaz
0

Share this post


Link to post
Share on other sites

Jaclaz,

Thanks!

Actually, there's no 3rd command. And, just checked the requirement for the 3rd inf file netvwifimp.inf, but I can't find any dependencies. I did include it because it was referred to in another fora that described how to add wireless support for WinPE 3.0. So, I think you may ignore it, at this moment.

What I did to test some things is to export profiles on a working windows system using netsh wlan export profile command, and import profiles in WinPE using the netsh wlan import command.

Be sure to first start the wlansvc service prior to starting netsh in WinPE.

Also, the easiest way to add the registry part for the LEGACY_WLAN keys and values, is to add registry permissions for <computername>\Administrators on the Enum and/or Root subkey in the registry keypath once you've loaded the System hive into your registry editor.

I am gona work on an automated way to achieve this required part, well... wanna automate the whole stuff when I have some time.

In order to connect to a enterprise wireless network that uses PEAP and MSCHAPv2 for user authentication, you need to use either some coding in .NET or use AutoItv3.

I found the latter to be most easiest way to achieve this goal, will test a compiled piece of code that some guys already shared here: http://www.autoitscript.com/forum/topic/91018-native-wifi-functions/page-4

Cheers,

Herman v3

0

Share this post


Link to post
Share on other sites

Hey Guys,

Can someone post what is ACTUALLY needed ? I am a bit of a noob and a huge fan of copy/paste.

Also, I cannot seem to be able to change the registry in WinPE even if i have admin rights on my machine and running cmd with admin rights. I tried editing the permissions of Enum and Root and windows gave me the finger.

Help?

Thanks.

0

Share this post


Link to post
Share on other sites

Hello,

 

i have 2 differend Problems:

winpe x86: if i would start wlansvc, dependency service failed to start

 

winpe x64: if i would start wlansvc, the name from the service is not valid

 

I have copied all Files from the first and third post and make the changes in the registry.

 

@hvandrie

Can you show us your proceed and did you test it with x86 or x64 winpe?

 

Greetings

Micha

Edited by michl2007
0

Share this post


Link to post
Share on other sites

Hi,

 

I would also be interested in finding out what the exact sequence to get the wifi working. I've tried to follow the first few posts to make adjustments to my WinPE5 to get the wifi working.

 

I'm using a Lenovo Thinkpad 10 tablet. I've added the GPIO chipset drivers and the SDIO Wireless drivers using dism so the wireless adapater at least shows up if you do a netcfg -s n

 

I've added the dot3svc and used some of the reg entries to get the wlansvc service installed. (I think). I have the relevant lines in au3 format if required.

 

I also had to add ndisuio service via registry as dot3svc seemed to have this as a dependancy but it wasn't showing in the controlset001\services and wouldn't work until it was added.

 

wlansvc seems to require nativewifip as a service but adding this via reg entries and using net start would complain of a lack of signatures so I removed the nativewifip dependancy and used the netcfg lines to run up ms_nativewifip and ms_vwifi instead as per above posts.

 

When trying to net start wlansvc I get a System error 127 which shows up as "The specified procedure could not be found" which is where I am now stuck.

 

I'm trying to get to the point where I can at least pull out the mac address of the wireless adapter using wmi but while I can pull out a usb connected network adapter that I plugged in I can't with the wireless adapter.

 

Any help would be extremely helpful and appreciated.

Edited by Tracat
0

Share this post


Link to post
Share on other sites

Any update on this old thread?  I've hit a wall starting wlansvc getting a 1068 error even though all the dependent services appear to be started.

 

EDIT: Copying the cab files over into windows\system32\cabfiles\{..... resulted in the error changing to the system error 6 (the handle is invalid) when starting wlansvc.  Not sure what file is missing...I have the additional xsd file copied over.

 

EDIT of an EDIT:  I copied over all the xsd files from the l2schemas folder and then wlansvc started.  things are working now.  I will try to compile a script to build the WinPE WIM based on my findings for others.

Edited by nephewkp
0

Share this post


Link to post
Share on other sites

I was cleaning out an old email account and found this thread I had long since abandoned. Glad to see others picked up on it and were able to complete the solution!

 

@nephewkp - Interested in what you come up with!

1

Share this post


Link to post
Share on other sites

This is what I've done:
 

Add Wireless Drivers:
 
Netwen00.inf
 
Add Packages for SCCM:
 
Winpe-DismCmdlets
WinPE-Scripting
WinPE-SecureStartup
WinPE-WDS-Tools
WinPE-WMI
WinPE-Dot3Svc
WinPE-EnhancedStorage
WinPE-HTA
WinPE-StorageWMI
WinPE-LegacySetup
WinPE-NetFx
WinPE-PowerShell
WinPE-PPPoE
WinPE-RNDIS
 
Registry Changes:
 
reg load HKLM\PE-BUILD-SYSTEM "C:\Mount\Windows\System32\config\SYSTEM"
reg load HKLM\PE-BUILD-SOFTWARE "C:\Mount\Windows\System32\config\SOFTWARE"
set KEY=HKLM\PE-BUILD-SYSTEM\ControlSet001\Enum\Root\LEGACY_WLANSVC
reg add %KEY% /v NextInstance /t REG_DWORD /d 1 /f
reg add %KEY%\0000 /v Service /t REG_SZ /d Wlansvc /f
reg add %KEY%\0000 /v Legacy /t REG_DWORD /d 1 /f
reg add %KEY%\0000 /v ConfigFlags /t REG_DWORD /d 0 /f
reg add %KEY%\0000 /v Class /t REG_SZ /d LegacyDriver /f
reg add %KEY%\0000 /v ClassGUID /t REG_SZ /d {8ECC055D-047F-11D1-A537-0000F8753ED1} /f
reg add %KEY%\0000 /v DeviceDesc /t REG_SZ /d "@%%SystemRoot%%\System32\wlansvc.dll,-257" /f
set KEY=HKLM\PE-BUILD-SYSTEM\ControlSet001\services\wlansvc
reg add %KEY% /v DisplayName /t REG_SZ /d "@%%SystemRoot%%\System32\wlansvc.dll,-257" /f
reg add %KEY% /v ErrorControl /t REG_DWORD /d 1 /f
reg add %KEY% /v Group /t REG_SZ /d TDI /f
reg add %KEY% /v ImagePath /t REG_EXPAND_SZ /d "%%SystemRoot%%\system32\svchost.exe -k LocalSystemNetworkRestricted" /f
reg add %KEY% /v Start /t REG_DWORD /d 2 /f
reg add %KEY% /v Type /t REG_DWORD /d 32 /f
reg add %KEY% /v Description /t REG_SZ /d "@%%SystemRoot%%\System32\wlansvc.dll,-258" /f
reg add %KEY% /v DependOnService /t REG_MULTI_SZ /d "nativewifip\0RpcSs\0Ndisuio\0Eaphost" /f
reg add %KEY% /v ObjectName /t REG_SZ /d LocalSystem /f
reg add %KEY% /v ServiceSidType /t REG_DWORD /d 1 /f
reg add %KEY% /v RequiredPrivileges /t REG_MULTI_SZ /d "SeChangeNotifyPrivilege\0SeImpersonatePrivilege\0SeAuditPrivilege\0SeTcbPrivilege\0SeDebugPrivilege" /f
reg add %KEY% /v FailureActions /t REG_BINARY /d 2c0100000000000000000000030000001400000001000000c0d4010001000000e09304000000000000000000 /f
reg add %KEY%\Enum /v 0 /t REG_SZ /d "Root\LEGACY_WLANSVC\0000" /f
reg add %KEY%\Enum /v Count /t REG_DWORD /d 1 /f
reg add %KEY%\Enum /v NextInstance /t REG_DWORD /d 1 /f
reg add %KEY%\Parameters /v ServiceDll /t REG_EXPAND_SZ /d "%%SystemRoot%%\System32\wlansvc.dll" /f
reg add %KEY%\Parameters /v ServiceDllUnloadOnStop /t REG_DWORD /d 1 /f
reg add %KEY%\Parameters /v ServiceMain /t REG_SZ /d WlanSvcMain /f
reg add HKLM\PE-BUILD-SOFTWARE\Microsoft\NetSh /v wlancfg /t REG_SZ /d wlancfg.dll /f
call :REG_MULTI_SZ-add "HKLM\PE-BUILD-SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost" LocalSystemNetworkRestricted wlansvc
 
Files Added to PE:
 
::     C:\Windows\inf\netnwifi.inf
::     C:\Windows\inf\netvwififlt.inf
::     C:\Windows\inf\netvwifimp.inf
::     C:\Windows\Inf\netvwifibus.inf
::     C:\Windows\System32\Drivers\vwifibus.sys --> X:\Windows\Inf\vwifibus.sys
::     C:\Windows\l2schemas\wlan_policy_v1.xsd
::     C:\Windows\l2schemas\wlan_profile_v1.xsd
::     C:\Windows\l2schemas\WLAN_profile_v2.xsd
::     C:\Windows\schemas\availablenetwork\availablenetworkinfo.xsd
::     C:\Windows\system32\certutil.exe
::     C:\Windows\system32\wlanapi.dll
::     C:\Windows\system32\wlancfg.dll
::     C:\Windows\system32\wlanhlp.dll
::     C:\Windows\system32\wlanmsm.dll
::     C:\Windows\system32\wlansec.dll
::     C:\Windows\system32\wlansvc.dll
::     C:\Windows\system32\wlanui.dll
::     C:\Windows\system32\wlgpclnt.dll
::     C:\Windows\system32\drivers\nwifi.sys
::     C:\Windows\system32\drivers\vwififlt.sys
::     C:\Windows\system32\drivers\vwifimp.sys
::     C:\Windows\system32\Drivers\vwifibus.sys
::     C:\Windows\system32\en-US\certutil.exe.mui (or your locale's equivalent)
::     C:\Windows\system32\en-us\wlanapi.dll.mui
::     C:\Windows\system32\en-us\wlancfg.dll.mui
::     C:\Windows\system32\en-us\wlansvc.dll.mui
::     C:\Windows\system32\en-us\wlanui.dll.mui
::     C:\Windows\system32\en-us\wlgpclnt.dll.mui
 
 
 
At one point I had Wlansvc starting but couldn't see any network devices (Including wired, which works fine before these changes).
Right now with this setup I'm getting system error 2 when I try to start wlansvc, but I'm still having the same problem that after all of this I can't see my ethernet interface either.

Any suggestions here?
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.