Add support for HCBT_SYSCOMMAND hook, add logging for HCBT_SYSCOMMAND
[wine.git] / dlls / urlmon / urlmon_main.c
blob146f239409c72486818ac12f2d07309ae3caa9aa
1 /*
2 * UrlMon
4 * Copyright (c) 2000 Patrik Stridvall
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winerror.h"
26 #include "wtypes.h"
27 #define NO_SHLWAPI_REG
28 #include "shlwapi.h"
30 #include "wine/debug.h"
32 #include "urlmon_main.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
36 HINSTANCE URLMON_hInstance = 0;
38 /***********************************************************************
39 * DllMain (URLMON.init)
41 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
43 TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
45 switch(fdwReason) {
46 case DLL_PROCESS_ATTACH:
47 DisableThreadLibraryCalls(hinstDLL);
48 URLMON_hInstance = hinstDLL;
49 break;
51 case DLL_PROCESS_DETACH:
52 URLMON_hInstance = 0;
53 break;
55 return TRUE;
59 /***********************************************************************
60 * DllInstall (URLMON.@)
62 HRESULT WINAPI URLMON_DllInstall(BOOL bInstall, LPCWSTR cmdline)
64 FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE",
65 debugstr_w(cmdline));
67 return S_OK;
70 /***********************************************************************
71 * DllCanUnloadNow (URLMON.@)
73 HRESULT WINAPI URLMON_DllCanUnloadNow(void)
75 FIXME("(void): stub\n");
77 return S_FALSE;
80 /***********************************************************************
81 * DllGetClassObject (URLMON.@)
83 HRESULT WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID riid,
84 LPVOID *ppv)
86 FIXME("(%p, %p, %p): stub\n", debugstr_guid(rclsid),
87 debugstr_guid(riid), ppv);
89 return CLASS_E_CLASSNOTAVAILABLE;
92 /***********************************************************************
93 * DllRegisterServerEx (URLMON.@)
95 HRESULT WINAPI URLMON_DllRegisterServerEx(void)
97 FIXME("(void): stub\n");
99 return E_FAIL;
102 /**************************************************************************
103 * UrlMkSetSessionOption (URLMON.@)
105 HRESULT WINAPI UrlMkSetSessionOption(long lost, LPVOID *splat, long time,
106 long nosee)
108 FIXME("(%#lx, %p, %#lx, %#lx): stub\n", lost, splat, time, nosee);
110 return S_OK;
113 /**************************************************************************
114 * ObtainUserAgentString (URLMON.@)
116 HRESULT WINAPI ObtainUserAgentString(DWORD dwOption, LPCSTR pcszUAOut, DWORD *cbSize)
118 FIXME("(%ld, %p, %p): stub\n", dwOption, pcszUAOut, cbSize);
120 if(dwOption) {
121 ERR("dwOption: %ld, must be zero\n", dwOption);
124 return S_OK;
127 HRESULT WINAPI CoInternetCombineUrl(LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags,
128 LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
130 HRESULT hres;
131 DWORD size = cchResult;
133 TRACE("(%s,%s,0x%08lx,%p,%ld,%p,%ld)\n", debugstr_w(pwzBaseUrl), debugstr_w(pwzRelativeUrl), dwCombineFlags,
134 pwzResult, cchResult, pcchResult, dwReserved);
135 hres = UrlCombineW(pwzBaseUrl, pwzRelativeUrl, pwzResult, &size, dwCombineFlags);
136 if(pcchResult) *pcchResult = size;
137 return hres;
140 HRESULT WINAPI CoInternetCompareUrl(LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
142 TRACE("(%s,%s,%08lx)\n", debugstr_w(pwzUrl1), debugstr_w(pwzUrl2), dwCompareFlags);
143 return UrlCompareW(pwzUrl1, pwzUrl2, dwCompareFlags)==0?S_OK:S_FALSE;
146 /**************************************************************************
147 * IsValidURL (URLMON.@)
149 * Determines if a specified string is a valid URL.
151 * PARAMS
152 * pBC [I] ignored, must be NULL.
153 * szURL [I] string that represents the URL in question.
154 * dwReserved [I] reserved and must be zero.
156 * RETURNS
157 * Success: S_OK.
158 * Failure: S_FALSE.
159 * returns E_INVALIDARG if one or more of the args is invalid.
161 * TODO:
162 * test functionality against windows to see what a valid URL is.
164 HRESULT WINAPI IsValidURL(LPBC pBC, LPCWSTR szURL, DWORD dwReserved)
166 FIXME("(%p, %s, %ld): stub\n", pBC, debugstr_w(szURL), dwReserved);
168 if (pBC != NULL || dwReserved != 0)
169 return E_INVALIDARG;
171 return S_OK;