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
0a59c65e
Commit
0a59c65e
authored
Dec 14, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Dec 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Implement SHPropertyBag_ReadLONG.
parent
763694a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
148 additions
and
1 deletion
+148
-1
ordinal.c
dlls/shlwapi/ordinal.c
+32
-0
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+1
-1
ordinal.c
dlls/shlwapi/tests/ordinal.c
+115
-0
No files found.
dlls/shlwapi/ordinal.c
View file @
0a59c65e
...
...
@@ -4752,3 +4752,35 @@ HRESULT WINAPI IUnknown_QueryServiceForWebBrowserApp(IUnknown* lpUnknown,
FIXME
(
"%p %s %p semi-STUB
\n
"
,
lpUnknown
,
debugstr_guid
(
riid
),
lppOut
);
return
IUnknown_QueryService
(
lpUnknown
,
&
IID_IWebBrowserApp
,
riid
,
lppOut
);
}
/**************************************************************************
* SHPropertyBag_ReadLONG (SHLWAPI.496)
*
* This function asks a property bag to read a named property as a LONG.
*
* PARAMS
* ppb: a IPropertyBag interface
* pszPropName: Unicode string that names the property
* pValue: address to receive the property value as a 32-bit signed integer
*
* RETURNS
* 0 for Success
*/
BOOL
WINAPI
SHPropertyBag_ReadLONG
(
IPropertyBag
*
ppb
,
LPCWSTR
pszPropName
,
LPLONG
pValue
)
{
VARIANT
var
;
HRESULT
hr
;
TRACE
(
"%p %s %p
\n
"
,
ppb
,
debugstr_w
(
pszPropName
),
pValue
);
if
(
!
pszPropName
||
!
ppb
||
!
pValue
)
return
E_INVALIDARG
;
V_VT
(
&
var
)
=
VT_I4
;
hr
=
IPropertyBag_Read
(
ppb
,
pszPropName
,
&
var
,
NULL
);
if
(
SUCCEEDED
(
hr
))
{
if
(
V_VT
(
&
var
)
==
VT_I4
)
*
pValue
=
V_I4
(
&
var
);
else
hr
=
DISP_E_BADVARTYPE
;
}
return
hr
;
}
dlls/shlwapi/shlwapi.spec
View file @
0a59c65e
...
...
@@ -493,7 +493,7 @@
493 stub -noname SHPropertyBag_ReadType
494 stub -noname SHPropertyBag_ReadStr
495 stub -noname SHPropertyBag_WriteStr
496 st
ub -noname SHPropertyBag_ReadLONG
496 st
dcall -noname SHPropertyBag_ReadLONG(ptr wstr ptr)
497 stub -noname SHPropertyBag_WriteLONG
498 stub -noname SHPropertyBag_ReadBOOLOld
499 stub -noname SHPropertyBag_WriteBOOL
...
...
dlls/shlwapi/tests/ordinal.c
View file @
0a59c65e
...
...
@@ -41,6 +41,7 @@ static HRESULT(WINAPIV *pSHPackDispParams)(DISPPARAMS*,VARIANTARG*,UINT,...);
static
HRESULT
(
WINAPI
*
pIConnectionPoint_SimpleInvoke
)(
IConnectionPoint
*
,
DISPID
,
DISPPARAMS
*
);
static
HRESULT
(
WINAPI
*
pIConnectionPoint_InvokeWithCancel
)(
IConnectionPoint
*
,
DISPID
,
DISPPARAMS
*
,
DWORD
,
DWORD
);
static
HRESULT
(
WINAPI
*
pConnectToConnectionPoint
)(
IUnknown
*
,
REFIID
,
BOOL
,
IUnknown
*
,
LPDWORD
,
IConnectionPoint
**
);
static
HRESULT
(
WINAPI
*
pSHPropertyBag_ReadLONG
)(
IPropertyBag
*
,
LPCWSTR
,
LPLONG
);
static
void
test_GetAcceptLanguagesA
(
void
)
{
HRESULT
retval
;
...
...
@@ -1205,6 +1206,118 @@ static void test_IConnectionPoint(void)
ok
(
ref
==
0
,
"leftover IDispatch reference %i
\n
"
,
ref
);
}
typedef
struct
_propbag
{
const
IPropertyBagVtbl
*
vtbl
;
LONG
refCount
;
}
PropBag
;
static
HRESULT
WINAPI
Prop_QueryInterface
(
IPropertyBag
*
This
,
REFIID
riid
,
void
**
ppvObject
)
{
trace
(
"
\n
"
);
*
ppvObject
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IPropertyBag
))
{
*
ppvObject
=
This
;
}
if
(
*
ppvObject
)
{
IUnknown_AddRef
(
This
);
return
S_OK
;
}
trace
(
"no interface
\n
"
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
Prop_AddRef
(
IPropertyBag
*
This
)
{
PropBag
*
iface
=
(
PropBag
*
)
This
;
return
InterlockedIncrement
(
&
iface
->
refCount
);
}
static
ULONG
WINAPI
Prop_Release
(
IPropertyBag
*
This
)
{
PropBag
*
iface
=
(
PropBag
*
)
This
;
ULONG
ret
;
ret
=
InterlockedDecrement
(
&
iface
->
refCount
);
if
(
ret
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ret
;
}
static
HRESULT
WINAPI
Prop_Read
(
IPropertyBag
*
This
,
LPCOLESTR
pszPropName
,
VARIANT
*
pVar
,
IErrorLog
*
pErrorLog
)
{
V_VT
(
pVar
)
=
VT_BLOB
|
VT_BYREF
;
V_BYREF
(
pVar
)
=
(
LPVOID
)
0xdeadcafe
;
return
S_OK
;
}
static
HRESULT
WINAPI
Prop_Write
(
IPropertyBag
*
This
,
LPCOLESTR
pszPropName
,
VARIANT
*
pVar
)
{
return
S_OK
;
}
static
const
IPropertyBagVtbl
prop_vtbl
=
{
Prop_QueryInterface
,
Prop_AddRef
,
Prop_Release
,
Prop_Read
,
Prop_Write
};
static
void
test_SHPropertyBag_ReadLONG
(
void
)
{
PropBag
*
pb
;
HRESULT
rc
;
LONG
out
;
static
const
WCHAR
szName1
[]
=
{
'n'
,
'a'
,
'm'
,
'e'
,
'1'
,
0
};
if
(
!
pSHPropertyBag_ReadLONG
)
{
win_skip
(
"SHPropertyBag_ReadLONG not present
\n
"
);
return
;
}
pb
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PropBag
));
pb
->
refCount
=
1
;
pb
->
vtbl
=
&
prop_vtbl
;
out
=
0xfeedface
;
rc
=
pSHPropertyBag_ReadLONG
(
NULL
,
szName1
,
&
out
);
ok
(
rc
==
E_INVALIDARG
||
broken
(
rc
==
0
),
"incorrect return %x
\n
"
,
rc
);
ok
(
out
==
0xfeedface
,
"value should not have changed
\n
"
);
rc
=
pSHPropertyBag_ReadLONG
((
IPropertyBag
*
)
pb
,
NULL
,
&
out
);
ok
(
rc
==
E_INVALIDARG
||
broken
(
rc
==
0
)
||
broken
(
rc
==
1
),
"incorrect return %x
\n
"
,
rc
);
ok
(
out
==
0xfeedface
,
"value should not have changed
\n
"
);
rc
=
pSHPropertyBag_ReadLONG
((
IPropertyBag
*
)
pb
,
szName1
,
NULL
);
ok
(
rc
==
E_INVALIDARG
||
broken
(
rc
==
0
)
||
broken
(
rc
==
1
),
"incorrect return %x
\n
"
,
rc
);
ok
(
out
==
0xfeedface
,
"value should not have changed
\n
"
);
rc
=
pSHPropertyBag_ReadLONG
((
IPropertyBag
*
)
pb
,
szName1
,
&
out
);
ok
(
rc
==
DISP_E_BADVARTYPE
||
broken
(
rc
==
0
)
||
broken
(
rc
==
1
),
"incorrect return %x
\n
"
,
rc
);
ok
(
out
==
0xfeedface
||
broken
(
out
==
0xfeedfa00
),
"value should not have changed %x
\n
"
,
out
);
IUnknown_Release
((
IUnknown
*
)
pb
);
}
START_TEST
(
ordinal
)
{
hShlwapi
=
GetModuleHandleA
(
"shlwapi.dll"
);
...
...
@@ -1219,6 +1332,7 @@ START_TEST(ordinal)
pIConnectionPoint_SimpleInvoke
=
(
void
*
)
GetProcAddress
(
hShlwapi
,(
char
*
)
284
);
pIConnectionPoint_InvokeWithCancel
=
(
void
*
)
GetProcAddress
(
hShlwapi
,(
char
*
)
283
);
pConnectToConnectionPoint
=
(
void
*
)
GetProcAddress
(
hShlwapi
,(
char
*
)
168
);
pSHPropertyBag_ReadLONG
=
(
void
*
)
GetProcAddress
(
hShlwapi
,(
char
*
)
496
);
test_GetAcceptLanguagesA
();
test_SHSearchMapInt
();
...
...
@@ -1227,4 +1341,5 @@ START_TEST(ordinal)
test_GetShellSecurityDescriptor
();
test_SHPackDispParams
();
test_IConnectionPoint
();
test_SHPropertyBag_ReadLONG
();
}
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