summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xremote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exebin52224 -> 52224 bytes
-rw-r--r--remote/modules/run-virt/winres.c28
2 files changed, 17 insertions, 11 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe
index 387f420b..39928c92 100755
--- a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe
+++ b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe
Binary files differ
diff --git a/remote/modules/run-virt/winres.c b/remote/modules/run-virt/winres.c
index 0cc3963b..54c0ad1b 100644
--- a/remote/modules/run-virt/winres.c
+++ b/remote/modules/run-virt/winres.c
@@ -53,7 +53,7 @@ static BOOL mountNetworkShares();
static int queryPasswordDaemon();
static BOOL fileExists(wchar_t* szPath);
-static HRESULT createFolderShortcut(wchar_t* sTargetfile, wchar_t* sLinkfile);
+static HRESULT createFolderShortcut(wchar_t* sTargetfile, wchar_t* sLinkfile, wchar_t* comment);
static void alog(const char *fmt, ...)
{
@@ -525,9 +525,6 @@ static void udpReceived(SOCKET sock)
static DWORD mount(LPNETRESOURCEW share, LPWSTR pass, LPWSTR user)
{
DWORD retval;
- // Remove remembered drive if it's not connected
- //GetDriveType() DRIVE_NO_ROOT_DIR
- //WNetCancelConnection2W(share->lpLocalName, CONNECT_UPDATE_PROFILE, TRUE);
// Now try to mount
retval = WNetAddConnection2W(share, pass, user, CONNECT_TEMPORARY | CONNECT_CURRENT_MEDIA);
if (retval == NO_ERROR) {
@@ -550,7 +547,7 @@ static DWORD mount(LPNETRESOURCEW share, LPWSTR pass, LPWSTR user)
return retval;
}
-static void mkshortcut(const netdrive_t *d)
+static void mkshortcut(const netdrive_t *d, wchar_t *comment)
{
if (d->shortcut == NULL || strlen(d->shortcut) == 0)
return;
@@ -560,7 +557,7 @@ static void mkshortcut(const netdrive_t *d)
MultiByteToWideChar(CP_UTF8, 0, d->path, -1, tmp, MAX_PATH);
StringCchPrintfW(wTarget, MAX_PATH, L"\"%s\"", tmp);
DeleteFileW(wShortcut);
- createFolderShortcut(wTarget, wShortcut);
+ createFolderShortcut(wTarget, wShortcut, comment);
}
static BOOL mountNetworkShare(const netdrive_t *d)
@@ -591,15 +588,21 @@ static BOOL mountNetworkShare(const netdrive_t *d)
share.lpRemoteName = path;
share.lpProvider = NULL;
letter[1] = ':';
- letter[2] = 0; // TODO d->shortcut
+ letter[2] = 0;
+ letter[3] = 0;
if (letter[0] != 0) {
// Try with specific letter
// Get anything there might be out of the way
WNetCancelConnection2W(letter, CONNECT_UPDATE_PROFILE, TRUE);
+ WNetCancelConnection2W(letter, 0, TRUE);
+ letter[2] = '\\';
+ WNetCancelConnection2W(letter, 0, TRUE);
+ DeleteVolumeMountPointW(letter);
+ letter[2] = 0;
// Connect defined share
retval = mount(&share, pass, user);
if (retval == NO_ERROR) {
- mkshortcut(d);
+ mkshortcut(d, letter);
return TRUE;
}
if (retval != ERROR_ALREADY_ASSIGNED && retval != ERROR_DEVICE_ALREADY_REMEMBERED
@@ -615,7 +618,7 @@ static BOOL mountNetworkShare(const netdrive_t *d)
|| retval == ERROR_CONNECTION_UNAVAIL)
continue;
if (retval == NO_ERROR) {
- mkshortcut(d);
+ mkshortcut(d, letter);
return TRUE;
}
alog("mountNetworkShare: without letter failed: %d", (int)retval);
@@ -688,7 +691,7 @@ static uint8_t* hex2bin(char *szHexString)
// Stuff for creating a simple shortcut (.lnk)
-static HRESULT createFolderShortcut(wchar_t* targetDir, wchar_t* linkFile)
+static HRESULT createFolderShortcut(wchar_t* targetDir, wchar_t* linkFile, wchar_t* comment)
{
HRESULT hRes; /* Returned COM result code */
IShellLink* pShellLink; /* IShellLink object pointer */
@@ -709,8 +712,11 @@ static HRESULT createFolderShortcut(wchar_t* targetDir, wchar_t* linkFile)
wchar_t explorer[MAX_PATH];
StringCchPrintfW(explorer, MAX_PATH, L"\"%s\\explorer.exe\"", windowsPath);
/* Set the fields in the IShellLink object */
- //hRes = pShellLink->lpVtbl->SetPath(pShellLink, targetDir);
+ hRes = pShellLink->lpVtbl->SetPath(pShellLink, explorer);
hRes = pShellLink->lpVtbl->SetArguments(pShellLink, targetDir);
+ if (comment != NULL) {
+ hRes = pShellLink->lpVtbl->SetDescription(pShellLink, comment);
+ }
/* Use the IPersistFile object to save the shell link */
hRes = pShellLink->lpVtbl->QueryInterface(