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
385e693e
Commit
385e693e
authored
Jan 27, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole: Test and implement LPSAFEARRAY marshaling.
parent
799ebfc4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
130 additions
and
4 deletions
+130
-4
oleaut32.spec
dlls/oleaut32/oleaut32.spec
+4
-4
Makefile.in
dlls/oleaut32/tests/Makefile.in
+1
-0
usrmarshal.c
dlls/oleaut32/tests/usrmarshal.c
+125
-0
usrmarshal.c
dlls/oleaut32/usrmarshal.c
+0
-0
No files found.
dlls/oleaut32/oleaut32.spec
View file @
385e693e
...
...
@@ -285,10 +285,10 @@
288 stdcall VARIANT_UserMarshal(ptr ptr ptr)
289 stdcall VARIANT_UserUnmarshal(ptr ptr ptr)
290 stdcall VARIANT_UserFree(ptr ptr)
291 st
ub LPSAFEARRAY_UserSize
292 st
ub LPSAFEARRAY_UserMarshal
293 st
ub LPSAFEARRAY_UserUnmarshal
294 st
ub LPSAFEARRAY_UserFree
291 st
dcall LPSAFEARRAY_UserSize(ptr long ptr)
292 st
dcall LPSAFEARRAY_UserMarshal(ptr ptr ptr)
293 st
dcall LPSAFEARRAY_UserUnmarshal(ptr ptr ptr)
294 st
dcall LPSAFEARRAY_UserFree(ptr ptr)
295 stub LPSAFEARRAY_Size
296 stub LPSAFEARRAY_Marshal
297 stub LPSAFEARRAY_Unmarshal
...
...
dlls/oleaut32/tests/Makefile.in
View file @
385e693e
...
...
@@ -11,6 +11,7 @@ CTESTS = \
olepicture.c
\
safearray.c
\
typelib.c
\
usrmarshal.c
\
vartest.c
\
vartype.c
...
...
dlls/oleaut32/tests/usrmarshal.c
0 → 100644
View file @
385e693e
/*
* Marshaling Tests
*
* Copyright 2004 Robert Shearman
*
* 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 <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "propidl.h"
/* for LPSAFEARRAY_User* routines */
#include "wine/test.h"
/* doesn't work on Windows due to needing more of the
* MIDL_STUB_MESSAGE structure to be filled out */
#define LPSAFEARRAY_UNMARSHAL_WORKS 0
static
void
test_marshal_LPSAFEARRAY
(
void
)
{
unsigned
char
*
buffer
;
unsigned
long
size
;
LPSAFEARRAY
lpsa
;
LPSAFEARRAY
lpsa2
=
NULL
;
unsigned
char
*
wiresa
;
SAFEARRAYBOUND
sab
;
MIDL_STUB_MESSAGE
stubMsg
=
{
0
};
USER_MARSHAL_CB
umcb
=
{
0
};
umcb
.
Flags
=
MAKELONG
(
MSHCTX_DIFFERENTMACHINE
,
NDR_LOCAL_DATA_REPRESENTATION
);
umcb
.
pReserve
=
NULL
;
umcb
.
pStubMsg
=
&
stubMsg
;
sab
.
lLbound
=
5
;
sab
.
cElements
=
10
;
lpsa
=
SafeArrayCreate
(
VT_I2
,
1
,
&
sab
);
*
(
DWORD
*
)
lpsa
->
pvData
=
0xcafebabe
;
lpsa
->
cLocks
=
7
;
size
=
LPSAFEARRAY_UserSize
(
&
umcb
.
Flags
,
0
,
&
lpsa
);
ok
(
size
==
64
,
"size should be 64 bytes, not %ld
\n
"
,
size
);
buffer
=
(
unsigned
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
LPSAFEARRAY_UserMarshal
(
&
umcb
.
Flags
,
buffer
,
&
lpsa
);
wiresa
=
buffer
;
ok
(
*
(
DWORD
*
)
wiresa
==
TRUE
,
"wiresa + 0x0 should be TRUE instead of 0x%08lx
\n
"
,
*
(
DWORD
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD
);
ok
(
*
(
DWORD
*
)
wiresa
==
lpsa
->
cDims
,
"wiresa + 0x4 should be lpsa->cDims instead of 0x%08lx
\n
"
,
*
(
DWORD
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD
);
ok
(
*
(
WORD
*
)
wiresa
==
lpsa
->
cDims
,
"wiresa + 0x8 should be lpsa->cDims instead of 0x%04x
\n
"
,
*
(
WORD
*
)
wiresa
);
wiresa
+=
sizeof
(
WORD
);
ok
(
*
(
WORD
*
)
wiresa
==
lpsa
->
fFeatures
,
"wiresa + 0xc should be lpsa->fFeatures instead of 0x%08x
\n
"
,
*
(
WORD
*
)
wiresa
);
wiresa
+=
sizeof
(
WORD
);
ok
(
*
(
DWORD
*
)
wiresa
==
lpsa
->
cbElements
,
"wiresa + 0x10 should be lpsa->cbElements instead of 0x%08lx
\n
"
,
*
(
DWORD
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD
);
ok
(
*
(
WORD
*
)
wiresa
==
lpsa
->
cLocks
,
"wiresa + 0x16 should be lpsa->cLocks instead of 0x%04x
\n
"
,
*
(
WORD
*
)
wiresa
);
wiresa
+=
sizeof
(
WORD
);
ok
(
*
(
WORD
*
)
wiresa
==
VT_I2
,
"wiresa + 0x14 should be VT_I2 instead of 0x%04x
\n
"
,
*
(
WORD
*
)
wiresa
);
wiresa
+=
sizeof
(
WORD
);
ok
(
*
(
DWORD
*
)
wiresa
==
VT_I2
,
"wiresa + 0x18 should be VT_I2 instead of 0x%08lx
\n
"
,
*
(
DWORD
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD
);
ok
(
*
(
DWORD
*
)
wiresa
==
sab
.
cElements
,
"wiresa + 0x1c should be sab.cElements instead of %lu
\n
"
,
*
(
DWORD
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD
);
ok
(
*
(
DWORD_PTR
*
)
wiresa
==
(
DWORD_PTR
)
lpsa
->
pvData
,
"wirestgm + 0x20 should be lpsa->pvData instead of 0x%08lx
\n
"
,
*
(
DWORD_PTR
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD_PTR
);
ok
(
*
(
DWORD
*
)
wiresa
==
sab
.
cElements
,
"wiresa + 0x24 should be sab.cElements instead of %lu
\n
"
,
*
(
DWORD
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD
);
ok
(
*
(
LONG
*
)
wiresa
==
sab
.
lLbound
,
"wiresa + 0x28 should be sab.clLbound instead of %ld
\n
"
,
*
(
LONG
*
)
wiresa
);
wiresa
+=
sizeof
(
LONG
);
ok
(
*
(
DWORD
*
)
wiresa
==
sab
.
cElements
,
"wiresa + 0x2c should be sab.cElements instead of %lu
\n
"
,
*
(
DWORD
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD
);
/* elements are now pointed to by wiresa */
if
(
LPSAFEARRAY_UNMARSHAL_WORKS
)
{
LPSAFEARRAY_UserUnmarshal
(
&
umcb
.
Flags
,
buffer
,
&
lpsa2
);
ok
(
lpsa2
!=
NULL
,
"LPSAFEARRAY didn't unmarshal
\n
"
);
LPSAFEARRAY_UserFree
(
&
umcb
.
Flags
,
&
lpsa2
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
SafeArrayDestroy
(
lpsa
);
/* test NULL safe array */
lpsa
=
NULL
;
size
=
LPSAFEARRAY_UserSize
(
&
umcb
.
Flags
,
0
,
&
lpsa
);
ok
(
size
==
4
,
"size should be 4 bytes, not %ld
\n
"
,
size
);
buffer
=
(
unsigned
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
LPSAFEARRAY_UserMarshal
(
&
umcb
.
Flags
,
buffer
,
&
lpsa
);
wiresa
=
buffer
;
ok
(
*
(
DWORD
*
)
wiresa
==
FALSE
,
"wiresa + 0x0 should be FALSE instead of 0x%08lx
\n
"
,
*
(
DWORD
*
)
wiresa
);
wiresa
+=
sizeof
(
DWORD
);
if
(
LPSAFEARRAY_UNMARSHAL_WORKS
)
{
LPSAFEARRAY_UserUnmarshal
(
&
umcb
.
Flags
,
buffer
,
&
lpsa2
);
ok
(
lpsa2
==
NULL
,
"NULL LPSAFEARRAY didn't unmarshal
\n
"
);
LPSAFEARRAY_UserFree
(
&
umcb
.
Flags
,
&
lpsa2
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
START_TEST
(
usrmarshal
)
{
CoInitialize
(
NULL
);
test_marshal_LPSAFEARRAY
();
CoUninitialize
();
}
dlls/oleaut32/usrmarshal.c
View file @
385e693e
This diff is collapsed.
Click to expand it.
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