Fixed ShellExecute functions when ddeexec was present in registry.
[wine] / dlls / urlmon / umon.c
1 /*
2  * UrlMon
3  *
4  * Copyright 1999 Corel Corporation
5  *
6  * Ulrich Czekalla
7  *
8  */
9
10 #include "windef.h"
11 #include "objbase.h"
12 #include "debugtools.h"
13
14 #include "urlmon.h"
15
16 DEFAULT_DEBUG_CHANNEL(urlmon);
17
18 /* native urlmon.dll uses this key, too */
19 static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
20
21
22 /***********************************************************************
23  *           CreateAsyncBindCtxEx (URLMON.@)
24  *
25  * not implemented
26  *
27  */
28 HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options,
29     IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx** pbind,
30     DWORD reserved)
31 {
32      FIXME("stub, returns failure\n");
33      return E_INVALIDARG;
34 }
35
36
37 /***********************************************************************
38  *           CreateURLMoniker (URLMON.@)
39  *
40  * Create a url moniker
41  *
42  * RETURNS
43  *    S_OK              success
44  *    E_OUTOFMEMORY     out of memory 
45  *    MK_E_SYNTAX       not a valid url
46  *
47  */
48 HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
49 {
50    TRACE("\n");
51
52    if (NULL != pmkContext)
53         FIXME("Non-null pmkContext not implemented\n");
54
55    return CreateFileMoniker(szURL, ppmk);
56 }
57
58 /***********************************************************************
59  *           RegisterBindStatusCallback (URLMON.@)
60  *
61  * Register a bind status callback
62  *
63  * RETURNS
64  *    S_OK              success
65  *    E_INVALIDARG  invalid argument(s)
66  *    E_OUTOFMEMORY     out of memory 
67  *
68  */
69 HRESULT WINAPI RegisterBindStatusCallback(
70     IBindCtx *pbc,
71     IBindStatusCallback *pbsc,
72     IBindStatusCallback **ppbscPrevious,
73     DWORD dwReserved)
74 {
75     IBindStatusCallback *prev;
76
77         TRACE("(%p,%p,%p,%lu)\n", pbc, pbsc, ppbscPrevious, dwReserved);
78
79     if (pbc == NULL || pbsc == NULL)
80         return E_INVALIDARG;
81
82     if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&prev)))
83     {
84         IBindCtx_RevokeObjectParam(pbc, BSCBHolder);
85         if (ppbscPrevious)
86             *ppbscPrevious = prev;
87         else
88             IBindStatusCallback_Release(prev);
89     }
90     
91         return IBindCtx_RegisterObjectParam(pbc, BSCBHolder, (IUnknown *)pbsc);
92 }
93
94 /***********************************************************************
95  *           RevokeBindStatusCallback (URLMON.@)
96  *
97  * Unregister a bind status callback
98  *
99  * RETURNS
100  *    S_OK              success
101  *    E_INVALIDARG  invalid argument(s)
102  *    E_FAIL pbsc wasn't registered with pbc
103  *
104  */
105 HRESULT WINAPI RevokeBindStatusCallback(
106     IBindCtx *pbc,
107     IBindStatusCallback *pbsc)
108 {
109     IBindStatusCallback *callback;
110     HRESULT hr = E_FAIL;
111
112         TRACE("(%p,%p)\n", pbc, pbsc);
113
114     if (pbc == NULL || pbsc == NULL)
115         return E_INVALIDARG;
116
117     if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&callback)))
118     {
119         if (callback == pbsc)
120         {
121             IBindCtx_RevokeObjectParam(pbc, BSCBHolder);
122             hr = S_OK;
123         }
124         IBindStatusCallback_Release(pbsc);
125     }
126
127     return hr;
128 }
129
130 /***********************************************************************
131  *           Extract (URLMON.@)
132  *
133  */
134 HRESULT WINAPI Extract(DWORD Param1, DWORD Param2)
135 {
136    TRACE("%lx %lx\n", Param1, Param2);
137
138    return S_OK;
139 }