Changeset 2638 for trunk/src/ddraw/ddraw.CPP
- Timestamp:
- Feb 4, 2000, 8:31:26 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/ddraw.CPP
r2174 r2638 1 /* $Id: ddraw.CPP,v 1.1 0 1999-12-21 01:28:15hugh Exp $ */1 /* $Id: ddraw.CPP,v 1.11 2000-02-04 19:31:23 hugh Exp $ */ 2 2 3 3 /* … … 12 12 13 13 #include <memory.h> 14 14 #include <stdio.h> 15 15 #include <builtin.h> 16 16 #define INITGUID 17 #define ICOM_CINTERFACE 1 18 #define CINTERFACE 19 17 20 #include "os2ddraw.h" 21 #include "winerror.h" 18 22 // define the following as we include winnt.h 19 23 #define _OS2WIN_H … … 41 45 else 42 46 { 43 //newdraw->Vtbl.AddRef((IDirectDraw *)newdraw);47 newdraw->Vtbl.AddRef((IDirectDraw *)newdraw); 44 48 rc = newdraw->GetLastError(); 45 49 if(rc != DD_OK) … … 142 146 } 143 147 //****************************************************************************** 144 //****************************************************************************** 148 149 /******************************************************************************* 150 * DirectDraw ClassFactory 151 * 152 */ 153 154 typedef struct 155 { 156 /* IUnknown fields */ 157 ICOM_VTABLE(IClassFactory) *lpvtbl; 158 DWORD ref; 159 } IClassFactoryImpl; 160 161 static HRESULT WINAPI 162 DDCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) 163 { 164 ICOM_THIS(IClassFactoryImpl,iface); 165 char buf[80]; 166 167 if (HIWORD(riid)) 168 WINE_StringFromCLSID(riid,buf); 169 else 170 sprintf(buf,"<guid-0x%04x>",LOWORD(riid)); 171 dprintf(("DDRAW:(%p)->(%s,%p),stub!\n",This,buf,ppobj)); 172 return E_NOINTERFACE; 173 } 174 175 static ULONG WINAPI 176 DDCF_AddRef(LPCLASSFACTORY iface) 177 { 178 ICOM_THIS(IClassFactoryImpl,iface); 179 return ++(This->ref); 180 } 181 182 static ULONG WINAPI DDCF_Release(LPCLASSFACTORY iface) 183 { 184 ICOM_THIS(IClassFactoryImpl,iface); 185 /* static class, won't be freed */ 186 return --(This->ref); 187 } 188 189 static HRESULT WINAPI DDCF_CreateInstance( LPCLASSFACTORY iface, 190 LPUNKNOWN pOuter, 191 REFIID riid, 192 LPVOID *ppobj) 193 { 194 ICOM_THIS(IClassFactoryImpl,iface); 195 LPGUID lpGUID; 196 lpGUID = (LPGUID) riid; 197 198 dprintf(("DDRAW:DDCF_CreateInstance\n")); 199 if( lpGUID && 200 ( (*lpGUID == IID_IDirectDraw ) || 201 (*lpGUID == IID_IDirectDraw2) || 202 (*lpGUID == IID_IDirectDraw4)) 203 ) 204 { 205 /* FIXME: reuse already created DirectDraw if present? */ 206 return OS2DirectDrawCreate(lpGUID,(LPDIRECTDRAW*)ppobj,pOuter); 207 } 208 return E_NOINTERFACE; 209 } 210 211 static HRESULT WINAPI DDCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) 212 { 213 ICOM_THIS(IClassFactoryImpl,iface); 214 dprintf(("DDRAW:(%p)->(%d),stub!\n",This,dolock)); 215 return S_OK; 216 } 217 218 static ICOM_VTABLE(IClassFactory) DDCF_Vtbl = 219 { 220 DDCF_QueryInterface, 221 DDCF_AddRef, 222 DDCF_Release, 223 DDCF_CreateInstance, 224 DDCF_LockServer 225 }; 226 227 static IClassFactoryImpl DDRAW_CF = {&DDCF_Vtbl, 1 }; 228 229 230 HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, 231 REFIID riid, 232 LPVOID *ppv) 233 { 234 char buf[80],xbuf[80]; 235 236 if (HIWORD(rclsid)) 237 WINE_StringFromCLSID(rclsid,xbuf); 238 else 239 sprintf(xbuf,"<guid-0x%04x>",LOWORD(rclsid)); 240 if (HIWORD(riid)) 241 WINE_StringFromCLSID(riid,buf); 242 else 243 sprintf(buf,"<guid-0x%04x>",LOWORD(riid)); 244 WINE_StringFromCLSID(riid,xbuf); 245 246 dprintf(("DDRAW:(%p,%p,%p)\n", xbuf, buf, ppv)); 247 if (!memcmp(riid,&IID_IClassFactory,sizeof(IID_IClassFactory))) 248 { 249 *ppv = (LPVOID)&DDRAW_CF; 250 DDRAW_CF.lpvtbl->AddRef((IClassFactory*)&DDRAW_CF); 251 return S_OK; 252 } 253 dprintf(("DDRAW: (%p,%p,%p): no interface found.\n", xbuf, buf, ppv)); 254 return E_NOINTERFACE; 255 } 256 257 258 /******************************************************************************* 259 * DllCanUnloadNow [DDRAW.12] Determines whether the DLL is in use. 260 * 261 * RETURNS 262 * Success: S_OK 263 * Failure: S_FALSE 264 */ 265 HRESULT WINAPI DllCanUnloadNow(void) 266 { 267 dprintf(("DllCanUnloadNow(void) stub\n")); 268 return S_FALSE; 269 }//****************************************************************************** 270
Note:
See TracChangeset
for help on using the changeset viewer.