Alexandre Julliard | 819fa8c | 2000-04-11 20:07:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * UrlMon |
| 3 | * |
| 4 | * Copyright 1999 Corel Corporation |
| 5 | * |
| 6 | * Ulrich Czekalla |
| 7 | * |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 8 | * This library is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU Lesser General Public |
| 10 | * License as published by the Free Software Foundation; either |
| 11 | * version 2.1 of the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This library is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * Lesser General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU Lesser General Public |
| 19 | * License along with this library; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Alexandre Julliard | 819fa8c | 2000-04-11 20:07:00 +0000 | [diff] [blame] | 21 | */ |
| 22 | |
Patrik Stridvall | 1ed5577 | 2000-11-30 01:31:28 +0000 | [diff] [blame] | 23 | #include "windef.h" |
Alexandre Julliard | 819fa8c | 2000-04-11 20:07:00 +0000 | [diff] [blame] | 24 | #include "objbase.h" |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 25 | #include "wine/debug.h" |
Alexandre Julliard | 819fa8c | 2000-04-11 20:07:00 +0000 | [diff] [blame] | 26 | |
| 27 | #include "urlmon.h" |
| 28 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 29 | WINE_DEFAULT_DEBUG_CHANNEL(urlmon); |
Malte Starostik | 251f30a | 2001-05-31 21:38:38 +0000 | [diff] [blame] | 30 | |
| 31 | /* native urlmon.dll uses this key, too */ |
| 32 | static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }; |
Alexandre Julliard | 819fa8c | 2000-04-11 20:07:00 +0000 | [diff] [blame] | 33 | |
Gerard Patel | d83dfd0 | 2001-12-24 20:24:36 +0000 | [diff] [blame] | 34 | |
| 35 | /*********************************************************************** |
| 36 | * CreateAsyncBindCtxEx (URLMON.@) |
| 37 | * |
| 38 | * not implemented |
| 39 | * |
| 40 | */ |
| 41 | HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options, |
| 42 | IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx** pbind, |
| 43 | DWORD reserved) |
| 44 | { |
| 45 | FIXME("stub, returns failure\n"); |
| 46 | return E_INVALIDARG; |
| 47 | } |
| 48 | |
| 49 | |
Alexandre Julliard | 819fa8c | 2000-04-11 20:07:00 +0000 | [diff] [blame] | 50 | /*********************************************************************** |
Alexandre Julliard | 140e722 | 2002-05-05 19:40:57 +0000 | [diff] [blame] | 51 | * CreateURLMoniker (URLMON.@) |
| 52 | * |
| 53 | * Create a url moniker |
| 54 | * |
| 55 | * RETURNS |
| 56 | * S_OK success |
| 57 | * E_OUTOFMEMORY out of memory |
| 58 | * MK_E_SYNTAX not a valid url |
| 59 | * |
| 60 | */ |
| 61 | HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk) |
| 62 | { |
| 63 | TRACE("\n"); |
| 64 | |
| 65 | if (NULL != pmkContext) |
| 66 | FIXME("Non-null pmkContext not implemented\n"); |
| 67 | |
| 68 | return CreateFileMoniker(szURL, ppmk); |
| 69 | } |
| 70 | |
| 71 | /*********************************************************************** |
Patrik Stridvall | 8b216b3 | 2001-06-19 18:20:47 +0000 | [diff] [blame] | 72 | * RegisterBindStatusCallback (URLMON.@) |
Malte Starostik | 251f30a | 2001-05-31 21:38:38 +0000 | [diff] [blame] | 73 | * |
| 74 | * Register a bind status callback |
| 75 | * |
| 76 | * RETURNS |
| 77 | * S_OK success |
| 78 | * E_INVALIDARG invalid argument(s) |
| 79 | * E_OUTOFMEMORY out of memory |
| 80 | * |
| 81 | */ |
| 82 | HRESULT WINAPI RegisterBindStatusCallback( |
| 83 | IBindCtx *pbc, |
| 84 | IBindStatusCallback *pbsc, |
| 85 | IBindStatusCallback **ppbscPrevious, |
| 86 | DWORD dwReserved) |
| 87 | { |
| 88 | IBindStatusCallback *prev; |
| 89 | |
| 90 | TRACE("(%p,%p,%p,%lu)\n", pbc, pbsc, ppbscPrevious, dwReserved); |
| 91 | |
| 92 | if (pbc == NULL || pbsc == NULL) |
| 93 | return E_INVALIDARG; |
| 94 | |
| 95 | if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&prev))) |
| 96 | { |
| 97 | IBindCtx_RevokeObjectParam(pbc, BSCBHolder); |
| 98 | if (ppbscPrevious) |
| 99 | *ppbscPrevious = prev; |
| 100 | else |
| 101 | IBindStatusCallback_Release(prev); |
| 102 | } |
| 103 | |
| 104 | return IBindCtx_RegisterObjectParam(pbc, BSCBHolder, (IUnknown *)pbsc); |
| 105 | } |
| 106 | |
| 107 | /*********************************************************************** |
Patrik Stridvall | 8b216b3 | 2001-06-19 18:20:47 +0000 | [diff] [blame] | 108 | * RevokeBindStatusCallback (URLMON.@) |
Malte Starostik | 251f30a | 2001-05-31 21:38:38 +0000 | [diff] [blame] | 109 | * |
| 110 | * Unregister a bind status callback |
| 111 | * |
| 112 | * RETURNS |
| 113 | * S_OK success |
| 114 | * E_INVALIDARG invalid argument(s) |
| 115 | * E_FAIL pbsc wasn't registered with pbc |
| 116 | * |
| 117 | */ |
| 118 | HRESULT WINAPI RevokeBindStatusCallback( |
| 119 | IBindCtx *pbc, |
| 120 | IBindStatusCallback *pbsc) |
| 121 | { |
| 122 | IBindStatusCallback *callback; |
| 123 | HRESULT hr = E_FAIL; |
| 124 | |
| 125 | TRACE("(%p,%p)\n", pbc, pbsc); |
| 126 | |
| 127 | if (pbc == NULL || pbsc == NULL) |
| 128 | return E_INVALIDARG; |
| 129 | |
| 130 | if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&callback))) |
| 131 | { |
| 132 | if (callback == pbsc) |
| 133 | { |
| 134 | IBindCtx_RevokeObjectParam(pbc, BSCBHolder); |
| 135 | hr = S_OK; |
| 136 | } |
| 137 | IBindStatusCallback_Release(pbsc); |
| 138 | } |
| 139 | |
| 140 | return hr; |
| 141 | } |
| 142 | |
Eric Kohl | eba84bb | 2002-01-29 18:03:36 +0000 | [diff] [blame] | 143 | /*********************************************************************** |
| 144 | * Extract (URLMON.@) |
| 145 | * |
| 146 | */ |
| 147 | HRESULT WINAPI Extract(DWORD Param1, DWORD Param2) |
| 148 | { |
Alexandre Julliard | 140e722 | 2002-05-05 19:40:57 +0000 | [diff] [blame] | 149 | TRACE("%lx %lx\n", Param1, Param2); |
Eric Kohl | eba84bb | 2002-01-29 18:03:36 +0000 | [diff] [blame] | 150 | |
Alexandre Julliard | 140e722 | 2002-05-05 19:40:57 +0000 | [diff] [blame] | 151 | return S_OK; |
Eric Kohl | eba84bb | 2002-01-29 18:03:36 +0000 | [diff] [blame] | 152 | } |