Test showing GetShortPathNameW problem preventing msi from installing .NET 1.1
This test shows the problem that msi is having installing .Net 1.1. Could someone familiar with this code have a look at it please? diff -p -u -r1.36 path.c --- dlls/kernel/tests/path.c 14 Jun 2006 11:54:23 -0000 1.36 +++ dlls/kernel/tests/path.c 26 Aug 2006 15:53:13 -0000 @@ -929,6 +929,16 @@ static void test_GetTempPath(void) SetEnvironmentVariableA("TMP", save_TMP); } +static void test_GetShortPathNameW(void) +{ + WCHAR nameW[] = { 'c',':','\\','w','i','n','d','o','w','s','\\','M','i','c','r','o','s','o','f','t','.','N','E','T','\\','F','r','a','m','e','w','o','r','k','\\','v','1','.','1','.','4','3','2','2','\\','1','0','3','3','\\','v','b','c','7','u','i','.','d','l','l',0 }; + DWORD size; + + size = GetShortPathNameW( nameW, NULL, 0 ); + + ok(size > 0, "GetShortPathNameW() failed\n"); +} + START_TEST(path) { CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive; @@ -939,4 +949,5 @@ START_TEST(path) test_PathNameA(curdir, curDrive, otherDrive); test_CleanupPathA(origdir,curdir); test_GetTempPath(); + test_GetShortPathNameW(); }
Robert Reif wrote:
This test shows the problem that msi is having installing .Net 1.1.
Could someone familiar with this code have a look at it please?
------------------------------------------------------------------------
diff -p -u -r1.36 path.c --- dlls/kernel/tests/path.c 14 Jun 2006 11:54:23 -0000 1.36 +++ dlls/kernel/tests/path.c 26 Aug 2006 15:53:13 -0000 @@ -929,6 +929,16 @@ static void test_GetTempPath(void) SetEnvironmentVariableA("TMP", save_TMP); }
+static void test_GetShortPathNameW(void) +{ + WCHAR nameW[] = { 'c',':','\\','w','i','n','d','o','w','s','\\','M','i','c','r','o','s','o','f','t','.','N','E','T','\\','F','r','a','m','e','w','o','r','k','\\','v','1','.','1','.','4','3','2','2','\\','1','0','3','3','\\','v','b','c','7','u','i','.','d','l','l',0 }; + DWORD size; + + size = GetShortPathNameW( nameW, NULL, 0 ); + + ok(size > 0, "GetShortPathNameW() failed\n"); +} + START_TEST(path) { CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive; @@ -939,4 +949,5 @@ START_TEST(path) test_PathNameA(curdir, curDrive, otherDrive); test_CleanupPathA(origdir,curdir); test_GetTempPath(); + test_GetShortPathNameW(); }
It seems we need to check for second param being NULL and if so, return error. At least that's what MSDN implies. Vitaliy
Vitaliy wrote:
Robert Reif wrote:
This test shows the problem that msi is having installing .Net 1.1.
Could someone familiar with this code have a look at it please?
------------------------------------------------------------------------
diff -p -u -r1.36 path.c --- dlls/kernel/tests/path.c 14 Jun 2006 11:54:23 -0000 1.36 +++ dlls/kernel/tests/path.c 26 Aug 2006 15:53:13 -0000 @@ -929,6 +929,16 @@ static void test_GetTempPath(void) SetEnvironmentVariableA("TMP", save_TMP); }
+static void test_GetShortPathNameW(void) +{ + WCHAR nameW[] = { 'c',':','\\','w','i','n','d','o','w','s','\\','M','i','c','r','o','s','o','f','t','.','N','E','T','\\','F','r','a','m','e','w','o','r','k','\\','v','1','.','1','.','4','3','2','2','\\','1','0','3','3','\\','v','b','c','7','u','i','.','d','l','l',0 }; + DWORD size; + + size = GetShortPathNameW( nameW, NULL, 0 ); + + ok(size > 0, "GetShortPathNameW() failed\n"); +} + START_TEST(path) { CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive; @@ -939,4 +949,5 @@ START_TEST(path) test_PathNameA(curdir, curDrive, otherDrive); test_CleanupPathA(origdir,curdir); test_GetTempPath(); + test_GetShortPathNameW(); }
It seems we need to check for second param being NULL and if so, return error. At least that's what MSDN implies.
Vitaliy
I just verified on Windows XP Pro SP2 that GetShortPathName with a NULL second variable does return a proper length and does not set an error. This is the behavior that the msi code using this function expects.
Robert Reif <reif(a)earthlink.net> writes:
This test shows the problem that msi is having installing .Net 1.1.
Could someone familiar with this code have a look at it please?
Does this help? diff --git a/dlls/kernel/path.c b/dlls/kernel/path.c index c4d7677..ddd169c 100644 --- a/dlls/kernel/path.c +++ b/dlls/kernel/path.c @@ -481,7 +481,7 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR tmplen = p - (longpath + lp); lstrcpynW(tmpshortpath + sp, longpath + lp, tmplen + 1); /* Check, if the current element is a valid dos name */ - if (tmplen <= 8+1+3+1) + if (tmplen <= 8+1+3) { BOOLEAN spaces; memcpy(ustr_buf, longpath + lp, tmplen * sizeof(WCHAR)); -- Alexandre Julliard julliard(a)winehq.org
participants (3)
-
Alexandre Julliard -
Robert Reif -
Vitaliy