网上看到的,有时间的网友可以试试(本人没有测试过),只是照搬过来的
Enabling A2DP & AVRCP Bluetooth Profiles in Windows Server 2022
Instruction
-2. Backup (optional) I recommend using "vssadmin create shadow /for=" to create backup and boot into the secondary OS and use "vssadmin revert shadow" to restore.
-1. Pair the Bluetooth audio device you want to use
0. Reboot your Windows 2022 and select disable driver signature enforcement option in boot menu (F8)
1. Please note your current build of Windows 2022 by running "winver". The build I have for example is 20348. Let's reference this number as `Target_Build`.
2. Driver extraction (skip if you have access to Bluetooth_WS2022.zip) Find and download the release version of Windows 10 with build number between (including) 19041 and `Target_Build`(20348). You need to use the public version of Windows as Insider Preview builds do not have the valid signatures that are recognized by public Windows builds.
It looks like even the newest builds like 19044.1288 still have the same drivers as 19041 so practically you can use anything between 19041 and 19044.
From this image we will take following drivers (from \Windows\System32\DriverStore\FileRepository): btampm.inf_amd64\ microsoft_bluetooth_a2dp.inf_amd64\ microsoft_bluetooth_a2dp_snk.inf_amd64\ microsoft_bluetooth_a2dp_src.inf_amd64\ microsoft_bluetooth_avrcptransport.inf_amd64\ microsoft_bluetooth_hfp.inf_amd64\ microsoft_bluetooth_hfp_ag.inf_amd64\ microsoft_bluetooth_hfp_hf.inf_amd64\
Please note that microsoft system drivers do not include catalog file, so we also need to get the right catalog file from \Windows\System32\CatRoot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE\. Usually the file name looks like Microsoft-Windows-Client-Desktop-Required-Package~31bf3856ad364e35~amd64~~10.0.1904?.*.cat and is around 200Kb in size. The right catalog file can be found by using "signtool" from Visual Studio command line prompt: for %i in (*.cat) do @signtool verify /c %i “path_to_btampm_sys” && echo %i
You would need to merge all mentioned drivers and prepare a single .inf file and add CatalogFile entry with the reference to the catalog file.
3. Services extraction Find and download any version (including Insider Preview builds) of Windows 10 or Windows 11 with the closest build number that does not exceed `Target_Build`(20348).
For this step we cannot use the Windows build (19041) from step 2 as many interfaces have been changed and the extracted services won't work with the rest of the system and will crash.
The closest build that exists is 20279: https://blogs.windows.com/windows-insider/2020/12/14/announcing-windows-10-insider-preview-build-20279/
From this image (or from Bluetooth_WS2022.zip) we will take services, dlls (copy them into \Windows\System32) and mui files (copy them into \Windows\System32\en-US):
BTAGService.dll BTAGService.dll.mui BthAvctpSvc.dll BthAvctpSvc.dll.mui BthAvrcp.dll BthAvrcpAppSvc.dll
Some resource files are better to take from \Windows\WinSxS and put into \Windows\System32 (copy only files not the directories):
4. Import registry settings The required registry entries can be found in Bluetooth_WS2022.zip. The assumption is that Windows is installed into C:\Windows\, if not update the *.reg files accordingly.
You will have problems with importing HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime keys, so you need to grant write access to ./Administrators group and restore ownership at the end to "NT SERVICE\TrustedInstaller".
Make sure to import HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Bluetooth\Audio entries. Without those entries the drivers will fail to start. (they are referenced from BthHfEnum.sys and BthA2dp.sys https://www.hybrid-analysis.com/sample/8b0f65f411c463cbc68b8039d4795a3d3a356f6f18ff165f2c14439bd8fb569a?environmentId=120)
and finally update "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost\" and add following lines to multi-string (REG_MULTI_SZ) values: BthAppGroup = BluetoothUserService LocalService += bthavctpsvc LocalServiceNetworkRestricted += btagservice
+= operator means that the value already exists and you have to add an additional line. = means that you have to create the value first.
5. Install drivers Force install drivers prepared at step 2 for 4 devices: Audio Sink Service, Handsfree Handsfree Service and 2 Bluetooth peripheral devices (make sure that you group devices by connection and show hidden devices to ensure that you don't miss anything). You need to click the red "install" button as the .inf file you've created is not signed (this is not a big deal as the .sys files themselves are signed).
6. Reboot. if everything was done correctly, you should have working bluetooth headphones and driver signature enforcement should be enabled.
Every time you want to connect a new AVRCP device, you will have to repeat steps 0, 5, 6 to install drivers without the signed .inf file.But after reboot the installed drivers will function normally.
|