hnetcfg: Store the long 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:
Zebediah Figura 2018-06-28 17:39:36 +02:00 committed by Alexandre Julliard
parent e865a9d66a
commit e070ff88d6
2 changed files with 13 additions and 2 deletions

View File

@ -268,9 +268,9 @@ 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;
DWORD sz, longsz;
WCHAR *path; WCHAR *path;
DWORD res; DWORD res;
DWORD sz;
FIXME("%p, %s\n", This, debugstr_w(image)); FIXME("%p, %s\n", This, debugstr_w(image));
@ -298,9 +298,19 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
sz = GetFullPathNameW(image, 0, NULL, NULL); sz = GetFullPathNameW(image, 0, NULL, NULL);
if (!(path = heap_alloc(++sz * sizeof(WCHAR)))) if (!(path = heap_alloc(++sz * sizeof(WCHAR))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
GetFullPathNameW(image, sz, path, NULL); GetFullPathNameW(image, sz, path, NULL);
longsz = GetLongPathNameW(path, path, sz);
if (longsz > sz)
{
if (!(path = heap_realloc(path, longsz * sizeof(WCHAR))))
{
heap_free(path);
return E_OUTOFMEMORY;
}
GetLongPathNameW(path, path, longsz);
}
SysFreeString( This->filename ); SysFreeString( This->filename );
This->filename = SysAllocString(path); This->filename = SysAllocString(path);
heap_free(path); heap_free(path);

View File

@ -140,6 +140,7 @@ static void test_NetFwAuthorizedApplication(void)
SysFreeString(bstr); SysFreeString(bstr);
GetFullPathNameW(image, ARRAY_SIZE(fullpath), fullpath, NULL); GetFullPathNameW(image, ARRAY_SIZE(fullpath), fullpath, NULL);
GetLongPathNameW(fullpath, fullpath, ARRAY_SIZE(fullpath));
info = (UNIVERSAL_NAME_INFOW *)&netpath; info = (UNIVERSAL_NAME_INFOW *)&netpath;
sz = sizeof(netpath); sz = sizeof(netpath);