Launch Manager is a utility allowing users to turn on and off their notebook’s wireless device (typically bluetooth and wifi) via software. Once turned off, the device is disabled and cannot be seen via Windows Device Manager. By default, if neither Launch Manager or Acer ePower Management is installed, wifi is on and bluetooth is off. The objective is to investigate what Launch Manager does in the back end in order to enable/disable Wifi.
Launch Manager installs itself into C:Program FilesLaunch Manager. By using IDA (The Interactive Disassembler), the following was observed.
HotkeyApp.exe is the main Launch Manager UI. It monitors the status of the Bluetooth and Wifi hardware button. If a button is pressed, HotKeyApp will post a message to Wbutton.exe (provided that Wbutton.exe is already running). Wbutton will then use DeviceIOControl to interact with the hardware and call OSD.EXE with the following command line parameters to display the device status on screen (e.g. Bluetooth is disabled):
- OSD.EXE 20: “Bluetooth Disabled” is displayed.
- OSD.EXE 19: “Bluetooth Enabled” is displayed.
- OSD.EXE 18: “Wireless LAN Disabled” is displayed.
- OSD.EXE 17: “Wireless LAN Enabled” is displayed.
OSD.EXE only displays the status and does not interact with the hardware layer.
To toggle Wifi/Bluetooth status, there are 2 approaches
1. Run Wbutton.exe, PostMessage to Wbutton.exe and rely on it to do the rest.
HWND hwndWButtion = FindWindow(L”Wireless class”, NULL);
if (hwndWButtion) PostMessage(hwndWButtion, 0x800A, 0, 1); //toggle bluetooth
if (hwndWButtion) PostMessage(hwndWButtion, 0x800A, 0, 0); //toggle wifi
2. Call DeviceIOControl directly using the following code. This approach does not need Wbutton.exe
//obtain a handle to the wireless driver
HANDLE hWireless = CreateFile(L”\\.\Hotkey”, 0x80000000, 1, NULL, 3, 0, NULL);
//tell the driver which device (bluetooth/wifi) to control
//send control code. Notice the magic IOCTL number.
BOOL isOK = DeviceIoControl(hWireless, 0x2224C4, (void*) inBuffer, 2, (void*) outBuffer, 2, &bytesRet, NULL);
inBuffer defines which device to set status for. Use the following values:
- inBuffer=inBuffer=0 to turn off bluetooth
- inBuffer=inBuffer=1 to turn on wifi
- inBuffer=0; inBuffer=1 to turn on bluetooth
- inBuffer=1; inBuffer=0 to turn off wifi
There is no OEM API to retrieve the wireless device status. To synchronise the status, the Launch Manager simply turns on or turns off all wireless devices upon startup according to the settings.
Download source code here