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
c5bc4b2c
Commit
c5bc4b2c
authored
Jan 22, 2009
by
Jeff Latimer
Committed by
Alexandre Julliard
Jan 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Check the instance id on DdeCreateDataHandle and retire a couple of todos.
parent
10dfcfb9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
9 deletions
+51
-9
dde_misc.c
dlls/user32/dde_misc.c
+29
-1
dde.c
dlls/user32/tests/dde.c
+22
-8
No files found.
dlls/user32/dde_misc.c
View file @
c5bc4b2c
...
...
@@ -817,6 +817,25 @@ UINT WINAPI DdeGetLastError(DWORD idInst)
return
error_code
;
}
/******************************************************************
* WDML_SetAllLastError
*
*
*/
static
void
WDML_SetAllLastError
(
DWORD
lastError
)
{
DWORD
threadID
;
WDML_INSTANCE
*
pInstance
;
threadID
=
GetCurrentThreadId
();
pInstance
=
WDML_InstanceList
;
while
(
pInstance
)
{
if
(
pInstance
->
threadID
==
threadID
)
pInstance
->
lastError
=
lastError
;
pInstance
=
pInstance
->
next
;
}
}
/* ================================================================
*
* String management
...
...
@@ -1267,15 +1286,24 @@ INT WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2)
HDDEDATA
WINAPI
DdeCreateDataHandle
(
DWORD
idInst
,
LPBYTE
pSrc
,
DWORD
cb
,
DWORD
cbOff
,
HSZ
hszItem
,
UINT
wFmt
,
UINT
afCmd
)
{
/* For now, we ignore idInst, hszItem.
/* Other than check for validity we will ignore for now idInst, hszItem.
* The purpose of these arguments still need to be investigated.
*/
WDML_INSTANCE
*
pInstance
;
HGLOBAL
hMem
;
LPBYTE
pByte
;
DDE_DATAHANDLE_HEAD
*
pDdh
;
WCHAR
psz
[
MAX_BUFFER_LEN
];
pInstance
=
WDML_GetInstance
(
idInst
);
if
(
pInstance
==
NULL
)
{
WDML_SetAllLastError
(
DMLERR_INVALIDPARAMETER
);
return
NULL
;
}
if
(
!
GetAtomNameW
(
HSZ2ATOM
(
hszItem
),
psz
,
MAX_BUFFER_LEN
))
{
psz
[
0
]
=
HSZ2ATOM
(
hszItem
);
...
...
dlls/user32/tests/dde.c
View file @
c5bc4b2c
...
...
@@ -1544,7 +1544,7 @@ static void test_DdeCreateStringHandleW(DWORD dde_inst, int codepage)
static
void
test_DdeCreateDataHandle
(
void
)
{
HDDEDATA
hdata
;
DWORD
dde_inst
;
DWORD
dde_inst
,
dde_inst2
;
DWORD
size
;
UINT
res
,
err
;
BOOL
ret
;
...
...
@@ -1552,27 +1552,41 @@ static void test_DdeCreateDataHandle(void)
LPBYTE
ptr
;
dde_inst
=
0
;
dde_inst2
=
0
;
res
=
DdeInitializeA
(
&
dde_inst
,
client_ddeml_callback
,
APPCMD_CLIENTONLY
,
0
);
ok
(
res
==
DMLERR_NO_ERROR
,
"Expected DMLERR_NO_ERROR, got %d
\n
"
,
res
);
res
=
DdeInitializeA
(
&
dde_inst2
,
client_ddeml_callback
,
APPCMD_CLIENTONLY
,
0
);
ok
(
res
==
DMLERR_NO_ERROR
,
"Expected DMLERR_NO_ERROR, got %d
\n
"
,
res
);
item
=
DdeCreateStringHandleA
(
dde_inst
,
"item"
,
CP_WINANSI
);
ok
(
item
!=
NULL
,
"Expected non-NULL hsz
\n
"
);
item
=
DdeCreateStringHandleA
(
dde_inst2
,
"item"
,
CP_WINANSI
);
ok
(
item
!=
NULL
,
"Expected non-NULL hsz
\n
"
);
if
(
0
)
{
/* do not test with an invalid instance id: that crashes on win9x */
hdata
=
DdeCreateDataHandle
(
0xdeadbeef
,
(
LPBYTE
)
"data"
,
MAX_PATH
,
0
,
item
,
CF_TEXT
,
0
);
}
/* 0 instance id */
/* 0 instance id
* This block tests an invalid instance Id. The correct behaviour is that if the instance Id
* is invalid then the lastError of all instances is set to the error. There are two instances
* created, lastError is cleared, an error is generated and then both instances are checked to
* ensure that they both have the same error set
*/
DdeGetLastError
(
dde_inst
);
DdeGetLastError
(
dde_inst2
);
hdata
=
DdeCreateDataHandle
(
0
,
(
LPBYTE
)
"data"
,
MAX_PATH
,
0
,
item
,
CF_TEXT
,
0
);
err
=
DdeGetLastError
(
dde_inst
);
todo_wine
{
ok
(
hdata
==
NULL
,
"Expected NULL, got %p
\n
"
,
hdata
);
ok
(
err
==
DMLERR_INVALIDPARAMETER
,
"Expected DMLERR_INVALIDPARAMETER, got %d
\n
"
,
err
);
}
ok
(
hdata
==
NULL
,
"Expected NULL, got %p
\n
"
,
hdata
);
ok
(
err
==
DMLERR_INVALIDPARAMETER
,
"Expected DMLERR_INVALIDPARAMETER, got %d
\n
"
,
err
);
err
=
DdeGetLastError
(
dde_inst2
);
ok
(
err
==
DMLERR_INVALIDPARAMETER
,
"Expected DMLERR_INVALIDPARAMETER, got %d
\n
"
,
err
);
ret
=
DdeUninitialize
(
dde_inst2
);
ok
(
res
==
DMLERR_NO_ERROR
,
"Expected DMLERR_NO_ERROR, got %d
\n
"
,
res
);
/* NULL pSrc */
DdeGetLastError
(
dde_inst
);
...
...
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