35#include "wine/unicode.h"
42#define SHLWAPI_DEF_ASSOCF (ASSOCF_INIT_BYEXENAME | ASSOCF_INIT_DEFAULTTOSTAR | \
43 ASSOCF_INIT_DEFAULTTOFOLDER | ASSOCF_INIT_NOREMAPCLSID | \
44 ASSOCF_INIT_IGNOREUNKNOWN)
46#define SHLWAPI_DEF_ASSOCF (ASSOCF_INIT_BYEXENAME|ASSOCF_INIT_DEFAULTTOSTAR| \
47 ASSOCF_INIT_DEFAULTTOFOLDER)
115 *(
DWORD*)lpInterface = 0;
146 '.',
's',
'e',
'a',
'r',
'c',
'h',
'-',
'm',
's',0,
156 '.',
'j',
'f',
'i',
'f',0,
158 '.',
'j',
'p',
'e',
'g',0,
163 '.',
't',
'i',
'f',
'f',0,
170 '.',
'a',
'i',
'f',
'c',0,
171 '.',
'a',
'i',
'f',
'f',0,
175 '.',
'm',
'i',
'd',
'i',0,
176#if _WIN32_WINNT > 0x602
192 '.',
'd',
'v',
'r',
'-',
'm',
's',0,
195#if _WIN32_WINNT <= 0x602
198 '.',
'm',
'p',
'2',
'v',0,
201 '.',
'm',
'p',
'e',
'g',0,
203 '.',
'm',
'p',
'v',
'2',0,
217#if _WIN32_WINNT >= 0x600
219 '.',
'h',
't',
'm',
'l',0,
249const WCHAR type_compressed[] = {
'c',
'o',
'm',
'p',
'r',
'e',
's',
's',
'e',
'd',0};
252const WCHAR type_application[] = {
'a',
'p',
'p',
'l',
'i',
'c',
'a',
't',
'i',
'o',
'n',0};
254#define HARDCODED_NATIVE_WMSDK (PERCEIVEDFLAG_HARDCODED | PERCEIVEDFLAG_NATIVESUPPORT | PERCEIVEDFLAG_WMSDK)
255#define HARDCODED_NATIVE_GDIPLUS (PERCEIVEDFLAG_HARDCODED | PERCEIVEDFLAG_NATIVESUPPORT | PERCEIVEDFLAG_GDIPLUS)
256#define HARDCODED_NATIVE_ZIPFLDR (PERCEIVEDFLAG_HARDCODED | PERCEIVEDFLAG_NATIVESUPPORT | PERCEIVEDFLAG_ZIPFOLDER)
257#define SOFTCODED_NATIVESUPPORT (PERCEIVEDFLAG_SOFTCODED | PERCEIVEDFLAG_NATIVESUPPORT)
327 static const WCHAR PerceivedTypeKey[] = {
'P',
'e',
'r',
'c',
'e',
'i',
'v',
'e',
'd',
'T',
'y',
'p',
'e',0};
328 static const WCHAR SystemFileAssociationsKey[] = {
'S',
'y',
's',
't',
'e',
'm',
'F',
'i',
'l',
'e',
329 'A',
's',
's',
'o',
'c',
'i',
'a',
't',
'i',
'o',
'n',
's',
'\\',
'%',
's',0};
332 TRACE(
"(%s,%p,%p,%p)\n",
debugstr_w(lpszExt), lpType, lpFlag, lppszType);
337 *lpType =
Info->Perceived;
338 *lpFlag =
Info->FlagHardcoded;
362 *lpType =
Info->Perceived;
363 *lpFlag =
Info->FlagSoftcoded;
369 if (lppszType &&
Info->Type)
392 IQueryAssociations* lpAssoc;
394 TRACE(
"(0x%lx,%d,%s,%s,%p)\n", cfFlags, assockey,
debugstr_w(pszAssoc),
397 hRet =
AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (
void **)&lpAssoc );
398 if (
FAILED(hRet))
return hRet;
437 TRACE(
"(0x%lx,%d,%s,%s,%p)\n", cfFlags, assockey,
debugstr_a(pszAssoc),
443 hRet =
AssocQueryKeyW(cfFlags, assockey, lpszAssocW, lpszExtraW, phkeyOut);
446 if (lpszAssocW != szAssocW)
449 if (lpszExtraW != szExtraW)
464 IQueryAssociations* lpAssoc;
472 hRet =
AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (
void **)&lpAssoc );
473 if (
FAILED(hRet))
return hRet;
519 DWORD dwLenOut = *pcchOut;
522 lpszReturnW =
malloc((dwLenOut + 1) *
sizeof(
WCHAR));
531 lpszReturnW, &dwLenOut);
538 if (lpszReturnW != szReturnW)
543 if (lpszAssocW != szAssocW)
545 if (lpszExtraW != szExtraW)
560 IQueryAssociations* lpAssoc;
562 TRACE(
"(0x%lx,0x%d,%p,%s,%p,%p)\n", cfFlags,
str, hkAssoc,
565 hRet =
AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (
void **)&lpAssoc );
566 if (
FAILED(hRet))
return hRet;
608 TRACE(
"(0x%lx,0x%d,%p,%s,%p,%p)\n", cfFlags,
str, hkAssoc,
615 DWORD dwLenOut = *pcchOut;
617 lpszReturnW =
malloc((dwLenOut + 1) *
sizeof(
WCHAR));
622 lpszReturnW, &dwLenOut);
628 if (lpszReturnW != szReturnW)
633 if (lpszExtraW != szExtraW)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void shell(int argc, const char *argv[])
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
#define WideCharToMultiByte
#define MultiByteToWideChar
int WINAPI StrCmpIW(const WCHAR *str, const WCHAR *comp)
HRESULT WINAPI SHStrDupW(const WCHAR *src, WCHAR **dest)
HRESULT WINAPI SHCoCreateInstance(LPCWSTR aclsid, const CLSID *clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppv)
BOOL WINAPI AssocIsDangerous(LPCWSTR lpszAssoc)
static BOOL SHLWAPI_ParamAToW(LPCSTR lpszParam, LPWSTR lpszBuff, DWORD dwLen, LPWSTR *lpszOut)
#define SHLWAPI_DEF_ASSOCF
#define HARDCODED_NATIVE_ZIPFLDR
#define SOFTCODED_NATIVESUPPORT
static const WCHAR system_exts[]
HRESULT WINAPI AssocQueryKeyW(ASSOCF cfFlags, ASSOCKEY assockey, LPCWSTR pszAssoc, LPCWSTR pszExtra, HKEY *phkeyOut)
HRESULT WINAPI AssocQueryKeyA(ASSOCF cfFlags, ASSOCKEY assockey, LPCSTR pszAssoc, LPCSTR pszExtra, HKEY *phkeyOut)
HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface)
const WCHAR type_compressed[]
HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc, LPCSTR pszExtra, LPSTR pszOut, DWORD *pcchOut)
static const WCHAR document_exts[]
const WCHAR type_document[]
HRESULT WINAPI AssocQueryStringByKeyW(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc, LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut)
static const WCHAR audio_exts[]
HRESULT WINAPI AssocGetPerceivedType(LPCWSTR lpszExt, PERCEIVED *lpType, INT *lpFlag, LPWSTR *lppszType)
const WCHAR type_system[]
static const struct AssocPerceivedInfo known_types[]
static const struct AssocPerceivedInfo * AssocFindByType(LPCWSTR pszType)
HRESULT WINAPI AssocQueryStringW(ASSOCF cfFlags, ASSOCSTR str, LPCWSTR pszAssoc, LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut)
#define HARDCODED_NATIVE_WMSDK
HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc, LPCSTR pszExtra, LPSTR pszOut, DWORD *pcchOut)
const WCHAR type_application[]
static const struct AssocPerceivedInfo * AssocFindByBuiltinExtension(LPCWSTR pszExt)
static const WCHAR application_exts[]
static const WCHAR image_exts[]
#define HARDCODED_NATIVE_GDIPLUS
static const WCHAR video_exts[]
static const WCHAR compressed_exts[]
static const WCHAR unspecified_exts[]
EXTERN_C ULONG WINAPI GetProcessOsVersion(void)
EXTERN_C HRESULT WINAPI AssocCreateElement(_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ PVOID *ppvObj)
static struct proto Ext[]
#define ERROR_FILE_NOT_FOUND
#define IsEqualGUID(rguid1, rguid2)
#define IQueryAssociations_GetKey(p, a, b, c, d)
#define PERCEIVEDFLAG_HARDCODED
#define IQueryAssociations_Release(p)
#define IQueryAssociations_Init(p, a, b, c, d)
#define IQueryAssociations_GetString(p, a, b, c, d, e)
#define PERCEIVEDFLAG_SOFTCODED
#define _WIN32_WINNT_VISTA
enum tagPERCEIVED PERCEIVED
@ PERCEIVED_TYPE_COMPRESSED
@ PERCEIVED_TYPE_DOCUMENT
@ PERCEIVED_TYPE_UNSPECIFIED
@ PERCEIVED_TYPE_APPLICATION
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define CLASS_E_CLASSNOTAVAILABLE
#define HKEY_CLASSES_ROOT