hlink: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
69e612c512
commit
d9e109fd92
|
@ -98,8 +98,6 @@ static ULONG WINAPI IHlinkBC_fnRelease (IHlinkBrowseContext* iface)
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const WCHAR szIdent[] = {'W','I','N','E','H','L','I','N','K',0};
|
|
||||||
|
|
||||||
static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface,
|
static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface,
|
||||||
DWORD dwReserved, IUnknown *piunk, IMoniker *pimk, DWORD *pdwRegister)
|
DWORD dwReserved, IUnknown *piunk, IMoniker *pimk, DWORD *pdwRegister)
|
||||||
{
|
{
|
||||||
|
@ -111,7 +109,7 @@ static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface,
|
||||||
|
|
||||||
FIXME("(%p)->(%i %p %p %p)\n", This, dwReserved, piunk, pimk, pdwRegister);
|
FIXME("(%p)->(%i %p %p %p)\n", This, dwReserved, piunk, pimk, pdwRegister);
|
||||||
|
|
||||||
hr = CreateItemMoniker(NULL, szIdent, &mon);
|
hr = CreateItemMoniker(NULL, L"WINEHLINK", &mon);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
CreateGenericComposite(mon, pimk, &composite);
|
CreateGenericComposite(mon, pimk, &composite);
|
||||||
|
@ -137,7 +135,7 @@ static HRESULT WINAPI IHlinkBC_GetObject(IHlinkBrowseContext* iface,
|
||||||
|
|
||||||
TRACE("(%p)->(%p, %d, %p)\n", This, pimk, fBindifRootRegistered, ppiunk);
|
TRACE("(%p)->(%p, %d, %p)\n", This, pimk, fBindifRootRegistered, ppiunk);
|
||||||
|
|
||||||
hr = CreateItemMoniker(NULL, szIdent, &mon);
|
hr = CreateItemMoniker(NULL, L"WINEHLINK", &mon);
|
||||||
if (FAILED(hr)) return hr;
|
if (FAILED(hr)) return hr;
|
||||||
CreateGenericComposite(mon, pimk, &composite);
|
CreateGenericComposite(mon, pimk, &composite);
|
||||||
|
|
||||||
|
|
|
@ -245,10 +245,9 @@ static HRESULT ExtServ_ImplSetAdditionalHeaders(ExtensionService* This, LPCWSTR
|
||||||
len = lstrlenW(pwzAdditionalHeaders);
|
len = lstrlenW(pwzAdditionalHeaders);
|
||||||
|
|
||||||
if(len && pwzAdditionalHeaders[len-1] != '\n' && pwzAdditionalHeaders[len-1] != '\r') {
|
if(len && pwzAdditionalHeaders[len-1] != '\n' && pwzAdditionalHeaders[len-1] != '\r') {
|
||||||
static const WCHAR endlW[] = {'\r','\n',0};
|
This->headers = heap_alloc(len*sizeof(WCHAR) + sizeof(L"\r\n"));
|
||||||
This->headers = heap_alloc(len*sizeof(WCHAR) + sizeof(endlW));
|
|
||||||
memcpy(This->headers, pwzAdditionalHeaders, len*sizeof(WCHAR));
|
memcpy(This->headers, pwzAdditionalHeaders, len*sizeof(WCHAR));
|
||||||
memcpy(This->headers+len, endlW, sizeof(endlW));
|
memcpy(This->headers+len, L"\r\n", sizeof(L"\r\n"));
|
||||||
}else {
|
}else {
|
||||||
This->headers = hlink_strdupW(pwzAdditionalHeaders);
|
This->headers = hlink_strdupW(pwzAdditionalHeaders);
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,8 +273,6 @@ HRESULT WINAPI HlinkIsShortcut(LPCWSTR pwzFileName)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
static const WCHAR url_ext[] = {'.','u','r','l',0};
|
|
||||||
|
|
||||||
TRACE("(%s)\n", debugstr_w(pwzFileName));
|
TRACE("(%s)\n", debugstr_w(pwzFileName));
|
||||||
|
|
||||||
if(!pwzFileName)
|
if(!pwzFileName)
|
||||||
|
@ -284,7 +282,7 @@ HRESULT WINAPI HlinkIsShortcut(LPCWSTR pwzFileName)
|
||||||
if(len < 0)
|
if(len < 0)
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
|
|
||||||
return wcsicmp(pwzFileName+len, url_ext) ? S_FALSE : S_OK;
|
return wcsicmp(pwzFileName+len, L".url") ? S_FALSE : S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -297,25 +295,16 @@ HRESULT WINAPI HlinkGetSpecialReference(ULONG uReference, LPWSTR *ppwzReference)
|
||||||
WCHAR *buf;
|
WCHAR *buf;
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
|
|
||||||
static const WCHAR start_pageW[] = {'S','t','a','r','t',' ','P','a','g','e',0};
|
|
||||||
static const WCHAR search_pageW[] = {'S','e','a','r','c','h',' ','P','a','g','e',0};
|
|
||||||
|
|
||||||
static const WCHAR ie_main_keyW[] =
|
|
||||||
{'S','o','f','t','w','a','r','e',
|
|
||||||
'\\','M','i','c','r','o','s','o','f','t','\\',
|
|
||||||
'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r',
|
|
||||||
'\\','M','a','i','n',0};
|
|
||||||
|
|
||||||
TRACE("(%u %p)\n", uReference, ppwzReference);
|
TRACE("(%u %p)\n", uReference, ppwzReference);
|
||||||
|
|
||||||
*ppwzReference = NULL;
|
*ppwzReference = NULL;
|
||||||
|
|
||||||
switch(uReference) {
|
switch(uReference) {
|
||||||
case HLSR_HOME:
|
case HLSR_HOME:
|
||||||
value_name = start_pageW;
|
value_name = L"Start Page";
|
||||||
break;
|
break;
|
||||||
case HLSR_SEARCHPAGE:
|
case HLSR_SEARCHPAGE:
|
||||||
value_name = search_pageW;
|
value_name = L"Search Page";
|
||||||
break;
|
break;
|
||||||
case HLSR_HISTORYFOLDER:
|
case HLSR_HISTORYFOLDER:
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
|
@ -323,7 +312,7 @@ HRESULT WINAPI HlinkGetSpecialReference(ULONG uReference, LPWSTR *ppwzReference)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = RegOpenKeyW(HKEY_CURRENT_USER, ie_main_keyW, &hkey);
|
res = RegOpenKeyW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Internet Explorer\\Main", &hkey);
|
||||||
if(res != ERROR_SUCCESS) {
|
if(res != ERROR_SUCCESS) {
|
||||||
WARN("Could not open key: %u\n", res);
|
WARN("Could not open key: %u\n", res);
|
||||||
return HRESULT_FROM_WIN32(res);
|
return HRESULT_FROM_WIN32(res);
|
||||||
|
@ -380,8 +369,7 @@ HRESULT WINAPI HlinkUpdateStackItem(IHlinkFrame *frame, IHlinkBrowseContext *bc,
|
||||||
HRESULT WINAPI HlinkParseDisplayName(LPBC pibc, LPCWSTR pwzDisplayName, BOOL fNoForceAbs,
|
HRESULT WINAPI HlinkParseDisplayName(LPBC pibc, LPCWSTR pwzDisplayName, BOOL fNoForceAbs,
|
||||||
ULONG *pcchEaten, IMoniker **ppimk)
|
ULONG *pcchEaten, IMoniker **ppimk)
|
||||||
{
|
{
|
||||||
static const WCHAR file_colonW[] = {'f','i','l','e',':'};
|
ULONG eaten = 0, len;
|
||||||
ULONG eaten = 0;
|
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
TRACE("(%p %s %x %p %p)\n", pibc, debugstr_w(pwzDisplayName), fNoForceAbs, pcchEaten, ppimk);
|
TRACE("(%p %s %x %p %p)\n", pibc, debugstr_w(pwzDisplayName), fNoForceAbs, pcchEaten, ppimk);
|
||||||
|
@ -389,9 +377,10 @@ HRESULT WINAPI HlinkParseDisplayName(LPBC pibc, LPCWSTR pwzDisplayName, BOOL fNo
|
||||||
if(fNoForceAbs)
|
if(fNoForceAbs)
|
||||||
FIXME("Unsupported fNoForceAbs\n");
|
FIXME("Unsupported fNoForceAbs\n");
|
||||||
|
|
||||||
if(!wcsnicmp(pwzDisplayName, file_colonW, ARRAY_SIZE(file_colonW))) {
|
len = ARRAY_SIZE(L"file:") - 1;
|
||||||
pwzDisplayName += ARRAY_SIZE(file_colonW);
|
if(!wcsnicmp(pwzDisplayName, L"file:", len)) {
|
||||||
eaten += ARRAY_SIZE(file_colonW);
|
pwzDisplayName += len;
|
||||||
|
eaten += len;
|
||||||
|
|
||||||
while(*pwzDisplayName == '/') {
|
while(*pwzDisplayName == '/') {
|
||||||
pwzDisplayName++;
|
pwzDisplayName++;
|
||||||
|
|
|
@ -537,13 +537,12 @@ static HRESULT WINAPI IHlink_fnNavigate(IHlink *iface, DWORD flags, IBindCtx *us
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static const WCHAR szOpen[] = {'o','p','e','n',0};
|
|
||||||
LPWSTR target = NULL;
|
LPWSTR target = NULL;
|
||||||
|
|
||||||
r = IHlink_GetStringReference(iface, HLINKGETREF_DEFAULT, &target, NULL);
|
r = IHlink_GetStringReference(iface, HLINKGETREF_DEFAULT, &target, NULL);
|
||||||
if (SUCCEEDED(r) && target)
|
if (SUCCEEDED(r) && target)
|
||||||
{
|
{
|
||||||
ShellExecuteW(NULL, szOpen, target, NULL, NULL, SW_SHOW);
|
ShellExecuteW(NULL, L"open", target, NULL, NULL, SW_SHOW);
|
||||||
CoTaskMemFree(target);
|
CoTaskMemFree(target);
|
||||||
r = DRAGDROP_S_DROP;
|
r = DRAGDROP_S_DROP;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue