mirror of
https://github.com/VARCem/munt.git
synced 2026-07-08 18:16:13 +00:00
Further improved mt32emu_win32drv installation helper
- mt32emu.inf file now contains a made up hardware ID so that it can now be installed using a convenient function designed for PnP devices - drvsetup now prevents adding multiple devices in the PnP manager when installing, yet it now cleans up the device entry during uninstall - added a new project infinstall into mt32emu_win32drv_setup which performs "proper" installation and uninstallation of the MIDI driver using the PnP manager functions; the main purpose is to save the user from dealing with the Windows Add new hardware wizard that became tedious enough
This commit is contained in:
@@ -25,7 +25,7 @@ and is able to operate in stand-alone mode if the main application mt32emu_qt is
|
||||
|
||||
mt32emu_win32drv_setup
|
||||
======================
|
||||
A tool intended to fascilitate installation / upgrade of the Windows driver mt32emu_win32drv.
|
||||
Helper tools intended to facilitate installation / upgrade of the Windows driver mt32emu_win32drv.
|
||||
|
||||
mt32emu_qt
|
||||
==========
|
||||
|
||||
@@ -3,25 +3,25 @@ Signature = "$WINDOWS NT$"
|
||||
Class = MEDIA
|
||||
ClassGUID = "{4d36e96c-e325-11ce-bfc1-08002be10318}"
|
||||
Provider = %muntemuProvider%
|
||||
DriverVer = 06/06/2020, 1.5.0.0
|
||||
DriverVer = 06/13/2020, 1.5.0.0
|
||||
CatalogFile = mt32emu.cat
|
||||
|
||||
[Manufacturer]
|
||||
%muntemuMfg% = muntemuMfg, ntamd64
|
||||
|
||||
[muntemuMfg]
|
||||
%mt32emu.DeviceDesc% = mt32emu
|
||||
%mt32emu.DeviceDesc% = mt32emu, ROOT\mt32emu
|
||||
|
||||
[muntemuMfg.ntamd64]
|
||||
%mt32emu.DeviceDesc% = mt32emu.ntamd64
|
||||
%mt32emu.DeviceDesc% = mt32emu.ntamd64, ROOT\mt32emu
|
||||
|
||||
[mt32emu.ntx86]
|
||||
DriverVer = 06/03/2020, 1.5.0.0
|
||||
DriverVer = 06/13/2020, 1.5.0.0
|
||||
AddReg = mt32emu.AddReg
|
||||
CopyFiles = mt32emu.CopyFiles.User.x86
|
||||
|
||||
[mt32emu.ntamd64]
|
||||
DriverVer = 06/03/2020, 1.5.0.0
|
||||
DriverVer = 06/13/2020, 1.5.0.0
|
||||
AddReg = mt32emu.AddReg
|
||||
CopyFiles = mt32emu.CopyFiles.User.x64
|
||||
CopyFiles = mt32emu.CopyFiles.User.wow6432
|
||||
|
||||
11
mt32emu_win32drv_setup/README.md
Normal file
11
mt32emu_win32drv_setup/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
drvsetup
|
||||
========
|
||||
A helper tool capable of installing / upgrading the Windows driver mt32emu_win32drv and registering
|
||||
in the system (in some non-standard way which may fail occasionally).
|
||||
|
||||
infinstall
|
||||
==========
|
||||
A helper tool intended to make simple the standard tedious way of the mt32emu_win32drv MIDI Windows
|
||||
driver installation using the .inf file. It doesn't attempt to deal with the default Windows driver
|
||||
signing policy, but only eliminates the need to use all those boring wizards for manual
|
||||
installation of non-PnP devices on Windows.
|
||||
@@ -34,6 +34,8 @@ const char PATH_SEPARATOR[] = "\\";
|
||||
const char DEVICE_NAME_MEDIA[] = "MEDIA";
|
||||
const char DEVICE_DESCRIPTION[] = "MT-32 Synth Emulator";
|
||||
const char DRIVER_PROVIDER_NAME[] = "muntemu.org";
|
||||
const char DEVICE_HARDWARE_IDS[] = "ROOT\\mt32emu\0";
|
||||
|
||||
const char DRIVER_CLASS_PROP_DRIVER_DESC[] = "DriverDesc";
|
||||
const char DRIVER_CLASS_PROP_PROVIDER_NAME[] = "ProviderName";
|
||||
const char DRIVER_CLASS_SUBKEY_DRIVERS[] = "Drivers";
|
||||
@@ -59,6 +61,7 @@ const char CANNOT_REGISTER_ERR[] = "Cannot register driver";
|
||||
const char CANNOT_REGISTER_32_ERR[] = "Cannot register 32-bit driver";
|
||||
const char CANNOT_REGISTER_CLASS_ERR[] = "Cannot register driver class";
|
||||
const char CANNOT_REGISTER_DEVICE_ERR[] = "Cannot register device";
|
||||
const char CANNOT_REMOVE_DEVICE_ERR[] = "Cannot remove device";
|
||||
const char CANNOT_UNINSTALL_ERR[] = "Cannot uninstall MT32Emu MIDI driver";
|
||||
const char CANNOT_UNINSTALL_32_ERR[] = "Cannot uninstall 32-bit MT32Emu MIDI driver";
|
||||
const char CANNOT_UNINSTALL_NOT_FOUND_ERR[] = "Cannot uninstall MT32Emu MIDI driver:\n There is no driver registry entry found";
|
||||
@@ -78,7 +81,8 @@ enum ProcessReturnCode {
|
||||
ProcessReturnCode_ERR_REGISTERING_DRIVER = 3,
|
||||
ProcessReturnCode_ERR_COPYING_FILE = 4,
|
||||
ProcessReturnCode_ERR_REGISTERING_DRIVER_CLASS = 5,
|
||||
ProcessReturnCode_ERR_REGISTERING_DEVICE = 6
|
||||
ProcessReturnCode_ERR_REGISTERING_DEVICE = 6,
|
||||
ProcessReturnCode_ERR_REMOVING_DEVICE = 7
|
||||
};
|
||||
|
||||
enum OperationMode {
|
||||
@@ -94,6 +98,12 @@ enum RegisterDriverResult {
|
||||
RegisterDriverResult_ALREADY_EXISTS
|
||||
};
|
||||
|
||||
enum FindDeviceResult {
|
||||
FindDeviceResult_FOUND,
|
||||
FindDeviceResult_NOT_FOUND,
|
||||
FindDeviceResult_FAILED
|
||||
};
|
||||
|
||||
class MidiRegistryEntryName {
|
||||
public:
|
||||
MidiRegistryEntryName() {
|
||||
@@ -245,18 +255,18 @@ static void unregisterDriverInWow(const char *mt32emuEntryName) {
|
||||
}
|
||||
}
|
||||
|
||||
static void unregisterDriver(const bool wow64Process) {
|
||||
static bool unregisterDriver(const bool wow64Process) {
|
||||
HKEY hReg;
|
||||
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, DRIVERS_REGISTRY_KEY, 0L, (wow64Process ? (KEY_ALL_ACCESS | KEY_WOW64_64KEY) : KEY_ALL_ACCESS), &hReg)) {
|
||||
MessageBoxA(NULL, CANNOT_OPEN_REGISTRY_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
MidiRegistryEntryName entryName;
|
||||
const int entryIx = findMt32emuRegEntry(hReg, entryName);
|
||||
if (entryIx == -1) {
|
||||
MessageBoxA(NULL, CANNOT_UNINSTALL_NOT_FOUND_ERR, ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
RegCloseKey(hReg);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
const char *mt32emuEntryName = entryName.withIndex(entryIx)->toCString();
|
||||
LSTATUS res = RegDeleteValueA(hReg, mt32emuEntryName);
|
||||
@@ -266,8 +276,9 @@ static void unregisterDriver(const bool wow64Process) {
|
||||
}
|
||||
if (res != ERROR_SUCCESS) {
|
||||
MessageBoxA(NULL, CANNOT_UNINSTALL_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return false;
|
||||
}
|
||||
MessageBoxA(NULL, SUCCESSFULLY_UNINSTALLED_MSG, INFORMATION_TITLE, MB_OK | MB_ICONINFORMATION);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void constructFullSystemDirName(char *pathName, const char *systemDirName) {
|
||||
@@ -352,34 +363,67 @@ static bool registerDriverClass(HKEY devRegKey, int legacyMidiEntryIx) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static ProcessReturnCode registerDeviceAndDriverClass(int legacyMidiEntryIx) {
|
||||
HDEVINFO hDevInfo = SetupDiGetClassDevsA(&GUID_DEVCLASS_MEDIA, NULL, NULL, 0);
|
||||
static FindDeviceResult findMt32emuDevice(HDEVINFO &hDevInfo, SP_DEVINFO_DATA &deviceInfoData) {
|
||||
char hardwareId[1024];
|
||||
for (int deviceIx = 0; SetupDiEnumDeviceInfo(hDevInfo, deviceIx, &deviceInfoData); ++deviceIx) {
|
||||
if (!SetupDiGetDeviceRegistryPropertyA(hDevInfo, &deviceInfoData, SPDRP_HARDWAREID, NULL, (BYTE *)hardwareId, sizeof(hardwareId), NULL)) continue;
|
||||
if (!strncmp(hardwareId, DEVICE_HARDWARE_IDS, sizeof(DEVICE_HARDWARE_IDS) + 1)) return FindDeviceResult_FOUND;
|
||||
}
|
||||
return ERROR_NO_MORE_ITEMS == GetLastError() ? FindDeviceResult_NOT_FOUND : FindDeviceResult_FAILED;
|
||||
}
|
||||
|
||||
static ProcessReturnCode registerDevice(HDEVINFO &hDevInfo, SP_DEVINFO_DATA &deviceInfoData, bool wow64Process) {
|
||||
hDevInfo = SetupDiGetClassDevsA(&GUID_DEVCLASS_MEDIA, NULL, NULL, 0);
|
||||
if (INVALID_HANDLE_VALUE == hDevInfo) {
|
||||
MessageBoxA(NULL, CANNOT_REGISTER_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REGISTERING_DEVICE;
|
||||
}
|
||||
|
||||
SP_DEVINFO_DATA deviceInfoData;
|
||||
deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
|
||||
FindDeviceResult findDeviceResult = findMt32emuDevice(hDevInfo, deviceInfoData);
|
||||
if (FindDeviceResult_FAILED == findDeviceResult) return ProcessReturnCode_ERR_REGISTERING_DEVICE;
|
||||
if (FindDeviceResult_FOUND == findDeviceResult) return ProcessReturnCode_OK;
|
||||
|
||||
if (!SetupDiCreateDeviceInfoA(hDevInfo, DEVICE_NAME_MEDIA, &GUID_DEVCLASS_MEDIA, DEVICE_DESCRIPTION, NULL, DICD_GENERATE_ID, &deviceInfoData)) {
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
MessageBoxA(NULL, CANNOT_REGISTER_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REGISTERING_DEVICE;
|
||||
}
|
||||
if (!SetupDiRegisterDeviceInfo(hDevInfo, &deviceInfoData, 0, NULL, NULL, NULL)) {
|
||||
if (!SetupDiSetDeviceRegistryPropertyA(hDevInfo, &deviceInfoData, SPDRP_HARDWAREID, (BYTE *)DEVICE_HARDWARE_IDS, sizeof(DEVICE_HARDWARE_IDS))) {
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
MessageBoxA(NULL, CANNOT_REGISTER_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REGISTERING_DEVICE;
|
||||
}
|
||||
|
||||
// The proper way to register device in PnP manager is to call SetupDiCallClassInstaller but that doesn't work in WOW.
|
||||
BOOL deviceRegistrationResult;
|
||||
if (wow64Process) {
|
||||
deviceRegistrationResult = SetupDiRegisterDeviceInfo(hDevInfo, &deviceInfoData, 0, NULL, NULL, NULL);
|
||||
} else {
|
||||
deviceRegistrationResult = SetupDiCallClassInstaller(DIF_REGISTERDEVICE, hDevInfo, &deviceInfoData);
|
||||
}
|
||||
if (!deviceRegistrationResult) {
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
MessageBoxA(NULL, CANNOT_REGISTER_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REGISTERING_DEVICE;
|
||||
}
|
||||
return ProcessReturnCode_OK;
|
||||
}
|
||||
|
||||
static ProcessReturnCode registerDeviceAndDriverClass(bool wow64Process, int legacyMidiEntryIx) {
|
||||
HDEVINFO hDevInfo;
|
||||
SP_DEVINFO_DATA deviceInfoData;
|
||||
deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
|
||||
|
||||
ProcessReturnCode returnCode = registerDevice(hDevInfo, deviceInfoData, wow64Process);
|
||||
if (ProcessReturnCode_OK != returnCode) return returnCode;
|
||||
|
||||
DWORD configClass = CONFIGFLAG_MANUAL_INSTALL | CONFIGFLAG_NEEDS_FORCED_CONFIG;
|
||||
if (!SetupDiSetDeviceRegistryPropertyA(hDevInfo, &deviceInfoData, SPDRP_CONFIGFLAGS, (BYTE *)&configClass, sizeof(configClass))) {
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
MessageBoxA(NULL, CANNOT_REGISTER_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REGISTERING_DEVICE;
|
||||
}
|
||||
if (!SetupDiSetDeviceRegistryPropertyA(hDevInfo, &deviceInfoData, SPDRP_MFG, (BYTE *)&DRIVER_PROVIDER_NAME, sizeof(DRIVER_PROVIDER_NAME))) {
|
||||
if (!SetupDiSetDeviceRegistryPropertyA(hDevInfo, &deviceInfoData, SPDRP_MFG, (BYTE *)DRIVER_PROVIDER_NAME, sizeof(DRIVER_PROVIDER_NAME))) {
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
MessageBoxA(NULL, CANNOT_REGISTER_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REGISTERING_DEVICE;
|
||||
@@ -401,6 +445,43 @@ static ProcessReturnCode registerDeviceAndDriverClass(int legacyMidiEntryIx) {
|
||||
return ProcessReturnCode_OK;
|
||||
}
|
||||
|
||||
static ProcessReturnCode removeDevice(bool wow64Process) {
|
||||
HDEVINFO hDevInfo;
|
||||
SP_DEVINFO_DATA deviceInfoData;
|
||||
deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
|
||||
|
||||
hDevInfo = SetupDiGetClassDevsA(&GUID_DEVCLASS_MEDIA, NULL, NULL, 0);
|
||||
if (INVALID_HANDLE_VALUE == hDevInfo) {
|
||||
MessageBoxA(NULL, CANNOT_REMOVE_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REMOVING_DEVICE;
|
||||
}
|
||||
|
||||
FindDeviceResult findDeviceResult = findMt32emuDevice(hDevInfo, deviceInfoData);
|
||||
if (FindDeviceResult_FAILED == findDeviceResult) {
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
MessageBoxA(NULL, CANNOT_REMOVE_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REMOVING_DEVICE;
|
||||
}
|
||||
if (FindDeviceResult_NOT_FOUND == findDeviceResult) {
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
MessageBoxA(NULL, CANNOT_REMOVE_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_OK;
|
||||
}
|
||||
|
||||
// The proper way to remove device in PnP manager is to call SetupDiCallClassInstaller but that doesn't work in WOW.
|
||||
BOOL deviceRemovalResult;
|
||||
if (wow64Process) {
|
||||
deviceRemovalResult = SetupDiRemoveDevice(hDevInfo, &deviceInfoData);
|
||||
} else {
|
||||
deviceRemovalResult = SetupDiCallClassInstaller(DIF_REMOVE, hDevInfo, &deviceInfoData);
|
||||
}
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
if (!deviceRemovalResult) {
|
||||
MessageBoxA(NULL, CANNOT_REMOVE_DEVICE_ERR, REGISTRY_ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
}
|
||||
return ProcessReturnCode_OK;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
bool wow64Process = isWow64Process();
|
||||
|
||||
@@ -425,13 +506,9 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
int legacyMidiEntryIx;
|
||||
const RegisterDriverResult registerDriverResult = registerDriver(wow64Process, legacyMidiEntryIx);
|
||||
if (registerDriverResult == RegisterDriverResult_FAILED) {
|
||||
return ProcessReturnCode_ERR_REGISTERING_DRIVER;
|
||||
}
|
||||
ProcessReturnCode returnCode = registerDeviceAndDriverClass(legacyMidiEntryIx);
|
||||
if (ProcessReturnCode_OK != returnCode) {
|
||||
return returnCode;
|
||||
}
|
||||
if (registerDriverResult == RegisterDriverResult_FAILED) return ProcessReturnCode_ERR_REGISTERING_DRIVER;
|
||||
ProcessReturnCode returnCode = registerDeviceAndDriverClass(wow64Process, legacyMidiEntryIx);
|
||||
if (ProcessReturnCode_OK != returnCode) return returnCode;
|
||||
char setupPath[MAX_PATH + 1];
|
||||
if (pathDelimPosition == NULL) {
|
||||
GetCurrentDirectoryA(sizeof(setupPath), setupPath);
|
||||
@@ -470,7 +547,10 @@ int main(int argc, char *argv[]) {
|
||||
} else {
|
||||
deleteDriverFile(pathName, SYSTEM_DIR_NAME);
|
||||
}
|
||||
unregisterDriver(wow64Process);
|
||||
if (!unregisterDriver(wow64Process)) return ProcessReturnCode_OK;
|
||||
ProcessReturnCode returnCode = removeDevice(wow64Process);
|
||||
if (ProcessReturnCode_OK != returnCode) return returnCode;
|
||||
MessageBoxA(NULL, SUCCESSFULLY_UNINSTALLED_MSG, INFORMATION_TITLE, MB_OK | MB_ICONINFORMATION);
|
||||
return ProcessReturnCode_OK;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="mt32emu_win32drv_setup"
|
||||
Version="9.00"
|
||||
Name="drvsetup"
|
||||
ProjectGUID="{865C8AAD-4B25-498F-B311-AEDB80898983}"
|
||||
RootNamespace="mt32emu_win32drv_setup"
|
||||
RootNamespace="drvsetup"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
@@ -63,11 +63,12 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="setupapi.lib"
|
||||
LinkIncremental="2"
|
||||
UACExecutionLevel="2"
|
||||
UACUIAccess="true"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
SubSystem="2"
|
||||
EntryPointSymbol="mainCRTStartup"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
@@ -137,7 +138,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\drvsetup.exe"
|
||||
AdditionalDependencies="setupapi.lib"
|
||||
LinkIncremental="1"
|
||||
UACExecutionLevel="2"
|
||||
GenerateDebugInformation="true"
|
||||
@@ -214,7 +215,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\drvsetup.exe"
|
||||
LinkIncremental="1"
|
||||
UACExecutionLevel="2"
|
||||
GenerateDebugInformation="true"
|
||||
@@ -255,11 +255,11 @@
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\munt\mt32emu_win32drv_setup\mt32emu_win32drv_setup.cpp"
|
||||
RelativePath="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\drvsetup.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\munt\mt32emu_win32drv_setup\stdafx.cpp"
|
||||
RelativePath="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
@@ -277,7 +277,7 @@
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\munt\mt32emu_win32drv_setup\stdafx.h"
|
||||
RelativePath="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
172
mt32emu_win32drv_setup/drvsetup/drvsetup.vcxproj
Normal file
172
mt32emu_win32drv_setup/drvsetup/drvsetup.vcxproj
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{865C8AAD-4B25-498F-B311-AEDB80898983}</ProjectGuid>
|
||||
<RootNamespace>drvsetup</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>15.0.28307.799</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\x64\$(Configuration)\</OutDir>
|
||||
<IntDir>x64\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<Optimization>Disabled</Optimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\drvsetup.cpp" />
|
||||
<ClCompile Include="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\stdafx.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
26
mt32emu_win32drv_setup/drvsetup/drvsetup.vcxproj.filters
Normal file
26
mt32emu_win32drv_setup/drvsetup/drvsetup.vcxproj.filters
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\drvsetup.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\munt\mt32emu_win32drv_setup\drvsetup\stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -7,7 +7,6 @@
|
||||
#define _WIN32_WINNT 0x0500
|
||||
|
||||
#include <windows.h>
|
||||
#include <iostream>
|
||||
#include <Setupapi.h>
|
||||
#include <Devguid.h>
|
||||
#include <RegStr.h>
|
||||
200
mt32emu_win32drv_setup/infinstall/infinstall.cpp
Normal file
200
mt32emu_win32drv_setup/infinstall/infinstall.cpp
Normal file
@@ -0,0 +1,200 @@
|
||||
/* Copyright (C) 2020 Sergey V. Mikayev
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
const char INSTALL_COMMAND[] = "install";
|
||||
const char UNINSTALL_COMMAND[] = "uninstall";
|
||||
const char PATH_SEPARATOR[] = "\\";
|
||||
|
||||
const char DEVICE_NAME_MEDIA[] = "MEDIA";
|
||||
const char DEVICE_DESCRIPTION[] = "MT-32 Synth Emulator";
|
||||
const char DEVICE_HARDWARE_IDS[] = "ROOT\\mt32emu\0";
|
||||
const char DRIVER_INF_FILE_NAME[] = "mt32emu.inf";
|
||||
|
||||
const char SUCCESSFULLY_INSTALLED_MSG[] = "MT32Emu MIDI Driver successfully installed";
|
||||
const char SUCCESSFULLY_UPDATED_MSG[] = "MT32Emu MIDI Driver successfully updated";
|
||||
const char SUCCESSFULLY_UNINSTALLED_MSG[] = "MT32Emu MIDI Driver successfully uninstalled";
|
||||
const char USAGE_MSG[] = "Usage:\n\n"
|
||||
" infinstall install - install or update driver\n"
|
||||
" infinstall uninstall - uninstall driver";
|
||||
|
||||
const char CANNOT_REGISTER_DEVICE_ERR_FMT[] = "Cannot register device\n Error while %s: %0x";
|
||||
const char CANNOT_INSTALL_DRIVER_ERR_FMT[] = "Cannot install MT32Emu MIDI Driver\n Error: %0x";
|
||||
const char CANNOT_INSTALL_PATH_TOO_LONG_ERR[] = "MT32Emu MIDI Driver cannot be installed:\n Installation path is too long";
|
||||
const char CANNOT_REMOVE_DEVICE_ERR_FMT[] = "Cannot uninstalled device\n Error while %s: %0x";
|
||||
const char CANNOT_UNINSTALL_NOT_FOUND[] = "MT32Emu MIDI Driver cannot be uninstalled:\n Compatible devices not found";
|
||||
|
||||
const char INFORMATION_TITLE[] = "Information";
|
||||
const char ERROR_TITLE[] = "Error";
|
||||
|
||||
const char *registerDeviceStageName[] = {
|
||||
"getting class devices", "enumerating devices", "creating device info", "setting device property", "registering device in PnP manager"
|
||||
};
|
||||
|
||||
const char *removeDeviceStageName[] = {
|
||||
"getting class devices", "enumerating devices", "removing device from PnP manager"
|
||||
};
|
||||
|
||||
enum ProcessReturnCode {
|
||||
ProcessReturnCode_OK = 0,
|
||||
ProcessReturnCode_ERR_UNRECOGNISED_OPERATION_MODE = 1,
|
||||
ProcessReturnCode_ERR_PATH_TOO_LONG = 2,
|
||||
ProcessReturnCode_ERR_REGISTERING_DEVICE = 3,
|
||||
ProcessReturnCode_ERR_INSTALLING_DRIVER = 4,
|
||||
ProcessReturnCode_ERR_UNINSTALLING_DRIVER = 5
|
||||
};
|
||||
|
||||
enum RegisterDeviceResult {
|
||||
RegisterDeviceResult_OK,
|
||||
RegisterDeviceResult_ALREADY_EXISTS,
|
||||
RegisterDeviceResult_GET_DEV_INFOS_ERROR,
|
||||
RegisterDeviceResult_FIND_DEVICE_ERROR,
|
||||
RegisterDeviceResult_CREATE_DEV_INFO_ERROR,
|
||||
RegisterDeviceResult_SET_DEVICE_PROPERTY_ERROR,
|
||||
RegisterDeviceResult_REGISTER_DEVICE_ERROR
|
||||
};
|
||||
|
||||
enum RemoveDeviceResult {
|
||||
RemoveDeviceResult_OK,
|
||||
RemoveDeviceResult_NOT_FOUND,
|
||||
RemoveDeviceResult_GET_DEV_INFOS_ERROR,
|
||||
RemoveDeviceResult_FIND_DEVICE_ERROR,
|
||||
RemoveDeviceResult_REMOVE_DEVICE_ERROR
|
||||
};
|
||||
|
||||
enum FindDeviceResult {
|
||||
FindDeviceResult_FOUND,
|
||||
FindDeviceResult_NOT_FOUND,
|
||||
FindDeviceResult_FAILED
|
||||
};
|
||||
|
||||
static bool createFullInfPath(char *fullInfPath, const char *appLaunchPath) {
|
||||
const char *pathDelimPosition = strrchr(appLaunchPath, PATH_SEPARATOR[0]);
|
||||
int setupPathLen = int(pathDelimPosition - appLaunchPath);
|
||||
if (pathDelimPosition != NULL && setupPathLen > MAX_PATH - sizeof(DRIVER_INF_FILE_NAME) - 2) return false;
|
||||
char infPath[MAX_PATH + 1];
|
||||
if (pathDelimPosition == NULL) {
|
||||
if (GetCurrentDirectoryA(sizeof(infPath), infPath) > MAX_PATH - sizeof(DRIVER_INF_FILE_NAME) - 2) return false;
|
||||
} else {
|
||||
strncpy(infPath, appLaunchPath, setupPathLen);
|
||||
infPath[setupPathLen] = 0;
|
||||
}
|
||||
strncat(infPath, PATH_SEPARATOR, MAX_PATH - strlen(infPath));
|
||||
strncat(infPath, DRIVER_INF_FILE_NAME, MAX_PATH - strlen(infPath));
|
||||
return GetFullPathNameA(infPath, MAX_PATH, fullInfPath, NULL) < MAX_PATH;
|
||||
}
|
||||
|
||||
static FindDeviceResult findMt32emuDevice(HDEVINFO &hDevInfo, SP_DEVINFO_DATA &deviceInfoData) {
|
||||
char hardwareId[1024];
|
||||
for (int deviceIx = 0; SetupDiEnumDeviceInfo(hDevInfo, deviceIx, &deviceInfoData); ++deviceIx) {
|
||||
if (!SetupDiGetDeviceRegistryPropertyA(hDevInfo, &deviceInfoData, SPDRP_HARDWAREID, NULL, (BYTE *)hardwareId, sizeof(hardwareId), NULL)) continue;
|
||||
if (!strncmp(hardwareId, DEVICE_HARDWARE_IDS, sizeof(DEVICE_HARDWARE_IDS) + 1)) return FindDeviceResult_FOUND;
|
||||
}
|
||||
return ERROR_NO_MORE_ITEMS == GetLastError() ? FindDeviceResult_NOT_FOUND : FindDeviceResult_FAILED;
|
||||
}
|
||||
|
||||
static RegisterDeviceResult registerDevice(HDEVINFO &hDevInfo) {
|
||||
SP_DEVINFO_DATA deviceInfoData;
|
||||
deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
|
||||
|
||||
hDevInfo = SetupDiGetClassDevsA(&GUID_DEVCLASS_MEDIA, NULL, NULL, 0);
|
||||
if (INVALID_HANDLE_VALUE == hDevInfo) return RegisterDeviceResult_GET_DEV_INFOS_ERROR;
|
||||
FindDeviceResult findDeviceResult = findMt32emuDevice(hDevInfo, deviceInfoData);
|
||||
if (FindDeviceResult_FAILED == findDeviceResult) return RegisterDeviceResult_FIND_DEVICE_ERROR;
|
||||
if (FindDeviceResult_FOUND == findDeviceResult) return RegisterDeviceResult_ALREADY_EXISTS;
|
||||
if (!SetupDiCreateDeviceInfoA(hDevInfo, DEVICE_NAME_MEDIA, &GUID_DEVCLASS_MEDIA, DEVICE_DESCRIPTION, NULL, DICD_GENERATE_ID, &deviceInfoData)) return RegisterDeviceResult_CREATE_DEV_INFO_ERROR;
|
||||
if (!SetupDiSetDeviceRegistryPropertyA(hDevInfo, &deviceInfoData, SPDRP_HARDWAREID, (BYTE *)DEVICE_HARDWARE_IDS, sizeof(DEVICE_HARDWARE_IDS))) return RegisterDeviceResult_SET_DEVICE_PROPERTY_ERROR;
|
||||
if (!SetupDiCallClassInstaller(DIF_REGISTERDEVICE, hDevInfo, &deviceInfoData)) return RegisterDeviceResult_REGISTER_DEVICE_ERROR;
|
||||
return RegisterDeviceResult_OK;
|
||||
}
|
||||
|
||||
static ProcessReturnCode infInstall(char *fullInfPath) {
|
||||
HDEVINFO hDevInfo;
|
||||
|
||||
RegisterDeviceResult registerDeviceResult = registerDevice(hDevInfo);
|
||||
if (RegisterDeviceResult_GET_DEV_INFOS_ERROR <= registerDeviceResult) {
|
||||
DWORD errorCode = GetLastError();
|
||||
if (INVALID_HANDLE_VALUE != hDevInfo) SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
char message[1024];
|
||||
wsprintfA(message, CANNOT_REGISTER_DEVICE_ERR_FMT, registerDeviceStageName[registerDeviceResult - RegisterDeviceResult_GET_DEV_INFOS_ERROR], errorCode);
|
||||
MessageBoxA(NULL, message, ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_REGISTERING_DEVICE;
|
||||
}
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
|
||||
BOOL rebootRequired = FALSE;
|
||||
if (!UpdateDriverForPlugAndPlayDevicesA(NULL, DEVICE_HARDWARE_IDS, fullInfPath, 0, &rebootRequired)) {
|
||||
DWORD errorCode = GetLastError();
|
||||
char message[1024];
|
||||
wsprintfA(message, CANNOT_INSTALL_DRIVER_ERR_FMT, errorCode);
|
||||
MessageBoxA(NULL, message, ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_INSTALLING_DRIVER;
|
||||
}
|
||||
|
||||
const char *message = RegisterDeviceResult_ALREADY_EXISTS == registerDeviceResult ? SUCCESSFULLY_UPDATED_MSG : SUCCESSFULLY_INSTALLED_MSG;
|
||||
MessageBoxA(NULL, message, INFORMATION_TITLE, MB_OK | MB_ICONINFORMATION);
|
||||
return ProcessReturnCode_OK;
|
||||
}
|
||||
|
||||
static RemoveDeviceResult removeDevice(HDEVINFO &hDevInfo) {
|
||||
SP_DEVINFO_DATA deviceInfoData;
|
||||
deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
|
||||
|
||||
hDevInfo = SetupDiGetClassDevsA(&GUID_DEVCLASS_MEDIA, NULL, NULL, 0);
|
||||
if (INVALID_HANDLE_VALUE == hDevInfo) return RemoveDeviceResult_GET_DEV_INFOS_ERROR;
|
||||
FindDeviceResult findDeviceResult = findMt32emuDevice(hDevInfo, deviceInfoData);
|
||||
if (FindDeviceResult_FAILED == findDeviceResult) return RemoveDeviceResult_FIND_DEVICE_ERROR;
|
||||
if (FindDeviceResult_NOT_FOUND == findDeviceResult) return RemoveDeviceResult_NOT_FOUND;
|
||||
if (!SetupDiCallClassInstaller(DIF_REMOVE, hDevInfo, &deviceInfoData)) return RemoveDeviceResult_REMOVE_DEVICE_ERROR;
|
||||
return RemoveDeviceResult_OK;
|
||||
}
|
||||
|
||||
static ProcessReturnCode uninstallDevice() {
|
||||
HDEVINFO hDevInfo;
|
||||
|
||||
RemoveDeviceResult removeDeviceResult = removeDevice(hDevInfo);
|
||||
if (RemoveDeviceResult_GET_DEV_INFOS_ERROR <= removeDeviceResult) {
|
||||
DWORD errorCode = GetLastError();
|
||||
if (INVALID_HANDLE_VALUE != hDevInfo) SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
char message[1024];
|
||||
wsprintfA(message, CANNOT_REMOVE_DEVICE_ERR_FMT, removeDeviceStageName[removeDeviceResult - RemoveDeviceResult_GET_DEV_INFOS_ERROR], errorCode);
|
||||
MessageBoxA(NULL, message, ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_UNINSTALLING_DRIVER;
|
||||
}
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
|
||||
const char *message = RemoveDeviceResult_OK == removeDeviceResult ? SUCCESSFULLY_UNINSTALLED_MSG : CANNOT_UNINSTALL_NOT_FOUND;
|
||||
MessageBoxA(NULL, message, INFORMATION_TITLE, MB_OK | MB_ICONINFORMATION);
|
||||
return ProcessReturnCode_OK;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc == 2) {
|
||||
if (_stricmp(INSTALL_COMMAND, argv[1]) == 0) {
|
||||
char fullInfPath[MAX_PATH + 1];
|
||||
if (!createFullInfPath(fullInfPath, argv[0])) {
|
||||
MessageBoxA(NULL, CANNOT_INSTALL_PATH_TOO_LONG_ERR, ERROR_TITLE, MB_OK | MB_ICONEXCLAMATION);
|
||||
return ProcessReturnCode_ERR_PATH_TOO_LONG;
|
||||
}
|
||||
return infInstall(fullInfPath);
|
||||
} else if (_stricmp(UNINSTALL_COMMAND, argv[1]) == 0) {
|
||||
return uninstallDevice();
|
||||
}
|
||||
}
|
||||
MessageBoxA(NULL, USAGE_MSG, INFORMATION_TITLE, MB_OK | MB_ICONINFORMATION);
|
||||
return ProcessReturnCode_ERR_UNRECOGNISED_OPERATION_MODE;
|
||||
}
|
||||
287
mt32emu_win32drv_setup/infinstall/infinstall.vcproj
Normal file
287
mt32emu_win32drv_setup/infinstall/infinstall.vcproj
Normal file
@@ -0,0 +1,287 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="infinstall"
|
||||
ProjectGUID="{DC87B5AB-C35C-44D0-9EB3-20FFA5CC4B06}"
|
||||
RootNamespace="infinstall"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="setupapi.lib newdev.lib"
|
||||
LinkIncremental="2"
|
||||
UACExecutionLevel="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
EntryPointSymbol="mainCRTStartup"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="setupapi.lib newdev.lib"
|
||||
LinkIncremental="1"
|
||||
UACExecutionLevel="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
EntryPointSymbol="mainCRTStartup"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)\x64\$(ConfigurationName)"
|
||||
IntermediateDirectory="x64\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
UACExecutionLevel="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
EntryPointSymbol=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\munt\mt32emu_win32drv_setup\infinstall\infinstall.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\munt\mt32emu_win32drv_setup\infinstall\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\munt\mt32emu_win32drv_setup\infinstall\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
170
mt32emu_win32drv_setup/infinstall/infinstall.vcxproj
Normal file
170
mt32emu_win32drv_setup/infinstall/infinstall.vcxproj
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{DC87B5AB-C35C-44D0-9EB3-20FFA5CC4B06}</ProjectGuid>
|
||||
<RootNamespace>infinstall</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>15.0.28307.799</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\x64\$(Configuration)\</OutDir>
|
||||
<IntDir>x64\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>setupapi.lib;newdev.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>setupapi.lib;newdev.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<AdditionalDependencies>setupapi.lib;newdev.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Link>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
<AdditionalDependencies>setupapi.lib;newdev.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization>Disabled</Optimization>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\munt\mt32emu_win32drv_setup\infinstall\infinstall.cpp" />
|
||||
<ClCompile Include="..\..\..\munt\mt32emu_win32drv_setup\infinstall\stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\munt\mt32emu_win32drv_setup\infinstall\stdafx.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
26
mt32emu_win32drv_setup/infinstall/infinstall.vcxproj.filters
Normal file
26
mt32emu_win32drv_setup/infinstall/infinstall.vcxproj.filters
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\munt\mt32emu_win32drv_setup\infinstall\infinstall.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\munt\mt32emu_win32drv_setup\infinstall\stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\munt\mt32emu_win32drv_setup\infinstall\stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
1
mt32emu_win32drv_setup/infinstall/stdafx.cpp
Normal file
1
mt32emu_win32drv_setup/infinstall/stdafx.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "stdafx.h"
|
||||
12
mt32emu_win32drv_setup/infinstall/stdafx.h
Normal file
12
mt32emu_win32drv_setup/infinstall/stdafx.h
Normal file
@@ -0,0 +1,12 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
#pragma once
|
||||
|
||||
// Require Windows 2K API
|
||||
#define _WIN32_WINNT 0x0500
|
||||
|
||||
#include <windows.h>
|
||||
#include <Setupapi.h>
|
||||
#include <Devguid.h>
|
||||
#include <newdev.h>
|
||||
@@ -1,7 +1,9 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mt32emu_win32drv_setup", "mt32emu_win32drv_setup.vcproj", "{865C8AAD-4B25-498F-B311-AEDB80898983}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drvsetup", "drvsetup\drvsetup.vcproj", "{865C8AAD-4B25-498F-B311-AEDB80898983}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "infinstall", "infinstall\infinstall.vcproj", "{DC87B5AB-C35C-44D0-9EB3-20FFA5CC4B06}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -13,6 +15,10 @@ Global
|
||||
{865C8AAD-4B25-498F-B311-AEDB80898983}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{865C8AAD-4B25-498F-B311-AEDB80898983}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{865C8AAD-4B25-498F-B311-AEDB80898983}.Release|Win32.Build.0 = Release|Win32
|
||||
{DC87B5AB-C35C-44D0-9EB3-20FFA5CC4B06}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DC87B5AB-C35C-44D0-9EB3-20FFA5CC4B06}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DC87B5AB-C35C-44D0-9EB3-20FFA5CC4B06}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DC87B5AB-C35C-44D0-9EB3-20FFA5CC4B06}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
Reference in New Issue
Block a user