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
61daaf8b
Commit
61daaf8b
authored
Apr 23, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug in ShellExecute which called DdeCreateStringHandleW with a
wrong parameter. Revert previous erroneous fix.
parent
30febfc8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
15 deletions
+133
-15
shlexec.c
dlls/shell32/shlexec.c
+2
-2
misc.c
dlls/user/dde/misc.c
+10
-13
.cvsignore
dlls/user/tests/.cvsignore
+1
-0
Makefile.in
dlls/user/tests/Makefile.in
+1
-0
dde.c
dlls/user/tests/dde.c
+119
-0
No files found.
dlls/shell32/shlexec.c
View file @
61daaf8b
...
...
@@ -766,8 +766,8 @@ static unsigned dde_connect(WCHAR* key, WCHAR* start, WCHAR* ddeexec,
return
2
;
}
hszApp
=
DdeCreateStringHandleW
(
ddeInst
,
app
,
CP_WIN
ANSI
);
hszTopic
=
DdeCreateStringHandleW
(
ddeInst
,
topic
,
CP_WIN
ANSI
);
hszApp
=
DdeCreateStringHandleW
(
ddeInst
,
app
,
CP_WIN
UNICODE
);
hszTopic
=
DdeCreateStringHandleW
(
ddeInst
,
topic
,
CP_WIN
UNICODE
);
hConv
=
DdeConnect
(
ddeInst
,
hszApp
,
hszTopic
,
NULL
);
exec
=
ddeexec
;
...
...
dlls/user/dde/misc.c
View file @
61daaf8b
...
...
@@ -511,7 +511,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
if
(
WDML_InstanceList
==
NULL
)
{
ret
=
DMLERR_
DLL_USAGE
;
ret
=
DMLERR_
INVALIDPARAMETER
;
goto
theError
;
}
HeapFree
(
GetProcessHeap
(),
0
,
pInstance
);
/* finished - release heap space used as work store */
...
...
@@ -536,7 +536,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
if
(
!
(
afCmd
&
APPCMD_CLIENTONLY
))
{
ret
=
DMLERR_
DLL_USAGE
;
ret
=
DMLERR_
INVALIDPARAMETER
;
goto
theError
;
}
}
...
...
@@ -545,7 +545,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
if
(
pInstance
->
monitor
!=
reference_inst
->
monitor
)
{
ret
=
DMLERR_
DLL_USAGE
;
ret
=
DMLERR_
INVALIDPARAMETER
;
goto
theError
;
}
...
...
@@ -553,7 +553,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
if
((
afCmd
&
APPCMD_CLIENTONLY
)
&&
!
reference_inst
->
clientOnly
)
{
ret
=
DMLERR_
DLL_USAGE
;
ret
=
DMLERR_
INVALIDPARAMETER
;
goto
theError
;
}
break
;
...
...
@@ -562,10 +562,6 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
}
if
(
reference_inst
->
next
==
NULL
)
{
/* Crazy situation - trying to re-initialize something that has not beeen initialized !!
*
* Manual does not say what we do, cannot return DMLERR_NOT_INITIALIZED so what ?
*/
ret
=
DMLERR_INVALIDPARAMETER
;
goto
theError
;
}
...
...
@@ -794,8 +790,6 @@ UINT WINAPI DdeGetLastError(DWORD idInst)
DWORD
error_code
;
WDML_INSTANCE
*
pInstance
;
FIXME
(
"(%ld): error reporting is weakly implemented
\n
"
,
idInst
);
EnterCriticalSection
(
&
WDML_CritSect
);
/* First check instance
...
...
@@ -803,7 +797,7 @@ UINT WINAPI DdeGetLastError(DWORD idInst)
pInstance
=
WDML_GetInstance
(
idInst
);
if
(
pInstance
==
NULL
)
{
error_code
=
DMLERR_
DLL_NOT_INITIALIZED
;
error_code
=
DMLERR_
INVALIDPARAMETER
;
}
else
{
...
...
@@ -1004,6 +998,7 @@ static int WDML_QueryString(WDML_INSTANCE* pInstance, HSZ hsz, LPVOID ptr, DWORD
break
;
case
CP_WINUNICODE
:
ret
=
GetAtomNameW
(
HSZ2ATOM
(
hsz
),
ptr
,
cchMax
);
break
;
default:
ERR
(
"Unknown code page %d
\n
"
,
codepage
);
ret
=
0
;
...
...
@@ -1141,8 +1136,10 @@ HSZ WINAPI DdeCreateStringHandleW(DWORD idInst, LPCWSTR psz, INT codepage)
pInstance
=
WDML_GetInstance
(
idInst
);
if
(
pInstance
)
hsz
=
WDML_CreateString
(
pInstance
,
psz
,
CP_WINUNICODE
);
{
if
(
codepage
==
0
)
codepage
=
CP_WINUNICODE
;
hsz
=
WDML_CreateString
(
pInstance
,
psz
,
codepage
);
}
LeaveCriticalSection
(
&
WDML_CritSect
);
return
hsz
;
...
...
dlls/user/tests/.cvsignore
View file @
61daaf8b
Makefile
class.ok
dde.ok
dialog.ok
generated.ok
input.ok
...
...
dlls/user/tests/Makefile.in
View file @
61daaf8b
...
...
@@ -7,6 +7,7 @@ IMPORTS = user32 gdi32 advapi32
CTESTS
=
\
class.c
\
dde.c
\
dialog.c
\
generated.c
\
input.c
\
...
...
dlls/user/tests/dde.c
0 → 100644
View file @
61daaf8b
/*
* Unit tests for DDE functions
*
* Copyright (c) 2004 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
#include "wine/test.h"
#include "winbase.h"
#include "winuser.h"
#include "ddeml.h"
#include "winerror.h"
static
HDDEDATA
CALLBACK
DdeCallback
(
UINT
uType
,
UINT
uFmt
,
HCONV
hconv
,
HSZ
hsz1
,
HSZ
hsz2
,
HDDEDATA
hdata
,
ULONG_PTR
dwData1
,
ULONG_PTR
dwData2
)
{
return
0
;
}
static
void
test_DdeCreateStringHandleW
(
DWORD
dde_inst
,
int
codepage
)
{
static
const
WCHAR
dde_string
[]
=
{
'D'
,
'D'
,
'E'
,
' '
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
HSZ
str_handle
;
WCHAR
bufW
[
256
];
char
buf
[
256
];
int
ret
;
str_handle
=
DdeCreateStringHandleW
(
dde_inst
,
dde_string
,
codepage
);
ok
(
str_handle
!=
0
,
"DdeCreateStringHandleW failed with error %08x
\n
"
,
DdeGetLastError
(
dde_inst
));
ret
=
DdeQueryStringW
(
dde_inst
,
str_handle
,
NULL
,
0
,
codepage
);
if
(
codepage
==
CP_WINANSI
)
ok
(
ret
==
1
,
"DdeQueryStringW returned wrong length %d
\n
"
,
ret
);
else
ok
(
ret
==
lstrlenW
(
dde_string
),
"DdeQueryStringW returned wrong length %d
\n
"
,
ret
);
ret
=
DdeQueryStringW
(
dde_inst
,
str_handle
,
bufW
,
256
,
codepage
);
if
(
codepage
==
CP_WINANSI
)
{
ok
(
ret
==
1
,
"DdeQueryStringW returned wrong length %d
\n
"
,
ret
);
ok
(
!
lstrcmpA
(
"D"
,
(
LPCSTR
)
bufW
),
"DdeQueryStringW returned wrong string
\n
"
);
}
else
{
ok
(
ret
==
lstrlenW
(
dde_string
),
"DdeQueryStringW returned wrong length %d
\n
"
,
ret
);
ok
(
!
lstrcmpW
(
dde_string
,
bufW
),
"DdeQueryStringW returned wrong string
\n
"
);
}
ret
=
DdeQueryStringA
(
dde_inst
,
str_handle
,
buf
,
256
,
CP_WINANSI
);
if
(
codepage
==
CP_WINANSI
)
{
ok
(
ret
==
1
,
"DdeQueryStringA returned wrong length %d
\n
"
,
ret
);
ok
(
!
lstrcmpA
(
"D"
,
buf
),
"DdeQueryStringW returned wrong string
\n
"
);
}
else
{
ok
(
ret
==
lstrlenA
(
"DDE String"
),
"DdeQueryStringA returned wrong length %d
\n
"
,
ret
);
ok
(
!
lstrcmpA
(
"DDE String"
,
buf
),
"DdeQueryStringA returned wrong string %s
\n
"
,
buf
);
}
ret
=
DdeQueryStringA
(
dde_inst
,
str_handle
,
buf
,
256
,
CP_WINUNICODE
);
if
(
codepage
==
CP_WINANSI
)
{
ok
(
ret
==
1
,
"DdeQueryStringA returned wrong length %d
\n
"
,
ret
);
ok
(
!
lstrcmpA
(
"D"
,
buf
),
"DdeQueryStringA returned wrong string %s
\n
"
,
buf
);
}
else
{
ok
(
ret
==
lstrlenA
(
"DDE String"
),
"DdeQueryStringA returned wrong length %d
\n
"
,
ret
);
ok
(
!
lstrcmpW
(
dde_string
,
(
LPCWSTR
)
buf
),
"DdeQueryStringW returned wrong string
\n
"
);
}
ok
(
DdeFreeStringHandle
(
dde_inst
,
str_handle
),
"DdeFreeStringHandle failed
\n
"
);
}
START_TEST
(
dde
)
{
DWORD
dde_inst
,
ret
;
dde_inst
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
DdeInitializeW
(
&
dde_inst
,
DdeCallback
,
APPCMD_CLIENTONLY
,
0
);
if
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
trace
(
"Skipping the DDE test on a Win9x platform
\n
"
);
return
;
}
ok
(
ret
==
DMLERR_INVALIDPARAMETER
,
"DdeInitializeW should fail, but got %04lx instead
\n
"
,
ret
);
ok
(
DdeGetLastError
(
dde_inst
)
==
DMLERR_INVALIDPARAMETER
,
"expected DMLERR_INVALIDPARAMETER
\n
"
);
dde_inst
=
0
;
ret
=
DdeInitializeW
(
&
dde_inst
,
DdeCallback
,
APPCMD_CLIENTONLY
,
0
);
ok
(
ret
==
DMLERR_NO_ERROR
,
"DdeInitializeW failed with error %04lx (%08x)
\n
"
,
ret
,
DdeGetLastError
(
dde_inst
));
test_DdeCreateStringHandleW
(
dde_inst
,
0
);
test_DdeCreateStringHandleW
(
dde_inst
,
CP_WINUNICODE
);
test_DdeCreateStringHandleW
(
dde_inst
,
CP_WINANSI
);
ok
(
DdeUninitialize
(
dde_inst
),
"DdeUninitialize failed
\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