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
92167f60
Commit
92167f60
authored
Sep 12, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Get/SetClassLongPtr to access the module handle.
parent
2c1b3c6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
class.c
dlls/user/tests/class.c
+11
-11
No files found.
dlls/user/tests/class.c
View file @
92167f60
...
...
@@ -248,9 +248,9 @@ static void check_instance( const char *name, HINSTANCE inst, HINSTANCE info_ins
wc
.
hInstance
,
info_inst
,
name
);
hwnd
=
CreateWindowExA
(
0
,
name
,
"test_window"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
inst
,
0
);
ok
(
hwnd
!=
NULL
,
"Couldn't create window for class %s inst %p
\n
"
,
name
,
inst
);
ok
(
(
HINSTANCE
)
GetClassLong
A
(
hwnd
,
GCL
_HMODULE
)
==
gcl_inst
,
ok
(
(
HINSTANCE
)
GetClassLong
PtrA
(
hwnd
,
GCLP
_HMODULE
)
==
gcl_inst
,
"Wrong GCL instance %p/%p for class %s
\n
"
,
(
HINSTANCE
)
GetClassLong
A
(
hwnd
,
GCL
_HMODULE
),
gcl_inst
,
name
);
(
HINSTANCE
)
GetClassLong
PtrA
(
hwnd
,
GCLP
_HMODULE
),
gcl_inst
,
name
);
ok
(
(
HINSTANCE
)
GetWindowLongPtrA
(
hwnd
,
GWLP_HINSTANCE
)
==
inst
,
"Wrong GWL instance %p/%p for window %s
\n
"
,
(
HINSTANCE
)
GetWindowLongPtrA
(
hwnd
,
GWLP_HINSTANCE
),
inst
,
name
);
...
...
@@ -363,7 +363,7 @@ static void test_instances(void)
ok
(
UnregisterClassA
(
name
,
kernel32
),
"Unregister failed for kernel32
\n
"
);
/* changing the instance doesn't make it global */
SetClassLong
A
(
hwnd
,
GCL
_HMODULE
,
0
);
SetClassLong
PtrA
(
hwnd
,
GCLP
_HMODULE
,
0
);
ok
(
RegisterClassA
(
&
cls
),
"Failed to register local class for kernel32
\n
"
);
check_class
(
kernel32
,
name
,
"kernel32"
);
check_instance
(
name
,
kernel32
,
kernel32
,
kernel32
);
...
...
@@ -372,7 +372,7 @@ static void test_instances(void)
ok
(
UnregisterClassA
(
name
,
kernel32
),
"Unregister failed for kernel32
\n
"
);
/* GetClassInfo with instance 0 finds user32 instance */
SetClassLong
A
(
hwnd
,
GCL_HMODULE
,
(
LONG
)
user32
);
SetClassLong
PtrA
(
hwnd
,
GCLP_HMODULE
,
(
LONG_PTR
)
user32
);
ok
(
RegisterClassA
(
&
cls
),
"Failed to register local class for kernel32
\n
"
);
check_class
(
kernel32
,
name
,
"kernel32"
);
check_class
(
user32
,
name
,
"main_module"
);
...
...
@@ -385,7 +385,7 @@ static void test_instances(void)
check_thread_instance
(
name
,
0
,
0
,
kernel32
);
ok
(
UnregisterClassA
(
name
,
kernel32
),
"Unregister failed for kernel32
\n
"
);
SetClassLong
A
(
hwnd
,
GCL
_HMODULE
,
0x12345678
);
SetClassLong
PtrA
(
hwnd
,
GCLP
_HMODULE
,
0x12345678
);
ok
(
RegisterClassA
(
&
cls
),
"Failed to register local class for kernel32
\n
"
);
check_class
(
kernel32
,
name
,
"kernel32"
);
check_class
(
(
HINSTANCE
)
0x12345678
,
name
,
"main_module"
);
...
...
@@ -401,24 +401,24 @@ static void test_instances(void)
cls
.
style
=
3
;
ok
(
RegisterClassA
(
&
cls
),
"Failed to register local class for deadbeef
\n
"
);
hwnd2
=
CreateWindowExA
(
0
,
name
,
"test_window"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
,
0
);
ok
(
(
HINSTANCE
)
GetClassLong
(
hwnd2
,
GCL
_HMODULE
)
==
(
HINSTANCE
)
0xdeadbeef
,
ok
(
(
HINSTANCE
)
GetClassLong
PtrA
(
hwnd2
,
GCLP
_HMODULE
)
==
(
HINSTANCE
)
0xdeadbeef
,
"Didn't get deadbeef class for null instance
\n
"
);
DestroyWindow
(
hwnd2
);
ok
(
UnregisterClassA
(
name
,
(
HINSTANCE
)
0xdeadbeef
),
"Unregister failed for deadbeef
\n
"
);
hwnd2
=
CreateWindowExA
(
0
,
name
,
"test_window"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
,
0
);
ok
(
(
HINSTANCE
)
GetClassLong
(
hwnd2
,
GCL
_HMODULE
)
==
kernel32
,
ok
(
(
HINSTANCE
)
GetClassLong
PtrA
(
hwnd2
,
GCLP
_HMODULE
)
==
kernel32
,
"Didn't get kernel32 class for null instance
\n
"
);
DestroyWindow
(
hwnd2
);
ok
(
UnregisterClassA
(
name
,
kernel32
),
"Unregister failed for kernel32
\n
"
);
hwnd2
=
CreateWindowExA
(
0
,
name
,
"test_window"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
,
0
);
ok
(
GetClassLong
(
hwnd2
,
GCL
_HMODULE
)
==
0x12345678
,
ok
(
GetClassLong
PtrA
(
hwnd2
,
GCLP
_HMODULE
)
==
0x12345678
,
"Didn't get 12345678 class for null instance
\n
"
);
DestroyWindow
(
hwnd2
);
SetClassLong
A
(
hwnd
,
GCL_HMODULE
,
(
LONG
)
main_module
);
SetClassLong
PtrA
(
hwnd
,
GCLP_HMODULE
,
(
LONG_PTR
)
main_module
);
DestroyWindow
(
hwnd
);
/* null handle means the same thing as main module */
...
...
@@ -476,7 +476,7 @@ static void test_instances(void)
check_thread_instance
(
name
,
(
HINSTANCE
)
0xdeadbeef
,
(
HINSTANCE
)
0xdeadbeef
,
main_module
);
/* changing the instance for global class doesn't make much difference */
SetClassLong
A
(
hwnd
,
GCL
_HMODULE
,
0xdeadbeef
);
SetClassLong
PtrA
(
hwnd
,
GCLP
_HMODULE
,
0xdeadbeef
);
check_instance
(
name
,
main_module
,
main_module
,
(
HINSTANCE
)
0xdeadbeef
);
check_instance
(
name
,
(
HINSTANCE
)
0xdeadbeef
,
(
HINSTANCE
)
0xdeadbeef
,
(
HINSTANCE
)
0xdeadbeef
);
check_thread_instance
(
name
,
main_module
,
main_module
,
(
HINSTANCE
)
0xdeadbeef
);
...
...
@@ -542,7 +542,7 @@ static void test_instances(void)
check_instance
(
"EDIT"
,
(
HINSTANCE
)
0xdeadbeef
,
(
HINSTANCE
)
0xdeadbeef
,
user32
);
check_thread_instance
(
"EDIT"
,
(
HINSTANCE
)
0xdeadbeef
,
(
HINSTANCE
)
0xdeadbeef
,
user32
);
hwnd
=
CreateWindowExA
(
0
,
"EDIT"
,
"test"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
main_module
,
0
);
SetClassLong
A
(
hwnd
,
GCL
_HMODULE
,
0xdeadbeef
);
SetClassLong
PtrA
(
hwnd
,
GCLP
_HMODULE
,
0xdeadbeef
);
check_instance
(
"EDIT"
,
(
HINSTANCE
)
0x12345678
,
(
HINSTANCE
)
0x12345678
,
(
HINSTANCE
)
0xdeadbeef
);
check_thread_instance
(
"EDIT"
,
(
HINSTANCE
)
0x12345678
,
(
HINSTANCE
)
0x12345678
,
(
HINSTANCE
)
0xdeadbeef
);
}
...
...
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