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
134935e7
Commit
134935e7
authored
Aug 12, 2013
by
Qian Hong
Committed by
Alexandre Julliard
Aug 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Fixed IMCC implementation.
parent
1448d95f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
56 deletions
+18
-56
imm.c
dlls/imm32/imm.c
+7
-45
imm32.c
dlls/imm32/tests/imm32.c
+11
-11
No files found.
dlls/imm32/imm.c
View file @
134935e7
...
...
@@ -37,12 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
imm
);
typedef
struct
tagIMCCInternal
{
DWORD
dwLock
;
DWORD
dwSize
;
}
IMCCInternal
;
#define MAKE_FUNCPTR(f) typeof(f) * p##f
typedef
struct
_tagImmHkl
{
struct
list
entry
;
...
...
@@ -2625,15 +2619,7 @@ DWORD WINAPI ImmGetIMCLockCount(HIMC hIMC)
*/
HIMCC
WINAPI
ImmCreateIMCC
(
DWORD
size
)
{
IMCCInternal
*
internal
;
int
real_size
=
size
+
sizeof
(
IMCCInternal
);
internal
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
real_size
);
if
(
internal
==
NULL
)
return
NULL
;
internal
->
dwSize
=
size
;
return
internal
;
return
GlobalAlloc
(
GMEM_ZEROINIT
|
GMEM_MOVEABLE
,
size
);
}
/***********************************************************************
...
...
@@ -2641,8 +2627,7 @@ HIMCC WINAPI ImmCreateIMCC(DWORD size)
*/
HIMCC
WINAPI
ImmDestroyIMCC
(
HIMCC
block
)
{
HeapFree
(
GetProcessHeap
(),
0
,
block
);
return
NULL
;
return
GlobalFree
(
block
);
}
/***********************************************************************
...
...
@@ -2650,11 +2635,7 @@ HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
*/
LPVOID
WINAPI
ImmLockIMCC
(
HIMCC
imcc
)
{
IMCCInternal
*
internal
;
internal
=
imcc
;
internal
->
dwLock
++
;
return
internal
+
1
;
return
GlobalLock
(
imcc
);
}
/***********************************************************************
...
...
@@ -2662,12 +2643,7 @@ LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
*/
BOOL
WINAPI
ImmUnlockIMCC
(
HIMCC
imcc
)
{
IMCCInternal
*
internal
;
internal
=
imcc
;
if
(
internal
->
dwLock
)
internal
->
dwLock
--
;
return
(
internal
->
dwLock
!=
0
);
return
GlobalUnlock
(
imcc
);
}
/***********************************************************************
...
...
@@ -2675,10 +2651,7 @@ BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
*/
DWORD
WINAPI
ImmGetIMCCLockCount
(
HIMCC
imcc
)
{
IMCCInternal
*
internal
;
internal
=
imcc
;
return
internal
->
dwLock
;
return
GlobalFlags
(
imcc
)
&
GMEM_LOCKCOUNT
;
}
/***********************************************************************
...
...
@@ -2686,15 +2659,7 @@ DWORD WINAPI ImmGetIMCCLockCount(HIMCC imcc)
*/
HIMCC
WINAPI
ImmReSizeIMCC
(
HIMCC
imcc
,
DWORD
size
)
{
IMCCInternal
*
internal
,
*
newone
;
int
real_size
=
size
+
sizeof
(
IMCCInternal
);
internal
=
imcc
;
newone
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
internal
,
real_size
);
newone
->
dwSize
=
size
;
return
newone
;
return
GlobalReAlloc
(
imcc
,
size
,
GMEM_ZEROINIT
|
GMEM_MOVEABLE
);
}
/***********************************************************************
...
...
@@ -2702,10 +2667,7 @@ HIMCC WINAPI ImmReSizeIMCC(HIMCC imcc, DWORD size)
*/
DWORD
WINAPI
ImmGetIMCCSize
(
HIMCC
imcc
)
{
IMCCInternal
*
internal
;
internal
=
imcc
;
return
internal
->
dwSize
;
return
GlobalSize
(
imcc
);
}
/***********************************************************************
...
...
dlls/imm32/tests/imm32.c
View file @
134935e7
...
...
@@ -734,25 +734,25 @@ static void test_ImmGetIMCCLockCount(void)
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
p
=
ImmLockIMCC
(
imcc
);
todo_wine
ok
(
GlobalHandle
(
p
)
==
imcc
,
"expect %p, returned %p
\n
"
,
imcc
,
GlobalHandle
(
p
));
ok
(
GlobalHandle
(
p
)
==
imcc
,
"expect %p, returned %p
\n
"
,
imcc
,
GlobalHandle
(
p
));
for
(
i
=
0
;
i
<
GMEM_LOCKCOUNT
*
2
;
i
++
)
{
ImmLockIMCC
(
imcc
);
count
=
ImmGetIMCCLockCount
(
imcc
);
g_count
=
GlobalFlags
(
imcc
)
&
GMEM_LOCKCOUNT
;
todo_wine
ok
(
count
==
g_count
,
"count %d, g_count %d
\n
"
,
count
,
g_count
);
ok
(
count
==
g_count
,
"count %d, g_count %d
\n
"
,
count
,
g_count
);
}
count
=
ImmGetIMCCLockCount
(
imcc
);
todo_wine
ok
(
count
==
GMEM_LOCKCOUNT
,
"expect GMEM_LOCKCOUNT, returned %d
\n
"
,
count
);
ok
(
count
==
GMEM_LOCKCOUNT
,
"expect GMEM_LOCKCOUNT, returned %d
\n
"
,
count
);
for
(
i
=
0
;
i
<
GMEM_LOCKCOUNT
-
1
;
i
++
)
GlobalUnlock
(
imcc
);
count
=
ImmGetIMCCLockCount
(
imcc
);
todo_wine
ok
(
count
==
1
,
"expect 1, returned %d
\n
"
,
count
);
ok
(
count
==
1
,
"expect 1, returned %d
\n
"
,
count
);
GlobalUnlock
(
imcc
);
count
=
ImmGetIMCCLockCount
(
imcc
);
todo_wine
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ok
(
count
==
0
,
"expect 0, returned %d
\n
"
,
count
);
ImmDestroyIMCC
(
imcc
);
}
...
...
@@ -775,18 +775,18 @@ static void test_ImmDestroyIMCC(void)
p
=
ImmDestroyIMCC
(
imcc
);
ok
(
p
==
NULL
,
"Destroy a locked IMCC should success!
\n
"
);
p
=
ImmLockIMCC
(
imcc
);
todo_wine
ok
(
p
==
NULL
,
"Lock a destroyed IMCC should fail!
\n
"
);
ok
(
p
==
NULL
,
"Lock a destroyed IMCC should fail!
\n
"
);
ret
=
ImmUnlockIMCC
(
imcc
);
todo_wine
ok
(
ret
==
FALSE
,
"Unlock a destroyed IMCC should return FALSE!
\n
"
);
ok
(
ret
==
FALSE
,
"Unlock a destroyed IMCC should return FALSE!
\n
"
);
count
=
ImmGetIMCCLockCount
(
imcc
);
todo_wine
ok
(
count
==
0
,
"Get lock count of a destroyed IMCC should return 0!
\n
"
);
ok
(
count
==
0
,
"Get lock count of a destroyed IMCC should return 0!
\n
"
);
size
=
ImmGetIMCCSize
(
imcc
);
todo_wine
ok
(
size
==
0
,
"Get size of a destroyed IMCC should return 0!
\n
"
);
ok
(
size
==
0
,
"Get size of a destroyed IMCC should return 0!
\n
"
);
SetLastError
(
0xdeadbeef
);
p
=
ImmDestroyIMCC
(
imcc
);
todo_wine
ok
(
p
!=
NULL
,
"returned NULL
\n
"
);
ok
(
p
!=
NULL
,
"returned NULL
\n
"
);
ret
=
GetLastError
();
todo_wine
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"wrong last error %08x!
\n
"
,
ret
);
}
static
void
test_ImmMessages
(
void
)
...
...
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