Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
914cb228
Commit
914cb228
authored
May 26, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add the tests for GetWindowModuleFileName.
parent
90f07959
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
1 deletion
+72
-1
win.c
dlls/user32/tests/win.c
+72
-1
No files found.
dlls/user32/tests/win.c
View file @
914cb228
...
...
@@ -4631,6 +4631,77 @@ static void test_Expose(void)
DestroyWindow
(
mw
);
}
static
void
test_GetWindowModuleFileName
(
void
)
{
HWND
hwnd
;
HINSTANCE
hinst
;
UINT
ret1
,
ret2
;
char
buf1
[
MAX_PATH
],
buf2
[
MAX_PATH
];
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
assert
(
hwnd
);
hinst
=
(
HINSTANCE
)
GetWindowLongPtr
(
hwnd
,
GWLP_HINSTANCE
);
ok
(
hinst
==
0
,
"expected 0, got %p
\n
"
,
hinst
);
buf1
[
0
]
=
0
;
SetLastError
(
0xdeadbeef
);
ret1
=
GetModuleFileName
(
hinst
,
buf1
,
sizeof
(
buf1
));
ok
(
ret1
,
"GetModuleFileName error %u
\n
"
,
GetLastError
());
buf2
[
0
]
=
0
;
SetLastError
(
0xdeadbeef
);
ret2
=
GetWindowModuleFileName
(
hwnd
,
buf2
,
sizeof
(
buf2
));
ok
(
ret2
,
"GetWindowModuleFileName error %u
\n
"
,
GetLastError
());
ok
(
ret1
==
ret2
,
"%u != %u
\n
"
,
ret1
,
ret2
);
ok
(
!
strcmp
(
buf1
,
buf2
),
"%s != %s
\n
"
,
buf1
,
buf2
);
hinst
=
GetModuleHandle
(
0
);
/* MSDN mentions ERROR_INSUFFICIENT_BUFFER, but XP doesn't do it */
SetLastError
(
0xdeadbeef
);
ret2
=
GetModuleFileName
(
hinst
,
buf2
,
ret1
-
2
);
ok
(
ret2
==
ret1
-
2
,
"expected %u, got %u
\n
"
,
ret1
-
2
,
ret2
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret2
=
GetModuleFileName
(
hinst
,
buf2
,
0
);
ok
(
!
ret2
,
"GetModuleFileName should return 0
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret2
=
GetWindowModuleFileName
(
hwnd
,
buf2
,
ret1
-
2
);
ok
(
ret2
==
ret1
-
2
,
"expected %u, got %u
\n
"
,
ret1
-
2
,
ret2
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret2
=
GetWindowModuleFileName
(
hwnd
,
buf2
,
0
);
ok
(
!
ret2
,
"expected 0, got %u
\n
"
,
ret2
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %u
\n
"
,
GetLastError
());
DestroyWindow
(
hwnd
);
buf2
[
0
]
=
0
;
hwnd
=
(
HWND
)
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret1
=
GetWindowModuleFileName
(
hwnd
,
buf1
,
sizeof
(
buf1
));
ok
(
!
ret1
,
"expected 0, got %u
\n
"
,
ret1
);
ok
(
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
,
"expected ERROR_INVALID_WINDOW_HANDLE, got %u
\n
"
,
GetLastError
());
hwnd
=
GetDesktopWindow
();
ok
(
IsWindow
(
hwnd
),
"got invalid desktop window %p
\n
"
,
hwnd
);
SetLastError
(
0xdeadbeef
);
ret1
=
GetWindowModuleFileName
(
hwnd
,
buf1
,
sizeof
(
buf1
));
ok
(
!
ret1
,
"expected 0, got %u
\n
"
,
ret1
);
hwnd
=
FindWindow
(
"Shell_TrayWnd"
,
NULL
);
ok
(
IsWindow
(
hwnd
),
"got invalid tray window %p
\n
"
,
hwnd
);
SetLastError
(
0xdeadbeef
);
ret1
=
GetWindowModuleFileName
(
hwnd
,
buf1
,
sizeof
(
buf1
));
ok
(
!
ret1
,
"expected 0, got %u
\n
"
,
ret1
);
}
START_TEST
(
win
)
{
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
...
...
@@ -4675,7 +4746,7 @@ START_TEST(win)
/* Add the tests below this line */
test_params
();
test_GetWindowModuleFileName
();
test_capture_1
();
test_capture_2
();
test_capture_3
(
hwndMain
,
hwndMain2
);
...
...
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