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
ffd2e69f
Commit
ffd2e69f
authored
Jul 30, 2009
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Aug 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Correct AssocCreate and tests.
parent
b585ca0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
3 deletions
+51
-3
assoc.c
dlls/shlwapi/assoc.c
+8
-3
assoc.c
dlls/shlwapi/tests/assoc.c
+43
-0
No files found.
dlls/shlwapi/assoc.c
View file @
ffd2e69f
...
...
@@ -134,7 +134,8 @@ static BOOL SHLWAPI_ParamAToW(LPCSTR lpszParam, LPWSTR lpszBuff, DWORD dwLen,
* Failure: An HRESULT error code indicating the error.
*
* NOTES
* refiid must be equal to IID_IQueryAssociations, or this function will fail.
* clsid must be equal to CLSID_QueryAssociations and
* refiid must be equal to IID_IQueryAssociations, IID_IUnknown or this function will fail
*/
HRESULT
WINAPI
AssocCreate
(
CLSID
clsid
,
REFIID
refiid
,
void
**
lpInterface
)
{
...
...
@@ -149,8 +150,8 @@ HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface)
*
(
DWORD
*
)
lpInterface
=
0
;
if
(
!
IsEqualGUID
(
&
clsid
,
&
IID_I
QueryAssociations
))
return
E_NOTIMPL
;
if
(
!
IsEqualGUID
(
&
clsid
,
&
CLSID_
QueryAssociations
))
return
CLASS_E_CLASSNOTAVAILABLE
;
lpAssoc
=
IQueryAssociations_Constructor
();
...
...
@@ -159,6 +160,10 @@ HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface)
hRet
=
IQueryAssociations_QueryInterface
(
lpAssoc
,
refiid
,
lpInterface
);
IQueryAssociations_Release
(
lpAssoc
);
if
(
hRet
==
E_NOINTERFACE
)
return
CLASS_E_CLASSNOTAVAILABLE
;
return
hRet
;
}
...
...
dlls/shlwapi/tests/assoc.c
View file @
ffd2e69f
...
...
@@ -21,12 +21,14 @@
#include "wine/test.h"
#include "shlwapi.h"
#include "shlguid.h"
#define expect(expected, got) ok ( expected == got, "Expected %d, got %d\n", expected, got)
#define expect_hr(expected, got) ok ( expected == got, "Expected %08x, got %08x\n", expected, got)
static
HRESULT
(
WINAPI
*
pAssocQueryStringA
)(
ASSOCF
,
ASSOCSTR
,
LPCSTR
,
LPCSTR
,
LPSTR
,
LPDWORD
)
=
NULL
;
static
HRESULT
(
WINAPI
*
pAssocQueryStringW
)(
ASSOCF
,
ASSOCSTR
,
LPCWSTR
,
LPCWSTR
,
LPWSTR
,
LPDWORD
)
=
NULL
;
static
HRESULT
(
WINAPI
*
pAssocCreate
)(
CLSID
,
REFIID
,
void
**
)
=
NULL
;
/* Every version of Windows with IE should have this association? */
static
const
WCHAR
dotHtml
[]
=
{
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
...
...
@@ -235,14 +237,55 @@ cleanup:
}
static
void
test_assoc_create
(
void
)
{
HRESULT
hr
;
IQueryAssociations
*
pqa
;
if
(
!
pAssocCreate
)
{
win_skip
(
"AssocCreate() is missing
\n
"
);
return
;
}
hr
=
pAssocCreate
(
IID_NULL
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected result : %08x
\n
"
,
hr
);
hr
=
pAssocCreate
(
CLSID_QueryAssociations
,
&
IID_NULL
,
(
LPVOID
*
)
&
pqa
);
ok
(
hr
==
CLASS_E_CLASSNOTAVAILABLE
||
hr
==
E_NOTIMPL
/* win98 */
,
"Unexpected result : %08x
\n
"
,
hr
);
hr
=
pAssocCreate
(
IID_NULL
,
&
IID_IQueryAssociations
,
(
LPVOID
*
)
&
pqa
);
ok
(
hr
==
CLASS_E_CLASSNOTAVAILABLE
||
hr
==
E_NOTIMPL
/* win98 */
,
"Unexpected result : %08x
\n
"
,
hr
);
hr
=
pAssocCreate
(
CLSID_QueryAssociations
,
&
IID_IQueryAssociations
,
(
LPVOID
*
)
&
pqa
);
ok
(
hr
==
S_OK
||
hr
==
E_NOTIMPL
/* win98 */
,
"Unexpected result : %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
IQueryAssociations_Release
(
pqa
);
}
hr
=
pAssocCreate
(
CLSID_QueryAssociations
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pqa
);
ok
(
hr
==
S_OK
||
hr
==
E_NOTIMPL
/* win98 */
,
"Unexpected result : %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
IQueryAssociations_Release
(
pqa
);
}
}
START_TEST
(
assoc
)
{
HMODULE
hshlwapi
;
hshlwapi
=
GetModuleHandleA
(
"shlwapi.dll"
);
pAssocQueryStringA
=
(
void
*
)
GetProcAddress
(
hshlwapi
,
"AssocQueryStringA"
);
pAssocQueryStringW
=
(
void
*
)
GetProcAddress
(
hshlwapi
,
"AssocQueryStringW"
);
pAssocCreate
=
(
void
*
)
GetProcAddress
(
hshlwapi
,
"AssocCreate"
);
test_getstring_bad
();
test_getstring_basic
();
test_getstring_no_extra
();
test_assoc_create
();
}
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