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
33d5da5b
Commit
33d5da5b
authored
Oct 23, 2006
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 23, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Make the test pass for GetClassName called on a small buffer.
parent
20c40e06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
class.c
dlls/user/class.c
+27
-4
class.c
dlls/user/tests/class.c
+2
-2
No files found.
dlls/user/class.c
View file @
33d5da5b
...
...
@@ -63,6 +63,7 @@ typedef struct tagCLASS
static
struct
list
class_list
=
LIST_INIT
(
class_list
);
#define CLASS_OTHER_PROCESS ((CLASS *)1)
#define MAX_ATOM_LEN 255
/* from dlls/kernel32/atom.c */
/***********************************************************************
* get_class_ptr
...
...
@@ -956,9 +957,20 @@ DWORD WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval )
*/
INT
WINAPI
GetClassNameA
(
HWND
hwnd
,
LPSTR
buffer
,
INT
count
)
{
INT
ret
=
GlobalGetAtomNameA
(
GetClassLongA
(
hwnd
,
GCW_ATOM
),
buffer
,
count
);
char
tmpbuf
[
MAX_ATOM_LEN
+
1
];
INT
ret
;
TRACE
(
"%p %s %x
\n
"
,
hwnd
,
debugstr_a
(
buffer
),
count
);
TRACE
(
"%p %p %d
\n
"
,
hwnd
,
buffer
,
count
);
if
(
count
<=
0
)
return
0
;
ret
=
GlobalGetAtomNameA
(
GetClassLongW
(
hwnd
,
GCW_ATOM
),
tmpbuf
,
MAX_ATOM_LEN
+
1
);
if
(
ret
)
{
ret
=
min
(
count
-
1
,
ret
);
memcpy
(
buffer
,
tmpbuf
,
ret
);
buffer
[
ret
]
=
0
;
}
return
ret
;
}
...
...
@@ -968,9 +980,20 @@ INT WINAPI GetClassNameA( HWND hwnd, LPSTR buffer, INT count )
*/
INT
WINAPI
GetClassNameW
(
HWND
hwnd
,
LPWSTR
buffer
,
INT
count
)
{
INT
ret
=
GlobalGetAtomNameW
(
GetClassLongW
(
hwnd
,
GCW_ATOM
),
buffer
,
count
);
WCHAR
tmpbuf
[
MAX_ATOM_LEN
+
1
];
INT
ret
;
TRACE
(
"%p %s %x
\n
"
,
hwnd
,
debugstr_w
(
buffer
),
count
);
TRACE
(
"%p %p %d
\n
"
,
hwnd
,
buffer
,
count
);
if
(
count
<=
0
)
return
0
;
ret
=
GlobalGetAtomNameW
(
GetClassLongW
(
hwnd
,
GCW_ATOM
),
tmpbuf
,
MAX_ATOM_LEN
+
1
);
if
(
ret
)
{
ret
=
min
(
count
-
1
,
ret
);
memcpy
(
buffer
,
tmpbuf
,
ret
*
sizeof
(
WCHAR
));
buffer
[
ret
]
=
0
;
}
return
ret
;
}
...
...
dlls/user/tests/class.c
View file @
33d5da5b
...
...
@@ -414,8 +414,8 @@ static void test_instances(void)
DestroyWindow
(
hwnd2
);
r
=
GetClassName
(
hwnd
,
buffer
,
4
);
todo_wine
ok
(
r
==
3
,
"return wrong
\n
"
);
ok
(
!
strcmp
(
buffer
,
"__t"
),
"name wrong
\n
"
);
ok
(
r
==
3
,
"expected 3, got %d
\n
"
,
r
);
ok
(
!
strcmp
(
buffer
,
"__t"
),
"name wrong
: %s
\n
"
,
buffer
);
ok
(
UnregisterClassA
(
name
,
kernel32
),
"Unregister failed for kernel32
\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