removed libwdi.. too much UAC headaches..

users will use zadig just like with dolphin
This commit is contained in:
Jack Andersen 2015-05-01 20:14:36 -10:00
parent f0dc0451fd
commit 570396b76c
6 changed files with 34 additions and 79 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "extern/libwdi"]
path = extern/libwdi
url = https://github.com/jackoalan/libwdi.git

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@ -1,20 +0,0 @@
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
!win32 {
error(this project is designed for windows only)
}
INCLUDEPATH += $$PWD/../extern/libwdi
LIBS += \
Shell32.lib \
Ole32.lib \
Setupapi.lib \
Advapi32.lib \
User32.lib \
$$PWD/../extern/libwdi/x64/Debug/lib/libwdi.lib
SOURCES += main.c

View File

@ -1,39 +0,0 @@
#include <stdio.h>
#include <stdbool.h>
#include <libwdi/libwdi.h>
int main(void)
{
printf("Hello World!\n");
struct wdi_device_info *device, *list;
struct wdi_options_create_list WDI_LIST_OPTS =
{
true, false, true
};
int err = wdi_create_list(&list, &WDI_LIST_OPTS);
if (err == WDI_SUCCESS)
{
for (device = list; device != NULL; device = device->next)
{
if (device->vid == 0x57E && device->pid == 0x337 &&
!strcmp(device->driver, "HidUsb"))
{
printf("GC adapter detected; installing driver\n");
char tempDir[128];
GetTempPathA(128, tempDir);
err = wdi_prepare_driver(device, tempDir, "winusb_smash.inf", NULL);
if (err == WDI_SUCCESS)
{
err = wdi_install_driver(device, tempDir, "winusb_smash.inf", NULL);
printf("");
}
break;
}
}
wdi_destroy_list(list);
}
return 0;
}

1
extern/libwdi vendored

@ -1 +0,0 @@
Subproject commit aeacb8b85c8143d0e59b0f6c4206008a017ebde0

View File

@ -59,11 +59,39 @@ public:
} }
#if _WIN32 #if _WIN32
extern "C" int genWin32ShellExecute(const wchar_t* AppFullPath, static int genWin32ShellExecute(const wchar_t* AppFullPath,
const wchar_t* Verb, const wchar_t* Verb,
const wchar_t* Params, const wchar_t* Params,
bool ShowAppWindow, bool ShowAppWindow,
bool WaitToFinish); bool WaitToFinish)
{
int Result = 0;
// Setup the required structure
SHELLEXECUTEINFO ShExecInfo;
memset(&ShExecInfo, 0, sizeof(SHELLEXECUTEINFO));
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = Verb;
ShExecInfo.lpFile = AppFullPath;
ShExecInfo.lpParameters = Params;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = (ShowAppWindow ? SW_SHOW : SW_HIDE);
ShExecInfo.hInstApp = NULL;
// Spawn the process
if (ShellExecuteEx(&ShExecInfo) == FALSE)
{
Result = -1; // Failed to execute process
} else if (WaitToFinish)
{
WaitForSingleObject(ShExecInfo.hProcess, INFINITE);
}
return Result;
}
#include <libwdi/libwdi.h> #include <libwdi/libwdi.h>
static void scanWinUSB() static void scanWinUSB()
{ {
@ -81,7 +109,7 @@ static void scanWinUSB()
!strcmp(device->driver, "HidUsb")) !strcmp(device->driver, "HidUsb"))
{ {
printf("GC adapter detected; installing driver\n"); printf("GC adapter detected; installing driver\n");
genWin32ShellExecute(L"WinUsbInstaller.exe", L"", L"", false, true);
} }
} }
wdi_destroy_list(list); wdi_destroy_list(list);