Skip to content

Commit

Permalink
mssqlvdi: Fix IClientVirtualDeviceSet2::CreateEx call.
Browse files Browse the repository at this point in the history
Seems we need to call IClientVirtualDeviceSet2::CreateEx with as first
argument the instance name when connecting to the an non default
instance.

Fixes #383: mssqldvi problem with connection to mssql not default
            instance
  • Loading branch information
jkimalane authored and Marco van Wieringen committed Jan 5, 2016
1 parent bcdc04a commit 5389d0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -75,6 +75,7 @@ Jose Luis Tallon
Josip Almasi
Juan Luis Frances
Juergen Lock
Jyri Palis
Karl Cunningham
Kern Sibbald
Kjetil Torgrim Homme
Expand Down
11 changes: 10 additions & 1 deletion src/win32/plugins/filed/mssqlvdi-fd.c
Expand Up @@ -1429,7 +1429,16 @@ static inline bool setup_vdi_device(bpContext *ctx, struct io_pkt *io)
/*
* Create the VDI device set.
*/
hr = p_ctx->VDIDeviceSet->CreateEx(NULL, p_ctx->vdsname, &p_ctx->VDIConfig);
if (bstrcasecmp(p_ctx->instance, DEFAULT_INSTANCE)) {
hr = p_ctx->VDIDeviceSet->CreateEx(NULL, p_ctx->vdsname, &p_ctx->VDIConfig);
} else {
POOLMEM *instance_name;

instance_name = get_pool_memory(PM_NAME);
UTF8_2_wchar(&instance_name, p_ctx->instance);
hr = p_ctx->VDIDeviceSet->CreateEx((LPCWSTR)instance_name, p_ctx->vdsname, &p_ctx->VDIConfig);
free_pool_memory(instance_name);
}
if (!SUCCEEDED(hr)) {
comReportError(ctx, hr);
return false;
Expand Down

0 comments on commit 5389d0d

Please sign in to comment.