Faster serial speed cases for non Linux systems.
[wine] / dlls / urlmon / umon.c
1 /*
2  * UrlMon
3  *
4  * Copyright 1999 Corel Corporation
5  *
6  * Ulrich Czekalla
7  *
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
21  */
22
23 #include "windef.h"
24 #include "objbase.h"
25 #include "wine/debug.h"
26
27 #include "urlmon.h"
28
29 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
30
31 /* native urlmon.dll uses this key, too */
32 static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
33
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
50 /***********************************************************************
51  *           RegisterBindStatusCallback (URLMON.@)
52  *
53  * Register a bind status callback
54  *
55  * RETURNS
56  *    S_OK              success
57  *    E_INVALIDARG  invalid argument(s)
58  *    E_OUTOFMEMORY     out of memory 
59  *
60  */
61 HRESULT WINAPI RegisterBindStatusCallback(
62     IBindCtx *pbc,
63     IBindStatusCallback *pbsc,
64     IBindStatusCallback **ppbscPrevious,
65     DWORD dwReserved)
66 {
67     IBindStatusCallback *prev;
68
69         TRACE("(%p,%p,%p,%lu)\n", pbc, pbsc, ppbscPrevious, dwReserved);
70
71     if (pbc == NULL || pbsc == NULL)
72         return E_INVALIDARG;
73
74     if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&prev)))
75     {
76         IBindCtx_RevokeObjectParam(pbc, BSCBHolder);
77         if (ppbscPrevious)
78             *ppbscPrevious = prev;
79         else
80             IBindStatusCallback_Release(prev);
81     }
82     
83         return IBindCtx_RegisterObjectParam(pbc, BSCBHolder, (IUnknown *)pbsc);
84 }
85
86 /***********************************************************************
87  *           RevokeBindStatusCallback (URLMON.@)
88  *
89  * Unregister a bind status callback
90  *
91  * RETURNS
92  *    S_OK              success
93  *    E_INVALIDARG  invalid argument(s)
94  *    E_FAIL pbsc wasn't registered with pbc
95  *
96  */
97 HRESULT WINAPI RevokeBindStatusCallback(
98     IBindCtx *pbc,
99     IBindStatusCallback *pbsc)
100 {
101     IBindStatusCallback *callback;
102     HRESULT hr = E_FAIL;
103
104         TRACE("(%p,%p)\n", pbc, pbsc);
105
106     if (pbc == NULL || pbsc == NULL)
107         return E_INVALIDARG;
108
109     if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&callback)))
110     {
111         if (callback == pbsc)
112         {
113             IBindCtx_RevokeObjectParam(pbc, BSCBHolder);
114             hr = S_OK;
115         }
116         IBindStatusCallback_Release(pbsc);
117     }
118
119     return hr;
120 }
121
122 /***********************************************************************
123  *           Extract (URLMON.@)
124  *
125  */
126 HRESULT WINAPI Extract(DWORD Param1, DWORD Param2)
127 {
128    FIXME("%lx %lx\n", Param1, Param2);
129
130    return E_NOTIMPL;
131 }