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
ca3606f3
Commit
ca3606f3
authored
Dec 18, 2007
by
Francois Gouget
Committed by
Alexandre Julliard
Dec 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Use GetProcAddress() on SHFileOperationW() because it is missing on Windows 95.
parent
46735ae4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
shlfileop.c
dlls/shell32/tests/shlfileop.c
+12
-4
No files found.
dlls/shell32/tests/shlfileop.c
View file @
ca3606f3
...
...
@@ -40,6 +40,7 @@ static const WCHAR UNICODE_PATH[] = {'c',':','\\',0x00c4,'\0','\0'};
static
HMODULE
hshell32
;
static
int
(
WINAPI
*
pSHCreateDirectoryExA
)(
HWND
,
LPCSTR
,
LPSECURITY_ATTRIBUTES
);
static
int
(
WINAPI
*
pSHCreateDirectoryExW
)(
HWND
,
LPCWSTR
,
LPSECURITY_ATTRIBUTES
);
static
int
(
WINAPI
*
pSHFileOperationW
)(
LPSHFILEOPSTRUCTW
);
static
int
(
WINAPI
*
pSHPathPrepareForWriteA
)(
HWND
,
IUnknown
*
,
LPCSTR
,
DWORD
);
static
int
(
WINAPI
*
pSHPathPrepareForWriteW
)(
HWND
,
IUnknown
*
,
LPCWSTR
,
DWORD
);
...
...
@@ -48,6 +49,7 @@ static void InitFunctionPointers(void)
hshell32
=
GetModuleHandleA
(
"shell32.dll"
);
pSHCreateDirectoryExA
=
(
void
*
)
GetProcAddress
(
hshell32
,
"SHCreateDirectoryExA"
);
pSHCreateDirectoryExW
=
(
void
*
)
GetProcAddress
(
hshell32
,
"SHCreateDirectoryExW"
);
pSHFileOperationW
=
(
void
*
)
GetProcAddress
(
hshell32
,
"SHFileOperationW"
);
pSHPathPrepareForWriteA
=
(
void
*
)
GetProcAddress
(
hshell32
,
"SHPathPrepareForWriteA"
);
pSHPathPrepareForWriteW
=
(
void
*
)
GetProcAddress
(
hshell32
,
"SHPathPrepareForWriteW"
);
}
...
...
@@ -1119,6 +1121,12 @@ static void test_unicode(void)
int
ret
;
HANDLE
file
;
if
(
!
pSHFileOperationW
)
{
skip
(
"SHFileOperationW() is missing
\n
"
);
return
;
}
shfoW
.
hwnd
=
NULL
;
shfoW
.
wFunc
=
FO_DELETE
;
shfoW
.
pFrom
=
UNICODE_PATH
;
...
...
@@ -1143,7 +1151,7 @@ static void test_unicode(void)
/* Try to delete a file with unicode filename */
ok
(
file_existsW
(
UNICODE_PATH
),
"The file does not exist
\n
"
);
ret
=
SHFileOperationW
(
&
shfoW
);
ret
=
p
SHFileOperationW
(
&
shfoW
);
ok
(
!
ret
,
"File is not removed, ErrorCode: %d
\n
"
,
ret
);
ok
(
!
file_existsW
(
UNICODE_PATH
),
"The file should have been removed
\n
"
);
...
...
@@ -1151,7 +1159,7 @@ static void test_unicode(void)
createTestFileW
(
UNICODE_PATH
);
shfoW
.
fFlags
|=
FOF_ALLOWUNDO
;
ok
(
file_existsW
(
UNICODE_PATH
),
"The file does not exist
\n
"
);
ret
=
SHFileOperationW
(
&
shfoW
);
ret
=
p
SHFileOperationW
(
&
shfoW
);
ok
(
!
ret
,
"File is not removed, ErrorCode: %d
\n
"
,
ret
);
ok
(
!
file_existsW
(
UNICODE_PATH
),
"The file should have been removed
\n
"
);
...
...
@@ -1166,7 +1174,7 @@ static void test_unicode(void)
ok
(
!
ret
,
"SHCreateDirectoryExW returned %d
\n
"
,
ret
);
ok
(
file_existsW
(
UNICODE_PATH
),
"The directory is not created
\n
"
);
shfoW
.
fFlags
&=
~
FOF_ALLOWUNDO
;
ret
=
SHFileOperationW
(
&
shfoW
);
ret
=
p
SHFileOperationW
(
&
shfoW
);
ok
(
!
ret
,
"Directory is not removed, ErrorCode: %d
\n
"
,
ret
);
ok
(
!
file_existsW
(
UNICODE_PATH
),
"The directory should have been removed
\n
"
);
...
...
@@ -1175,7 +1183,7 @@ static void test_unicode(void)
ok
(
!
ret
,
"SHCreateDirectoryExW returned %d
\n
"
,
ret
);
ok
(
file_existsW
(
UNICODE_PATH
),
"The directory was not created
\n
"
);
shfoW
.
fFlags
|=
FOF_ALLOWUNDO
;
ret
=
SHFileOperationW
(
&
shfoW
);
ret
=
p
SHFileOperationW
(
&
shfoW
);
ok
(
!
ret
,
"Directory is not removed, ErrorCode: %d
\n
"
,
ret
);
ok
(
!
file_existsW
(
UNICODE_PATH
),
"The directory should have been removed
\n
"
);
}
...
...
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