Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ab6ee61b
Commit
ab6ee61b
authored
Jul 30, 2009
by
Nicolas Le Cam
Committed by
Alexandre Julliard
Aug 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Fix test on temp paths that have a different long form.
parent
41b2296a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
1 deletion
+74
-1
shlexec.c
dlls/shell32/tests/shlexec.c
+74
-1
No files found.
dlls/shell32/tests/shlexec.c
View file @
ab6ee61b
...
@@ -587,7 +587,79 @@ static int _okChildInt(const char* file, int line, const char* key, int expected
...
@@ -587,7 +587,79 @@ static int _okChildInt(const char* file, int line, const char* key, int expected
#define okChildPath(key, expected) _okChildPath(__FILE__, __LINE__, (key), (expected))
#define okChildPath(key, expected) _okChildPath(__FILE__, __LINE__, (key), (expected))
#define okChildInt(key, expected) _okChildInt(__FILE__, __LINE__, (key), (expected))
#define okChildInt(key, expected) _okChildInt(__FILE__, __LINE__, (key), (expected))
/***
*
* GetLongPathNameA equivalent that supports Win95 and WinNT
*
***/
static
DWORD
get_long_path_name
(
const
char
*
shortpath
,
char
*
longpath
,
DWORD
longlen
)
{
char
tmplongpath
[
MAX_PATH
];
const
char
*
p
;
DWORD
sp
=
0
,
lp
=
0
;
DWORD
tmplen
;
WIN32_FIND_DATAA
wfd
;
HANDLE
goit
;
if
(
!
shortpath
||
!
shortpath
[
0
])
return
0
;
if
(
shortpath
[
1
]
==
':'
)
{
tmplongpath
[
0
]
=
shortpath
[
0
];
tmplongpath
[
1
]
=
':'
;
lp
=
sp
=
2
;
}
while
(
shortpath
[
sp
])
{
/* check for path delimiters and reproduce them */
if
(
shortpath
[
sp
]
==
'\\'
||
shortpath
[
sp
]
==
'/'
)
{
if
(
!
lp
||
tmplongpath
[
lp
-
1
]
!=
'\\'
)
{
/* strip double "\\" */
tmplongpath
[
lp
++
]
=
'\\'
;
}
tmplongpath
[
lp
]
=
0
;
/* terminate string */
sp
++
;
continue
;
}
p
=
shortpath
+
sp
;
if
(
sp
==
0
&&
p
[
0
]
==
'.'
&&
(
p
[
1
]
==
'/'
||
p
[
1
]
==
'\\'
))
{
tmplongpath
[
lp
++
]
=
*
p
++
;
tmplongpath
[
lp
++
]
=
*
p
++
;
}
for
(;
*
p
&&
*
p
!=
'/'
&&
*
p
!=
'\\'
;
p
++
);
tmplen
=
p
-
(
shortpath
+
sp
);
lstrcpyn
(
tmplongpath
+
lp
,
shortpath
+
sp
,
tmplen
+
1
);
/* Check if the file exists and use the existing file name */
goit
=
FindFirstFileA
(
tmplongpath
,
&
wfd
);
if
(
goit
==
INVALID_HANDLE_VALUE
)
return
0
;
FindClose
(
goit
);
strcpy
(
tmplongpath
+
lp
,
wfd
.
cFileName
);
lp
+=
strlen
(
tmplongpath
+
lp
);
sp
+=
tmplen
;
}
tmplen
=
strlen
(
shortpath
)
-
1
;
if
((
shortpath
[
tmplen
]
==
'/'
||
shortpath
[
tmplen
]
==
'\\'
)
&&
(
tmplongpath
[
lp
-
1
]
!=
'/'
&&
tmplongpath
[
lp
-
1
]
!=
'\\'
))
tmplongpath
[
lp
++
]
=
shortpath
[
tmplen
];
tmplongpath
[
lp
]
=
0
;
tmplen
=
strlen
(
tmplongpath
)
+
1
;
if
(
tmplen
<=
longlen
)
{
strcpy
(
longpath
,
tmplongpath
);
tmplen
--
;
/* length without 0 */
}
return
tmplen
;
}
/***
/***
*
*
...
@@ -986,7 +1058,8 @@ static void test_lnks(void)
...
@@ -986,7 +1058,8 @@ static void test_lnks(void)
GetLastError
());
GetLastError
());
okChildInt
(
"argcA"
,
5
);
okChildInt
(
"argcA"
,
5
);
okChildString
(
"argvA3"
,
"Open"
);
okChildString
(
"argvA3"
,
"Open"
);
sprintf
(
filename
,
"%s
\\
test file.shlexec"
,
tmpdir
);
sprintf
(
params
,
"%s
\\
test file.shlexec"
,
tmpdir
);
get_long_path_name
(
params
,
filename
,
sizeof
(
filename
));
okChildPath
(
"argvA4"
,
filename
);
okChildPath
(
"argvA4"
,
filename
);
sprintf
(
filename
,
"%s
\\
test_shortcut_exe.lnk"
,
tmpdir
);
sprintf
(
filename
,
"%s
\\
test_shortcut_exe.lnk"
,
tmpdir
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment