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
7d16575d
Commit
7d16575d
authored
Mar 27, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for window settings namespaces.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e46259fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
4 deletions
+105
-4
actctx.c
dlls/kernel32/tests/actctx.c
+105
-4
No files found.
dlls/kernel32/tests/actctx.c
View file @
7d16575d
...
...
@@ -464,10 +464,46 @@ static const char settings_manifest[] =
" <application xmlns=
\"
urn:schemas-microsoft-com:asm.v3
\"
>"
" <windowsSettings>"
" <dpiAware xmlns=
\"
http://schemas.microsoft.com/SMI/2005/WindowsSettings
\"
>true</dpiAware>"
" <dpiAwareness xmlns=
\"
http://schemas.microsoft.com/SMI/2016/WindowsSettings
\"
>true</dpiAwareness>"
" </windowsSettings>"
" </application>"
"</assembly>"
;
static
const
char
settings_manifest2
[]
=
"<assembly xmlns=
\"
urn:schemas-microsoft-com:asm.v1
\"
manifestVersion=
\"
1.0
\"
>"
" <assemblyIdentity version=
\"
1.0.0.0
\"
name=
\"
Wine.Test
\"
type=
\"
win32
\"
></assemblyIdentity>"
" <application xmlns=
\"
urn:schemas-microsoft-com:asm.v3
\"
"
" xmlns:ws05=
\"
http://schemas.microsoft.com/SMI/2005/WindowsSettings
\"
"
" xmlns:ws11=
\"
http://schemas.microsoft.com/SMI/2011/WindowsSettings
\"
"
" xmlns:ws16=
\"
http://schemas.microsoft.com/SMI/2016/WindowsSettings
\"
"
" xmlns:ws17=
\"
http://schemas.microsoft.com/SMI/2017/WindowsSettings
\"
>"
" <windowsSettings>"
" <ws05:autoElevate>true</ws05:autoElevate>"
" <ws05:disableTheming>true</ws05:disableTheming>"
" <ws11:disableWindowFiltering>true</ws11:disableWindowFiltering>"
" <ws05:dpiAware>true</ws05:dpiAware>"
" <ws16:dpiAwareness>true</ws16:dpiAwareness>"
" <ws17:gdiScaling>true</ws17:gdiScaling>"
" <ws17:highResolutionScrollingAware>true</ws17:highResolutionScrollingAware>"
" <ws16:longPathAware>true</ws16:longPathAware>"
" <ws17:magicFutureSetting>true</ws17:magicFutureSetting>"
" <ws11:printerDriverIsolation>true</ws11:printerDriverIsolation>"
" <ws17:ultraHighResolutionScrollingAware>true</ws17:ultraHighResolutionScrollingAware>"
" </windowsSettings>"
" </application>"
"</assembly>"
;
/* broken manifest found in some binaries: asmv3 namespace is used but not declared */
static
const
char
settings_manifest3
[]
=
"<assembly xmlns=
\"
urn:schemas-microsoft-com:asm.v1
\"
manifestVersion=
\"
1.0
\"
>"
" <assemblyIdentity version=
\"
1.0.0.0
\"
name=
\"
Wine.Test
\"
type=
\"
win32
\"
></assemblyIdentity>"
" <asmv3:application>"
" <asmv3:windowsSettings xmlns=
\"
http://schemas.microsoft.com/SMI/2005/WindowsSettings
\"
>"
" <dpiAware>true</dpiAware>"
" </asmv3:windowsSettings>"
" </asmv3:application>"
"</assembly>"
;
DEFINE_GUID
(
VISTA_COMPAT_GUID
,
0xe2011457
,
0x1546
,
0x43c5
,
0xa5
,
0xfe
,
0x00
,
0x8d
,
0xee
,
0xe3
,
0xd3
,
0xf0
);
DEFINE_GUID
(
WIN7_COMPAT_GUID
,
0x35138b9a
,
0x5d96
,
0x4fbd
,
0x8e
,
0x2d
,
0xa2
,
0x44
,
0x02
,
0x25
,
0xf9
,
0x3a
);
DEFINE_GUID
(
WIN8_COMPAT_GUID
,
0x4a2f28e3
,
0x53b9
,
0x4441
,
0xba
,
0x9c
,
0xd6
,
0x9d
,
0x4a
,
0x4a
,
0x6e
,
0x38
);
...
...
@@ -2964,9 +3000,11 @@ static void test_compatibility(void)
static
void
test_settings
(
void
)
{
static
const
WCHAR
dpiAwareW
[]
=
{
'd'
,
'p'
,
'i'
,
'A'
,
'w'
,
'a'
,
'r'
,
'e'
,
0
};
static
const
WCHAR
dpiAwarenessW
[]
=
{
'd'
,
'p'
,
'i'
,
'A'
,
'w'
,
'a'
,
'r'
,
'e'
,
'n'
,
'e'
,
's'
,
's'
,
0
};
static
const
WCHAR
dummyW
[]
=
{
'd'
,
'u'
,
'm'
,
'm'
,
'y'
,
0
};
static
const
WCHAR
trueW
[]
=
{
't'
,
'r'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
namespaceW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
's'
,
'c'
,
'h'
,
'e'
,
'm'
,
'a'
,
's'
,
'.'
,
'm'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'.'
,
'c'
,
'o'
,
'm'
,
'/'
,
'S'
,
'M'
,
'I'
,
'/'
,
'2'
,
'0'
,
'0'
,
'5'
,
'/'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
0
};
static
const
WCHAR
namespace2005W
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
's'
,
'c'
,
'h'
,
'e'
,
'm'
,
'a'
,
's'
,
'.'
,
'm'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'.'
,
'c'
,
'o'
,
'm'
,
'/'
,
'S'
,
'M'
,
'I'
,
'/'
,
'2'
,
'0'
,
'0'
,
'5'
,
'/'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
0
};
static
const
WCHAR
namespace2016W
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
's'
,
'c'
,
'h'
,
'e'
,
'm'
,
'a'
,
's'
,
'.'
,
'm'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'.'
,
'c'
,
'o'
,
'm'
,
'/'
,
'S'
,
'M'
,
'I'
,
'/'
,
'2'
,
'0'
,
'1'
,
'6'
,
'/'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
0
};
WCHAR
buffer
[
80
];
SIZE_T
size
;
HANDLE
handle
;
...
...
@@ -3001,26 +3039,60 @@ static void test_settings(void)
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
NULL
,
dummyW
,
buffer
,
80
,
&
size
);
ok
(
!
ret
,
"QueryActCtxSettingsW
failed err %u
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"QueryActCtxSettingsW
succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_SXS_KEY_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
buffer
[
0
]
==
0xcccc
,
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
namespaceW
,
dpiAwareW
,
buffer
,
80
,
&
size
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
namespace
2005
W
,
dpiAwareW
,
buffer
,
80
,
&
size
);
ok
(
ret
,
"QueryActCtxSettingsW failed err %u
\n
"
,
GetLastError
()
);
ok
(
!
lstrcmpW
(
buffer
,
trueW
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
ok
(
size
==
sizeof
(
trueW
)
/
sizeof
(
WCHAR
),
"wrong len %lu
\n
"
,
size
);
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
namespaceW
,
dpiAwareW
,
buffer
,
lstrlenW
(
trueW
)
+
1
,
&
size
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
namespace
2005
W
,
dpiAwareW
,
buffer
,
lstrlenW
(
trueW
)
+
1
,
&
size
);
ok
(
ret
,
"QueryActCtxSettingsW failed err %u
\n
"
,
GetLastError
()
);
ok
(
!
lstrcmpW
(
buffer
,
trueW
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
ok
(
size
==
sizeof
(
trueW
)
/
sizeof
(
WCHAR
),
"wrong len %lu
\n
"
,
size
);
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
namespace2016W
,
dpiAwareW
,
buffer
,
lstrlenW
(
trueW
)
+
1
,
&
size
);
ok
(
!
ret
,
"QueryActCtxSettingsW succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_SXS_KEY_NOT_FOUND
||
broken
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
),
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
buffer
[
0
]
==
0xcccc
,
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
NULL
,
dpiAwarenessW
,
buffer
,
lstrlenW
(
trueW
)
+
1
,
&
size
);
ok
(
!
ret
,
"QueryActCtxSettingsW succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_SXS_KEY_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
buffer
[
0
]
==
0xcccc
,
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
namespace2005W
,
dpiAwarenessW
,
buffer
,
lstrlenW
(
trueW
)
+
1
,
&
size
);
ok
(
!
ret
,
"QueryActCtxSettingsW succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_SXS_KEY_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
buffer
[
0
]
==
0xcccc
,
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
namespace2016W
,
dpiAwarenessW
,
buffer
,
lstrlenW
(
trueW
)
+
1
,
&
size
);
ok
(
ret
||
broken
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
),
"QueryActCtxSettingsW failed err %u
\n
"
,
GetLastError
()
);
if
(
ret
)
{
ok
(
!
lstrcmpW
(
buffer
,
trueW
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
ok
(
size
==
sizeof
(
trueW
)
/
sizeof
(
WCHAR
),
"wrong len %lu
\n
"
,
size
);
}
else
ok
(
buffer
[
0
]
==
0xcccc
,
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
NULL
,
dpiAwareW
,
buffer
,
lstrlenW
(
trueW
),
&
size
);
ok
(
ret
,
"QueryActCtxSettingsW failed err %u
\n
"
,
GetLastError
()
);
ok
(
!
lstrcmpW
(
buffer
,
trueW
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
...
...
@@ -3034,6 +3106,35 @@ static void test_settings(void)
ok
(
buffer
[
0
]
==
0xcccc
,
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
ok
(
size
==
sizeof
(
trueW
)
/
sizeof
(
WCHAR
),
"wrong len %lu
\n
"
,
size
);
pReleaseActCtx
(
handle
);
create_manifest_file
(
"manifest_settings2.manifest"
,
settings_manifest2
,
-
1
,
NULL
,
NULL
);
handle
=
test_create
(
"manifest_settings2.manifest"
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
||
broken
(
handle
==
INVALID_HANDLE_VALUE
),
/* <= vista */
"handle == INVALID_HANDLE_VALUE, error %u
\n
"
,
GetLastError
()
);
DeleteFileA
(
"manifest_settings2.manifest"
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
NULL
,
dpiAwareW
,
buffer
,
80
,
&
size
);
ok
(
ret
,
"QueryActCtxSettingsW failed err %u
\n
"
,
GetLastError
()
);
ok
(
!
lstrcmpW
(
buffer
,
trueW
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
ok
(
size
==
lstrlenW
(
buffer
)
+
1
,
"wrong len %lu
\n
"
,
size
);
pReleaseActCtx
(
handle
);
}
create_manifest_file
(
"manifest_settings3.manifest"
,
settings_manifest3
,
-
1
,
NULL
,
NULL
);
handle
=
test_create
(
"manifest_settings3.manifest"
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"handle == INVALID_HANDLE_VALUE, error %u
\n
"
,
GetLastError
()
);
DeleteFileA
(
"manifest_settings3.manifest"
);
SetLastError
(
0xdeadbeef
);
size
=
0xdead
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
pQueryActCtxSettingsW
(
0
,
handle
,
NULL
,
dpiAwareW
,
buffer
,
80
,
&
size
);
ok
(
!
ret
,
"QueryActCtxSettingsW succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_SXS_KEY_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
pReleaseActCtx
(
handle
);
}
START_TEST
(
actctx
)
...
...
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