hnetcfg: Store the full path in INetFwAuthorizedApplication_put_ProcessImageFileName().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3dcdbba6ef
commit
e46f84a86b
|
@ -268,7 +268,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
|
||||||
{
|
{
|
||||||
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
||||||
UNIVERSAL_NAME_INFOW *info;
|
UNIVERSAL_NAME_INFOW *info;
|
||||||
WCHAR *netpath;
|
WCHAR *path;
|
||||||
DWORD res;
|
DWORD res;
|
||||||
DWORD sz;
|
DWORD sz;
|
||||||
|
|
||||||
|
@ -281,22 +281,29 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
|
||||||
res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, NULL, &sz);
|
res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, NULL, &sz);
|
||||||
if (res == WN_MORE_DATA)
|
if (res == WN_MORE_DATA)
|
||||||
{
|
{
|
||||||
if (!(netpath = heap_alloc(sz)))
|
if (!(path = heap_alloc(sz)))
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
info = (UNIVERSAL_NAME_INFOW *)&netpath;
|
info = (UNIVERSAL_NAME_INFOW *)&path;
|
||||||
res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, &info, &sz);
|
res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, &info, &sz);
|
||||||
if (res == NO_ERROR)
|
if (res == NO_ERROR)
|
||||||
{
|
{
|
||||||
SysFreeString(This->filename);
|
SysFreeString(This->filename);
|
||||||
This->filename = SysAllocString(info->lpUniversalName);
|
This->filename = SysAllocString(info->lpUniversalName);
|
||||||
}
|
}
|
||||||
heap_free(netpath);
|
heap_free(path);
|
||||||
return HRESULT_FROM_WIN32(res);
|
return HRESULT_FROM_WIN32(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sz = GetFullPathNameW(image, 0, NULL, NULL);
|
||||||
|
if (!(path = heap_alloc(++sz * sizeof(WCHAR))))
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
GetFullPathNameW(image, sz, path, NULL);
|
||||||
|
|
||||||
SysFreeString( This->filename );
|
SysFreeString( This->filename );
|
||||||
This->filename = SysAllocString(image);
|
This->filename = SysAllocString(path);
|
||||||
|
heap_free(path);
|
||||||
return This->filename ? S_OK : E_OUTOFMEMORY;
|
return This->filename ? S_OK : E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,7 @@ static void test_NetFwAuthorizedApplication(void)
|
||||||
INetFwAuthorizedApplication *app;
|
INetFwAuthorizedApplication *app;
|
||||||
static WCHAR empty[] = {0};
|
static WCHAR empty[] = {0};
|
||||||
UNIVERSAL_NAME_INFOW *info;
|
UNIVERSAL_NAME_INFOW *info;
|
||||||
|
WCHAR fullpath[MAX_PATH];
|
||||||
WCHAR netpath[MAX_PATH];
|
WCHAR netpath[MAX_PATH];
|
||||||
WCHAR image[MAX_PATH];
|
WCHAR image[MAX_PATH];
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -138,13 +139,15 @@ static void test_NetFwAuthorizedApplication(void)
|
||||||
ok(hr == S_OK, "got: %08x\n", hr);
|
ok(hr == S_OK, "got: %08x\n", hr);
|
||||||
SysFreeString(bstr);
|
SysFreeString(bstr);
|
||||||
|
|
||||||
|
GetFullPathNameW(image, ARRAY_SIZE(fullpath), fullpath, NULL);
|
||||||
|
|
||||||
info = (UNIVERSAL_NAME_INFOW *)&netpath;
|
info = (UNIVERSAL_NAME_INFOW *)&netpath;
|
||||||
sz = sizeof(netpath);
|
sz = sizeof(netpath);
|
||||||
hr = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, &info, &sz);
|
hr = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, &info, &sz);
|
||||||
if (hr != NO_ERROR)
|
if (hr != NO_ERROR)
|
||||||
{
|
{
|
||||||
info->lpUniversalName = netpath + sizeof(*info)/sizeof(WCHAR);
|
info->lpUniversalName = netpath + sizeof(*info)/sizeof(WCHAR);
|
||||||
lstrcpyW(info->lpUniversalName, image);
|
lstrcpyW(info->lpUniversalName, fullpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr);
|
hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr);
|
||||||
|
|
Loading…
Reference in New Issue