[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: [PATCH] hnetcfg: Store the long path in INetFwAuthorizedApplication_put_ProcessImageFileName().
From: Zebediah Figura <z.figura12 () gmail ! com>
Date: 2018-06-28 15:39:36
Message-ID: 1530200376-2960-1-git-send-email-z.figura12 () gmail ! com
[Download RAW message or body]
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
---
dlls/hnetcfg/apps.c | 14 ++++++++++++--
dlls/hnetcfg/tests/policy.c | 1 +
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c
index 69eabd6..21e1007 100644
--- a/dlls/hnetcfg/apps.c
+++ b/dlls/hnetcfg/apps.c
@@ -268,9 +268,9 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
{
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
UNIVERSAL_NAME_INFOW *info;
+ DWORD sz, longsz;
WCHAR *path;
DWORD res;
- DWORD sz;
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);
if (!(path = heap_alloc(++sz * sizeof(WCHAR))))
return E_OUTOFMEMORY;
-
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 );
This->filename = SysAllocString(path);
heap_free(path);
diff --git a/dlls/hnetcfg/tests/policy.c b/dlls/hnetcfg/tests/policy.c
index 389be16..4e90ceb 100644
--- a/dlls/hnetcfg/tests/policy.c
+++ b/dlls/hnetcfg/tests/policy.c
@@ -140,6 +140,7 @@ static void test_NetFwAuthorizedApplication(void)
SysFreeString(bstr);
GetFullPathNameW(image, ARRAY_SIZE(fullpath), fullpath, NULL);
+ GetLongPathNameW(fullpath, fullpath, ARRAY_SIZE(fullpath));
info = (UNIVERSAL_NAME_INFOW *)&netpath;
sz = sizeof(netpath);
--
2.7.4
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic