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
f3a87a92
Commit
f3a87a92
authored
Feb 20, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shcore/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6dc3d258
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
69 deletions
+68
-69
Makefile.in
dlls/shcore/tests/Makefile.in
+0
-1
shcore.c
dlls/shcore/tests/shcore.c
+68
-68
No files found.
dlls/shcore/tests/Makefile.in
View file @
f3a87a92
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
shcore.dll
IMPORTS
=
advapi32
...
...
dlls/shcore/tests/shcore.c
View file @
f3a87a92
...
...
@@ -138,30 +138,30 @@ static void test_process_reference(void)
obj
=
(
void
*
)
0xdeadbeef
;
hr
=
pGetProcessReference
(
&
obj
);
ok
(
hr
==
E_FAIL
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Unexpected hr %#
l
x.
\n
"
,
hr
);
ok
(
obj
==
NULL
,
"Unexpected pointer.
\n
"
);
test_unk_init
(
&
test_unk
);
test_unk_init
(
&
test_unk2
);
pSetProcessReference
(
&
test_unk
.
IUnknown_iface
);
ok
(
test_unk
.
refcount
==
1
,
"Unexpected refcount %u.
\n
"
,
test_unk
.
refcount
);
ok
(
test_unk
.
refcount
==
1
,
"Unexpected refcount %
l
u.
\n
"
,
test_unk
.
refcount
);
pSetProcessReference
(
&
test_unk2
.
IUnknown_iface
);
ok
(
test_unk
.
refcount
==
1
,
"Unexpected refcount %u.
\n
"
,
test_unk
.
refcount
);
ok
(
test_unk2
.
refcount
==
1
,
"Unexpected refcount %u.
\n
"
,
test_unk2
.
refcount
);
ok
(
test_unk
.
refcount
==
1
,
"Unexpected refcount %
l
u.
\n
"
,
test_unk
.
refcount
);
ok
(
test_unk2
.
refcount
==
1
,
"Unexpected refcount %
l
u.
\n
"
,
test_unk2
.
refcount
);
hr
=
pGetProcessReference
(
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to get reference, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get reference, hr %#
l
x.
\n
"
,
hr
);
ok
(
obj
==
&
test_unk2
.
IUnknown_iface
,
"Unexpected pointer.
\n
"
);
ok
(
test_unk2
.
refcount
==
2
,
"Unexpected refcount %u.
\n
"
,
test_unk2
.
refcount
);
ok
(
test_unk2
.
refcount
==
2
,
"Unexpected refcount %
l
u.
\n
"
,
test_unk2
.
refcount
);
hmod
=
LoadLibraryA
(
"shell32.dll"
);
pSHGetInstanceExplorer
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHGetInstanceExplorer"
);
hr
=
pSHGetInstanceExplorer
(
&
obj
);
ok
(
hr
==
S_OK
,
"Failed to get reference, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get reference, hr %#
l
x.
\n
"
,
hr
);
ok
(
obj
==
&
test_unk2
.
IUnknown_iface
,
"Unexpected pointer.
\n
"
);
ok
(
test_unk2
.
refcount
==
3
,
"Unexpected refcount %u.
\n
"
,
test_unk2
.
refcount
);
ok
(
test_unk2
.
refcount
==
3
,
"Unexpected refcount %
l
u.
\n
"
,
test_unk2
.
refcount
);
}
static
void
test_SHUnicodeToAnsi
(
void
)
...
...
@@ -334,7 +334,7 @@ static void test_SHRegDuplicateHKey(void)
DWORD
ret
;
ret
=
RegCreateKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
&
hkey
);
ok
(
!
ret
,
"Failed to create test key, ret %d.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to create test key, ret %
l
d.
\n
"
,
ret
);
hkey2
=
pSHRegDuplicateHKey
(
hkey
);
ok
(
hkey2
!=
NULL
&&
hkey2
!=
hkey
,
"Unexpected duplicate key.
\n
"
);
...
...
@@ -351,20 +351,20 @@ static void test_SHDeleteKey(void)
DWORD
ret
;
ret
=
RegCreateKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
&
hkey
);
ok
(
!
ret
,
"Failed to create test key, %d.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to create test key, %
l
d.
\n
"
,
ret
);
ret
=
RegCreateKeyA
(
hkey
,
"delete_key"
,
&
hkey2
);
ok
(
!
ret
,
"Failed to create test key, %d.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to create test key, %
l
d.
\n
"
,
ret
);
RegCloseKey
(
hkey2
);
ret
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
);
ok
(
ret
==
ERROR_ACCESS_DENIED
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
ret
==
ERROR_ACCESS_DENIED
,
"Unexpected return value %
l
d.
\n
"
,
ret
);
ret
=
pSHDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
);
ok
(
!
ret
,
"
Failed to delete a key, %d
.
\n
"
,
ret
);
ok
(
!
ret
,
"
Unexpected retval %lu
.
\n
"
,
ret
);
ret
=
RegCloseKey
(
hkey
);
ok
(
!
ret
,
"
Failed to delete a key, %d
.
\n
"
,
ret
);
ok
(
!
ret
,
"
Unexpected retval %lu
.
\n
"
,
ret
);
}
static
HKEY
create_test_entries
(
void
)
...
...
@@ -377,7 +377,7 @@ static HKEY create_test_entries(void)
SetEnvironmentVariableA
(
"FOO"
,
test_envvar2
);
ret
=
RegCreateKeyA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
&
hKey
);
ok
(
!
ret
,
"
RegCreateKeyA failed, ret=%u
\n
"
,
ret
);
ok
(
!
ret
,
"
Unexpected retval %lu.
\n
"
,
ret
);
if
(
hKey
)
{
...
...
@@ -431,18 +431,18 @@ static void test_SHGetValue(void)
size
=
MAX_PATH
;
type
=
-
1
;
ret
=
pSHGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
&
type
,
buf
,
&
size
);
ok
(
!
ret
,
"Failed to get value, ret %u.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to get value, ret %
l
u.
\n
"
,
ret
);
ok
(
!
strcmp
(
test_exp_path1
,
buf
),
"Unexpected value %s.
\n
"
,
buf
);
ok
(
type
==
REG_SZ
,
"Unexpected
value type %
d.
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"Unexpected
type %l
d.
\n
"
,
type
);
strcpy
(
buf
,
initial_buffer
);
size
=
MAX_PATH
;
type
=
-
1
;
ret
=
pSHGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
&
type
,
buf
,
&
size
);
ok
(
!
ret
,
"Failed to get value, ret %u.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to get value, ret %
l
u.
\n
"
,
ret
);
ok
(
!
strcmp
(
test_path1
,
buf
),
"Unexpected value %s.
\n
"
,
buf
);
ok
(
type
==
REG_SZ
,
"Unexpected
value type %
d.
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"Unexpected
type %l
d.
\n
"
,
type
);
delete_key
(
hkey
,
"Software
\\
Wine"
,
"Test"
);
}
...
...
@@ -457,31 +457,31 @@ static void test_SHRegGetValue(void)
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
SRRF_RT_REG_EXPAND_SZ
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"
SHRegGetValue failed, ret=%u
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"
Unexpected retval %lu.
\n
"
,
ret
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
SRRF_RT_REG_SZ
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_SUCCESS
,
"SHRegGetValue failed, ret=%u
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected retval %lu.
\n
"
,
ret
);
ok
(
!
strcmp
(
data
,
test_exp_path1
),
"data = %s, expected %s
\n
"
,
data
,
test_exp_path1
);
ok
(
type
==
REG_SZ
,
"
type = %d, expected REG_SZ
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"
Unexpected type %ld.
\n
"
,
type
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
SRRF_RT_REG_DWORD
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_UNSUPPORTED_TYPE
,
"
SHRegGetValue failed, ret=%u
\n
"
,
ret
);
ok
(
ret
==
ERROR_UNSUPPORTED_TYPE
,
"
Unexpected retval %lu.
\n
"
,
ret
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
SRRF_RT_REG_EXPAND_SZ
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"
SHRegGetValue failed, ret=%u
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"
Unexpected retval %lu.
\n
"
,
ret
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
SRRF_RT_REG_SZ
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_SUCCESS
,
"SHRegGetValue failed, ret=%u
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected retval %lu.
\n
"
,
ret
);
ok
(
!
strcmp
(
data
,
test_path1
),
"data = %s, expected %s
\n
"
,
data
,
test_path1
);
ok
(
type
==
REG_SZ
,
"
type = %d, expected REG_SZ
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"
Unexpected type %ld.
\n
"
,
type
);
size
=
MAX_PATH
;
ret
=
pSHRegGetValueA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test2"
,
SRRF_RT_REG_QWORD
,
&
type
,
data
,
&
size
);
ok
(
ret
==
ERROR_UNSUPPORTED_TYPE
,
"
SHRegGetValue failed, ret=%u
\n
"
,
ret
);
ok
(
ret
==
ERROR_UNSUPPORTED_TYPE
,
"
Unexpected retval %lu.
\n
"
,
ret
);
delete_key
(
hkey
,
"Software
\\
Wine"
,
"Test"
);
}
...
...
@@ -496,7 +496,7 @@ static void test_SHQueryValueEx(void)
testkey
=
create_test_entries
();
ret
=
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
0
,
KEY_QUERY_VALUE
,
&
hKey
);
ok
(
!
ret
,
"Failed to open a key, ret %u.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to open a key, ret %
l
u.
\n
"
,
ret
);
/****** SHQueryValueExA ******/
...
...
@@ -507,28 +507,28 @@ static void test_SHQueryValueEx(void)
* Case 1.1 All arguments are NULL
*/
ret
=
pSHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
,
"Failed to query value, ret %u.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to query value, ret %
l
u.
\n
"
,
ret
);
/*
* Case 1.2 dwType is set
*/
type
=
-
1
;
ret
=
pSHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
&
type
,
NULL
,
NULL
);
ok
(
!
ret
,
"Failed to query value, ret %u.
\n
"
,
ret
);
ok
(
type
==
REG_SZ
,
"
Expected REG_SZ, got (%u)
\n
"
,
type
);
ok
(
!
ret
,
"Failed to query value, ret %
l
u.
\n
"
,
ret
);
ok
(
type
==
REG_SZ
,
"
Unexpected type %ld.
\n
"
,
type
);
size
=
6
;
ret
=
pSHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
NULL
,
NULL
,
&
size
);
ok
(
!
ret
,
"Failed to query value, ret %u.
\n
"
,
ret
);
ok
(
size
==
buffer_len1
,
"Buffer sizes
(%u) and (%u)
are not equal
\n
"
,
size
,
buffer_len1
);
ok
(
!
ret
,
"Failed to query value, ret %
l
u.
\n
"
,
ret
);
ok
(
size
==
buffer_len1
,
"Buffer sizes
%lu and %lu
are not equal
\n
"
,
size
,
buffer_len1
);
/*
* Expanded > unexpanded
*/
size
=
6
;
ret
=
pSHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
NULL
,
NULL
,
&
size
);
ok
(
!
ret
,
"Failed to query value, ret %u.
\n
"
,
ret
);
ok
(
size
>=
buffer_len2
,
"Buffer size
(%u) should be >= (%u)
\n
"
,
size
,
buffer_len2
);
ok
(
!
ret
,
"Failed to query value, ret %
l
u.
\n
"
,
ret
);
ok
(
size
>=
buffer_len2
,
"Buffer size
%lu should be >= %lu.
\n
"
,
size
,
buffer_len2
);
/*
* Case 1 string shrinks during expanding
...
...
@@ -537,10 +537,10 @@ static void test_SHQueryValueEx(void)
size
=
6
;
type
=
-
1
;
ret
=
pSHQueryValueExA
(
hKey
,
"Test1"
,
NULL
,
&
type
,
buf
,
&
size
);
ok
(
ret
==
ERROR_MORE_DATA
,
"
Expected ERROR_MORE_DATA, got (%u)
\n
"
,
ret
);
ok
(
ret
==
ERROR_MORE_DATA
,
"
Unexpected retval %ld.
\n
"
,
ret
);
ok
(
!
strcmp
(
initial_buffer
,
buf
),
"Comparing (%s) with (%s) failed
\n
"
,
buf
,
initial_buffer
);
ok
(
size
==
buffer_len1
,
"Buffer sizes
(%u) and (%u)
are not equal
\n
"
,
size
,
buffer_len1
);
ok
(
type
==
REG_SZ
,
"
Expected REG_SZ, got (%u)
\n
"
,
type
);
ok
(
size
==
buffer_len1
,
"Buffer sizes
%lu and %lu
are not equal
\n
"
,
size
,
buffer_len1
);
ok
(
type
==
REG_SZ
,
"
Unexpected type %ld.
\n
"
,
type
);
/*
* string grows during expanding
...
...
@@ -550,10 +550,10 @@ static void test_SHQueryValueEx(void)
size
=
6
;
type
=
-
1
;
ret
=
pSHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
type
,
buf
,
&
size
);
ok
(
ret
==
ERROR_MORE_DATA
,
"
Expected ERROR_MORE_DATA, got (%u)
\n
"
,
ret
);
ok
(
ret
==
ERROR_MORE_DATA
,
"
Unexpected retval %ld.
\n
"
,
ret
);
ok
(
!
strcmp
(
initial_buffer
,
buf
),
"Comparing (%s) with (%s) failed
\n
"
,
buf
,
initial_buffer
);
ok
(
size
>=
buffer_len2
,
"Buffer size
(%u) should be >= (%u)
\n
"
,
size
,
buffer_len2
);
ok
(
type
==
REG_SZ
,
"
Expected REG_SZ, got (%u)
\n
"
,
type
);
ok
(
size
>=
buffer_len2
,
"Buffer size
%lu should be >= %lu.
\n
"
,
size
,
buffer_len2
);
ok
(
type
==
REG_SZ
,
"
Unexpected type %ld.
\n
"
,
type
);
/*
* string grows during expanding
...
...
@@ -565,15 +565,15 @@ static void test_SHQueryValueEx(void)
size
=
strlen
(
test_envvar2
)
-
2
;
type
=
-
1
;
ret
=
pSHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
type
,
buf
,
&
size
);
ok
(
ret
==
ERROR_MORE_DATA
,
"
Expected ERROR_MORE_DATA, got (%u)
\n
"
,
ret
);
ok
(
ret
==
ERROR_MORE_DATA
,
"
Unexpected retval %ld.
\n
"
,
ret
);
todo_wine
{
ok
(
!
strcmp
(
""
,
buf
),
"Unexpanded string %s.
\n
"
,
buf
);
}
ok
(
size
>=
buffer_len2
,
"Buffer size
(%u) should be >= (%u)
\n
"
,
size
,
buffer_len2
);
ok
(
type
==
REG_SZ
,
"
Expected REG_SZ, got (%u)
\n
"
,
type
);
ok
(
size
>=
buffer_len2
,
"Buffer size
%lu should be >= %lu.
\n
"
,
size
,
buffer_len2
);
ok
(
type
==
REG_SZ
,
"
Unexpected type %ld.
\n
"
,
type
);
/*
* string grows during expanding
...
...
@@ -585,7 +585,7 @@ static void test_SHQueryValueEx(void)
size
=
exp_len2
-
4
;
type
=
-
1
;
ret
=
pSHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
type
,
buf
,
&
size
);
ok
(
ret
==
ERROR_MORE_DATA
,
"
Expected ERROR_MORE_DATA, got (%u)
\n
"
,
ret
);
ok
(
ret
==
ERROR_MORE_DATA
,
"
Unexpected retval %ld.
\n
"
,
ret
);
todo_wine
{
...
...
@@ -593,8 +593,8 @@ static void test_SHQueryValueEx(void)
"Expected empty or first part of the string
\"
%s
\"
, got
\"
%s
\"\n
"
,
test_envvar2
,
buf
);
}
ok
(
size
>=
buffer_len2
,
"Buffer size
(%u) should be >= (%u)
\n
"
,
size
,
buffer_len2
);
ok
(
type
==
REG_SZ
,
"
Expected REG_SZ, got (%u)
\n
"
,
type
);
ok
(
size
>=
buffer_len2
,
"Buffer size
%lu should be >= %lu.
\n
"
,
size
,
buffer_len2
);
ok
(
type
==
REG_SZ
,
"
Unexpected type %ld.
\n
"
,
type
);
/*
* The buffer is NULL but the size is set
...
...
@@ -603,9 +603,9 @@ static void test_SHQueryValueEx(void)
size
=
6
;
type
=
-
1
;
ret
=
pSHQueryValueExA
(
hKey
,
"Test3"
,
NULL
,
&
type
,
NULL
,
&
size
);
ok
(
!
ret
,
"Failed to query value, ret %u.
\n
"
,
ret
);
ok
(
size
>=
buffer_len2
,
"Buffer size
(%u) should be >= (%u)
\n
"
,
size
,
buffer_len2
);
ok
(
type
==
REG_SZ
,
"
Expected REG_SZ, got (%u)
\n
"
,
type
);
ok
(
!
ret
,
"Failed to query value, ret %
l
u.
\n
"
,
ret
);
ok
(
size
>=
buffer_len2
,
"Buffer size
%lu should be >= %lu.
\n
"
,
size
,
buffer_len2
);
ok
(
type
==
REG_SZ
,
"
Unexpected type %ld.
\n
"
,
type
);
RegCloseKey
(
hKey
);
...
...
@@ -622,7 +622,7 @@ static void test_SHRegGetPath(void)
strcpy
(
buf
,
initial_buffer
);
ret
=
pSHRegGetPathA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
,
"Test1"
,
buf
,
0
);
ok
(
!
ret
,
"Failed to get path, ret %u.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to get path, ret %
l
u.
\n
"
,
ret
);
ok
(
!
strcmp
(
test_exp_path1
,
buf
),
"Unexpected path %s.
\n
"
,
buf
);
delete_key
(
hkey
,
"Software
\\
Wine"
,
"Test"
);
...
...
@@ -645,14 +645,14 @@ static void test_SHCopyKey(void)
hKeyDst
=
NULL
;
ret
=
RegCreateKeyA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
"
\\
CopyDestination"
,
&
hKeyDst
);
ok
(
!
ret
,
"Failed to create a test key, ret %d.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to create a test key, ret %
l
d.
\n
"
,
ret
);
hKeySrc
=
NULL
;
ret
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
REG_CURRENT_VERSION
,
&
hKeySrc
);
ok
(
!
ret
,
"Failed to open a test key, ret %d.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to open a test key, ret %
l
d.
\n
"
,
ret
);
ret
=
pSHCopyKeyA
(
hKeySrc
,
NULL
,
hKeyDst
,
0
);
ok
(
!
ret
,
"Copy failed, ret
=(%u)
\n
"
,
ret
);
ok
(
!
ret
,
"Copy failed, ret
%lu.
\n
"
,
ret
);
RegCloseKey
(
hKeySrc
);
RegCloseKey
(
hKeyDst
);
...
...
@@ -660,7 +660,7 @@ static void test_SHCopyKey(void)
/* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
hKeyDst
=
NULL
;
ret
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
REG_TEST_KEY
"
\\
CopyDestination
\\
Shell Folders"
,
&
hKeyDst
);
ok
(
!
ret
,
"Failed to open a test key, ret %d.
\n
"
,
ret
);
ok
(
!
ret
,
"Failed to open a test key, ret %
l
d.
\n
"
,
ret
);
/* And the we copied the values too */
ok
(
!
pSHQueryValueExA
(
hKeyDst
,
"Common AppData"
,
NULL
,
NULL
,
NULL
,
NULL
),
"SHQueryValueExA failed
\n
"
);
...
...
@@ -676,7 +676,7 @@ static void _check_file_size(const CHAR *filename, LONG exp_size, int line)
DWORD
file_size
=
0xdeadbeef
;
handle
=
CreateFileA
(
filename
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
file_size
=
GetFileSize
(
handle
,
NULL
);
ok_
(
__FILE__
,
line
)(
file_size
==
exp_size
,
"got wrong file size: %d.
\n
"
,
file_size
);
ok_
(
__FILE__
,
line
)(
file_size
==
exp_size
,
"got wrong file size: %
l
d.
\n
"
,
file_size
);
CloseHandle
(
handle
);
}
...
...
@@ -688,11 +688,11 @@ static void _check_stream_size(IStream *obj, LONG exp_size, int line)
HRESULT
hr
;
stream_size
.
QuadPart
=
0xdeadbeef
;
hr
=
pIStream_Size
(
obj
,
&
stream_size
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"IStream_Size failed:
0x%08
x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"IStream_Size failed:
hr %#l
x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
stream_size
.
QuadPart
==
exp_size
,
"Size(): got wrong size of stream: %s.
\n
"
,
wine_dbgstr_longlong
(
stream_size
.
QuadPart
));
hr
=
IStream_Stat
(
obj
,
&
stat
,
STATFLAG_NONAME
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"IStream_Stat failed:
0x%08
x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"IStream_Stat failed:
hr %#l
x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
stat
.
cbSize
.
QuadPart
==
exp_size
,
"Stat(): got wrong size of stream: %s.
\n
"
,
wine_dbgstr_longlong
(
stat
.
cbSize
.
QuadPart
));
}
...
...
@@ -706,7 +706,7 @@ static void _check_stream_pos(IStream *obj, LONG exp_pos, int line)
move
.
QuadPart
=
0
;
pos
.
QuadPart
=
0xdeadbeef
;
hr
=
IStream_Seek
(
obj
,
move
,
STREAM_SEEK_CUR
,
&
pos
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"IStream_Seek failed:
0x%08
x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"IStream_Seek failed:
hr %#l
x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
pos
.
QuadPart
==
exp_pos
,
"got wrong position: %s.
\n
"
,
wine_dbgstr_longlong
(
pos
.
QuadPart
));
}
...
...
@@ -722,32 +722,32 @@ static void test_stream_size(void)
HRESULT
hr
;
handle
=
CreateFileA
(
filename
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"File creation failed:
0x%08x
.
\n
"
,
GetLastError
());
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"File creation failed:
%lu
.
\n
"
,
GetLastError
());
WriteFile
(
handle
,
test_data
,
sizeof
(
test_data
),
&
written
,
NULL
);
ok
(
written
==
sizeof
(
test_data
),
"Failed to write data into file.
\n
"
);
CloseHandle
(
handle
);
/* in read-only mode, SetSize() will success but it has no effect on Size() and the file */
hr
=
pSHCreateStreamOnFileA
(
filename
,
STGM_FAILIFTHERE
|
STGM_READ
,
&
stream
);
ok
(
hr
==
S_OK
,
"
SHCreateStreamOnFileA failed: 0x%08
x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"
Unexpected hr %#l
x.
\n
"
,
hr
);
CHECK_STREAM_SIZE
(
stream
,
sizeof
(
test_data
));
stream_size
.
QuadPart
=
0
;
hr
=
IStream_SetSize
(
stream
,
stream_size
);
ok
(
hr
==
S_OK
,
"
IStream_SetSize failed: 0x%08
x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"
Unexpected hr %#l
x.
\n
"
,
hr
);
CHECK_STREAM_SIZE
(
stream
,
sizeof
(
test_data
));
CHECK_STREAM_POS
(
stream
,
0
);
stream_size
.
QuadPart
=
100
;
hr
=
IStream_SetSize
(
stream
,
stream_size
);
ok
(
hr
==
S_OK
,
"
IStream_SetSize failed: 0x%08
x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"
Unexpected hr %#l
x.
\n
"
,
hr
);
CHECK_STREAM_SIZE
(
stream
,
sizeof
(
test_data
));
CHECK_STREAM_POS
(
stream
,
100
);
IStream_Release
(
stream
);
CHECK_FILE_SIZE
(
filename
,
sizeof
(
test_data
));
hr
=
pSHCreateStreamOnFileA
(
filename
,
STGM_FAILIFTHERE
|
STGM_WRITE
,
&
stream
);
ok
(
hr
==
S_OK
,
"
SHCreateStreamOnFileA failed: 0x%08
x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"
Unexpected hr %#l
x.
\n
"
,
hr
);
hr
=
pSHCreateStreamOnFileA
(
filename
,
STGM_FAILIFTHERE
|
STGM_READ
,
&
stream2
);
ok
(
hr
==
S_OK
,
"
SHCreateStreamOnFileA failed: 0x%08
x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"
Unexpected hr %#l
x.
\n
"
,
hr
);
CHECK_STREAM_SIZE
(
stream
,
sizeof
(
test_data
));
CHECK_STREAM_SIZE
(
stream2
,
sizeof
(
test_data
));
CHECK_STREAM_POS
(
stream
,
0
);
...
...
@@ -755,7 +755,7 @@ static void test_stream_size(void)
stream_size
.
QuadPart
=
0
;
hr
=
IStream_SetSize
(
stream
,
stream_size
);
ok
(
hr
==
S_OK
,
"
IStream_SetSize failed: 0x%08
x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"
Unexpected hr %#l
x.
\n
"
,
hr
);
CHECK_STREAM_SIZE
(
stream
,
0
);
CHECK_STREAM_SIZE
(
stream2
,
0
);
CHECK_STREAM_POS
(
stream
,
0
);
...
...
@@ -763,7 +763,7 @@ static void test_stream_size(void)
stream_size
.
QuadPart
=
100
;
hr
=
IStream_SetSize
(
stream
,
stream_size
);
ok
(
hr
==
S_OK
,
"
IStream_SetSize failed: 0x%08
x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"
Unexpected hr %#l
x.
\n
"
,
hr
);
CHECK_STREAM_SIZE
(
stream
,
100
);
CHECK_STREAM_SIZE
(
stream2
,
100
);
CHECK_STREAM_POS
(
stream
,
0
);
...
...
@@ -771,7 +771,7 @@ static void test_stream_size(void)
stream_size
.
QuadPart
=
90
;
hr
=
IStream_SetSize
(
stream2
,
stream_size
);
ok
(
hr
==
S_OK
,
"
IStream_SetSize failed: 0x%08
x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"
Unexpected hr %#l
x.
\n
"
,
hr
);
CHECK_STREAM_SIZE
(
stream
,
100
);
CHECK_STREAM_SIZE
(
stream2
,
100
);
CHECK_STREAM_POS
(
stream
,
0
);
...
...
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