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
950d678c
Commit
950d678c
authored
Apr 22, 2005
by
Stefan Leichter
Committed by
Alexandre Julliard
Apr 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make ole32 tests loadable on NT4.
parent
569db3c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
16 deletions
+37
-16
stg_prop.c
dlls/ole32/tests/stg_prop.c
+37
-16
No files found.
dlls/ole32/tests/stg_prop.c
View file @
950d678c
...
@@ -26,6 +26,21 @@
...
@@ -26,6 +26,21 @@
# define U(x) (x)
# define U(x) (x)
#endif
#endif
static
HRESULT
(
WINAPI
*
pFmtIdToPropStgName
)(
const
FMTID
*
,
LPOLESTR
);
static
HRESULT
(
WINAPI
*
pPropStgNameToFmtId
)(
const
LPOLESTR
,
FMTID
*
);
static
HRESULT
(
WINAPI
*
pStgCreatePropSetStg
)(
IStorage
*
,
DWORD
,
IPropertySetStorage
**
);
static
void
init_function_pointers
(
void
)
{
HMODULE
hmod
=
GetModuleHandleA
(
"ole32.dll"
);
if
(
hmod
)
{
pFmtIdToPropStgName
=
(
void
*
)
GetProcAddress
(
hmod
,
"FmtIdToPropStgName"
);
pPropStgNameToFmtId
=
(
void
*
)
GetProcAddress
(
hmod
,
"PropStgNameToFmtId"
);
pStgCreatePropSetStg
=
(
void
*
)
GetProcAddress
(
hmod
,
"StgCreatePropSetStg"
);
}
}
/* FIXME: this creates an ANSI storage, try to find conditions under which
/* FIXME: this creates an ANSI storage, try to find conditions under which
* Unicode translation fails
* Unicode translation fails
*/
*/
...
@@ -52,7 +67,8 @@ static void testProps(void)
...
@@ -52,7 +67,8 @@ static void testProps(void)
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
|
STGM_CREATE
,
0
,
&
storage
);
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
|
STGM_CREATE
,
0
,
&
storage
);
ok
(
SUCCEEDED
(
hr
),
"StgCreateDocfile failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"StgCreateDocfile failed: 0x%08lx
\n
"
,
hr
);
hr
=
StgCreatePropSetStg
(
storage
,
0
,
&
propSetStorage
);
if
(
!
pStgCreatePropSetStg
)
return
;
hr
=
pStgCreatePropSetStg
(
storage
,
0
,
&
propSetStorage
);
ok
(
SUCCEEDED
(
hr
),
"StgCreatePropSetStg failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"StgCreatePropSetStg failed: 0x%08lx
\n
"
,
hr
);
hr
=
IPropertySetStorage_Create
(
propSetStorage
,
hr
=
IPropertySetStorage_Create
(
propSetStorage
,
...
@@ -214,7 +230,7 @@ static void testProps(void)
...
@@ -214,7 +230,7 @@ static void testProps(void)
NULL
,
0
,
&
storage
);
NULL
,
0
,
&
storage
);
ok
(
SUCCEEDED
(
hr
),
"StgOpenStorage failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"StgOpenStorage failed: 0x%08lx
\n
"
,
hr
);
hr
=
StgCreatePropSetStg
(
storage
,
0
,
&
propSetStorage
);
hr
=
p
StgCreatePropSetStg
(
storage
,
0
,
&
propSetStorage
);
ok
(
SUCCEEDED
(
hr
),
"StgCreatePropSetStg failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"StgCreatePropSetStg failed: 0x%08lx
\n
"
,
hr
);
hr
=
IPropertySetStorage_Open
(
propSetStorage
,
&
FMTID_SummaryInformation
,
hr
=
IPropertySetStorage_Open
(
propSetStorage
,
&
FMTID_SummaryInformation
,
...
@@ -258,63 +274,68 @@ static void testFmtId(void)
...
@@ -258,63 +274,68 @@ static void testFmtId(void)
FMTID
fmtid
;
FMTID
fmtid
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
FmtIdToPropStgName
(
NULL
,
name
);
if
(
pFmtIdToPropStgName
)
{
hr
=
pFmtIdToPropStgName
(
NULL
,
name
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
hr
=
FmtIdToPropStgName
(
&
FMTID_SummaryInformation
,
NULL
);
hr
=
p
FmtIdToPropStgName
(
&
FMTID_SummaryInformation
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
hr
=
FmtIdToPropStgName
(
&
FMTID_SummaryInformation
,
name
);
hr
=
p
FmtIdToPropStgName
(
&
FMTID_SummaryInformation
,
name
);
ok
(
SUCCEEDED
(
hr
),
"FmtIdToPropStgName failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"FmtIdToPropStgName failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
name
,
szSummaryInfo
,
(
lstrlenW
(
szSummaryInfo
)
+
1
)
*
ok
(
!
memcmp
(
name
,
szSummaryInfo
,
(
lstrlenW
(
szSummaryInfo
)
+
1
)
*
sizeof
(
WCHAR
)),
"Got wrong name for FMTID_SummaryInformation
\n
"
);
sizeof
(
WCHAR
)),
"Got wrong name for FMTID_SummaryInformation
\n
"
);
hr
=
FmtIdToPropStgName
(
&
FMTID_DocSummaryInformation
,
name
);
hr
=
p
FmtIdToPropStgName
(
&
FMTID_DocSummaryInformation
,
name
);
ok
(
SUCCEEDED
(
hr
),
"FmtIdToPropStgName failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"FmtIdToPropStgName failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
name
,
szDocSummaryInfo
,
(
lstrlenW
(
szDocSummaryInfo
)
+
1
)
*
ok
(
!
memcmp
(
name
,
szDocSummaryInfo
,
(
lstrlenW
(
szDocSummaryInfo
)
+
1
)
*
sizeof
(
WCHAR
)),
"Got wrong name for FMTID_DocSummaryInformation
\n
"
);
sizeof
(
WCHAR
)),
"Got wrong name for FMTID_DocSummaryInformation
\n
"
);
hr
=
FmtIdToPropStgName
(
&
FMTID_UserDefinedProperties
,
name
);
hr
=
p
FmtIdToPropStgName
(
&
FMTID_UserDefinedProperties
,
name
);
ok
(
SUCCEEDED
(
hr
),
"FmtIdToPropStgName failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"FmtIdToPropStgName failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
name
,
szDocSummaryInfo
,
(
lstrlenW
(
szDocSummaryInfo
)
+
1
)
*
ok
(
!
memcmp
(
name
,
szDocSummaryInfo
,
(
lstrlenW
(
szDocSummaryInfo
)
+
1
)
*
sizeof
(
WCHAR
)),
"Got wrong name for FMTID_DocSummaryInformation
\n
"
);
sizeof
(
WCHAR
)),
"Got wrong name for FMTID_DocSummaryInformation
\n
"
);
hr
=
FmtIdToPropStgName
(
&
IID_IPropertySetStorage
,
name
);
hr
=
p
FmtIdToPropStgName
(
&
IID_IPropertySetStorage
,
name
);
ok
(
SUCCEEDED
(
hr
),
"FmtIdToPropStgName failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"FmtIdToPropStgName failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
name
,
szIID_IPropSetStg
,
(
lstrlenW
(
szIID_IPropSetStg
)
+
1
)
*
ok
(
!
memcmp
(
name
,
szIID_IPropSetStg
,
(
lstrlenW
(
szIID_IPropSetStg
)
+
1
)
*
sizeof
(
WCHAR
)),
"Got wrong name for IID_IPropertySetStorage
\n
"
);
sizeof
(
WCHAR
)),
"Got wrong name for IID_IPropertySetStorage
\n
"
);
}
if
(
pPropStgNameToFmtId
)
{
/* test args first */
/* test args first */
hr
=
PropStgNameToFmtId
(
NULL
,
NULL
);
hr
=
p
PropStgNameToFmtId
(
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
hr
=
PropStgNameToFmtId
(
NULL
,
&
fmtid
);
hr
=
p
PropStgNameToFmtId
(
NULL
,
&
fmtid
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
hr
=
PropStgNameToFmtId
(
szDocSummaryInfo
,
NULL
);
hr
=
p
PropStgNameToFmtId
(
szDocSummaryInfo
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
/* test the known format IDs */
/* test the known format IDs */
hr
=
PropStgNameToFmtId
(
szSummaryInfo
,
&
fmtid
);
hr
=
p
PropStgNameToFmtId
(
szSummaryInfo
,
&
fmtid
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
&
fmtid
,
&
FMTID_SummaryInformation
,
sizeof
(
fmtid
)),
ok
(
!
memcmp
(
&
fmtid
,
&
FMTID_SummaryInformation
,
sizeof
(
fmtid
)),
"Got unexpected FMTID, expected FMTID_SummaryInformation
\n
"
);
"Got unexpected FMTID, expected FMTID_SummaryInformation
\n
"
);
hr
=
PropStgNameToFmtId
(
szDocSummaryInfo
,
&
fmtid
);
hr
=
p
PropStgNameToFmtId
(
szDocSummaryInfo
,
&
fmtid
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
&
fmtid
,
&
FMTID_DocSummaryInformation
,
sizeof
(
fmtid
)),
ok
(
!
memcmp
(
&
fmtid
,
&
FMTID_DocSummaryInformation
,
sizeof
(
fmtid
)),
"Got unexpected FMTID, expected FMTID_DocSummaryInformation
\n
"
);
"Got unexpected FMTID, expected FMTID_DocSummaryInformation
\n
"
);
/* test another GUID */
/* test another GUID */
hr
=
PropStgNameToFmtId
(
szIID_IPropSetStg
,
&
fmtid
);
hr
=
p
PropStgNameToFmtId
(
szIID_IPropSetStg
,
&
fmtid
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
&
fmtid
,
&
IID_IPropertySetStorage
,
sizeof
(
fmtid
)),
ok
(
!
memcmp
(
&
fmtid
,
&
IID_IPropertySetStorage
,
sizeof
(
fmtid
)),
"Got unexpected FMTID, expected IID_IPropertySetStorage
\n
"
);
"Got unexpected FMTID, expected IID_IPropertySetStorage
\n
"
);
/* now check case matching */
/* now check case matching */
CharUpperW
(
szDocSummaryInfo
+
1
);
CharUpperW
(
szDocSummaryInfo
+
1
);
hr
=
PropStgNameToFmtId
(
szDocSummaryInfo
,
&
fmtid
);
hr
=
p
PropStgNameToFmtId
(
szDocSummaryInfo
,
&
fmtid
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
&
fmtid
,
&
FMTID_DocSummaryInformation
,
sizeof
(
fmtid
)),
ok
(
!
memcmp
(
&
fmtid
,
&
FMTID_DocSummaryInformation
,
sizeof
(
fmtid
)),
"Got unexpected FMTID, expected FMTID_DocSummaryInformation
\n
"
);
"Got unexpected FMTID, expected FMTID_DocSummaryInformation
\n
"
);
CharUpperW
(
szIID_IPropSetStg
+
1
);
CharUpperW
(
szIID_IPropSetStg
+
1
);
hr
=
PropStgNameToFmtId
(
szIID_IPropSetStg
,
&
fmtid
);
hr
=
p
PropStgNameToFmtId
(
szIID_IPropSetStg
,
&
fmtid
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"PropStgNameToFmtId failed: 0x%08lx
\n
"
,
hr
);
ok
(
!
memcmp
(
&
fmtid
,
&
IID_IPropertySetStorage
,
sizeof
(
fmtid
)),
ok
(
!
memcmp
(
&
fmtid
,
&
IID_IPropertySetStorage
,
sizeof
(
fmtid
)),
"Got unexpected FMTID, expected IID_IPropertySetStorage
\n
"
);
"Got unexpected FMTID, expected IID_IPropertySetStorage
\n
"
);
}
}
}
START_TEST
(
stg_prop
)
START_TEST
(
stg_prop
)
{
{
init_function_pointers
();
testProps
();
testProps
();
testFmtId
();
testFmtId
();
}
}
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