Index: ddraw/glClassFactory.cpp |
— | — | @@ -24,24 +24,29 @@ |
25 | 25 |
|
26 | 26 | ULONG WINAPI glClassFactory::AddRef()
|
27 | 27 | {
|
28 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 28 | + TRACE_ENTER(1,14,this);
|
| 29 | + if(!this) TRACE_RET(8,0);
|
29 | 30 | refcount++;
|
| 31 | + TRACE_EXIT(8,refcount);
|
30 | 32 | return refcount;
|
31 | 33 | }
|
32 | 34 | ULONG WINAPI glClassFactory::Release()
|
33 | 35 | {
|
34 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 36 | + TRACE_ENTER(1,14,this);
|
| 37 | + if(!this) TRACE_RET(8,0);
|
35 | 38 | ULONG ret;
|
36 | 39 | refcount--;
|
37 | 40 | ret = refcount;
|
38 | 41 | if(refcount == 0) delete this;
|
| 42 | + TRACE_EXIT(8,ret);
|
39 | 43 | return ret;
|
40 | 44 | }
|
41 | 45 |
|
42 | 46 | HRESULT WINAPI glClassFactory::QueryInterface(REFIID riid, void** ppvObj)
|
43 | 47 | {
|
44 | | - if(!this) return DDERR_INVALIDPARAMS;
|
45 | | - if(!ppvObj) return DDERR_INVALIDPARAMS;
|
| 48 | + TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
| 49 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 50 | + if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
46 | 51 | if((riid == IID_IUnknown) || (riid == IID_IClassFactory))
|
47 | 52 | {
|
48 | 53 | *ppvObj = this;
|
— | — | @@ -50,20 +55,25 @@ |
51 | 56 | else
|
52 | 57 | {
|
53 | 58 | *ppvObj = NULL;
|
54 | | - return E_NOINTERFACE;
|
| 59 | + TRACE_RET(23,E_NOINTERFACE);
|
55 | 60 | }
|
| 61 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 62 | + TRACE_EXIT(23,S_OK);
|
56 | 63 | return S_OK;
|
57 | 64 | }
|
58 | 65 | HRESULT WINAPI glClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject)
|
59 | 66 | {
|
60 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 67 | + TRACE_ENTER(4,14,this,14,pUnkOuter,24,&riid,14,ppvObject);
|
| 68 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
61 | 69 | glDirectDraw7 *glDD7;
|
62 | | - if(pUnkOuter != NULL) return CLASS_E_NOAGGREGATION;
|
| 70 | + if(pUnkOuter != NULL) TRACE_RET(23,CLASS_E_NOAGGREGATION);
|
63 | 71 | if(riid == IID_IDirectDraw)
|
64 | 72 | {
|
65 | 73 | glDD7 = new glDirectDraw7;
|
66 | 74 | glDD7->QueryInterface(IID_IDirectDraw,ppvObject);
|
67 | 75 | glDD7->Release();
|
| 76 | + TRACE_VAR("*ppvObject",14,*ppvObject);
|
| 77 | + TRACE_EXIT(23,S_OK);
|
68 | 78 | return S_OK;
|
69 | 79 | }
|
70 | 80 | if(riid == IID_IDirectDraw2)
|
— | — | @@ -71,6 +81,8 @@ |
72 | 82 | glDD7 = new glDirectDraw7;
|
73 | 83 | glDD7->QueryInterface(IID_IDirectDraw2,ppvObject);
|
74 | 84 | glDD7->Release();
|
| 85 | + TRACE_VAR("*ppvObject",14,*ppvObject);
|
| 86 | + TRACE_EXIT(23,S_OK);
|
75 | 87 | return S_OK;
|
76 | 88 | }
|
77 | 89 | if(riid == IID_IDirectDraw4)
|
— | — | @@ -78,25 +90,35 @@ |
79 | 91 | glDD7 = new glDirectDraw7;
|
80 | 92 | glDD7->QueryInterface(IID_IDirectDraw4,ppvObject);
|
81 | 93 | glDD7->Release();
|
| 94 | + TRACE_VAR("*ppvObject",14,*ppvObject);
|
| 95 | + TRACE_EXIT(23,S_OK);
|
82 | 96 | return S_OK;
|
83 | 97 | }
|
84 | 98 | if(riid == IID_IDirectDraw7)
|
85 | 99 | {
|
86 | 100 | *ppvObject = new glDirectDraw7();
|
| 101 | + TRACE_VAR("*ppvObject",14,*ppvObject);
|
| 102 | + TRACE_EXIT(23,S_OK);
|
87 | 103 | return S_OK;
|
88 | 104 | }
|
89 | 105 | if(riid == IID_IDirectDrawClipper)
|
90 | 106 | {
|
91 | 107 | *ppvObject = new glDirectDrawClipper();
|
| 108 | + TRACE_VAR("*ppvObject",14,*ppvObject);
|
| 109 | + TRACE_EXIT(23,S_OK);
|
| 110 | + return S_OK;
|
92 | 111 | }
|
93 | 112 | FIXME("glClassFactory::CreateInterface: stub");
|
| 113 | + TRACE_EXIT(23,E_NOINTERFACE);
|
94 | 114 | return E_NOINTERFACE;
|
95 | 115 | }
|
96 | 116 | HRESULT WINAPI glClassFactory::LockServer(BOOL fLock)
|
97 | 117 | {
|
98 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 118 | + TRACE_ENTER(2,14,this,22,fLock);
|
| 119 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
99 | 120 | if(fLock) InterlockedIncrement(&locks);
|
100 | 121 | else InterlockedDecrement(&locks);
|
| 122 | + TRACE_EXIT(23,S_OK);
|
101 | 123 | return S_OK;
|
102 | 124 | }
|
103 | 125 |
|
Index: ddraw/trace.cpp |
— | — | @@ -240,6 +240,9 @@ |
241 | 241 | case E_NOINTERFACE:
|
242 | 242 | strcpy(str,"E_NOINTERFACE");
|
243 | 243 | break;
|
| 244 | + case CLASS_E_NOAGGREGATION:
|
| 245 | + strcpy(str,"CLASS_E_NOAGGREGATION");
|
| 246 | + break;
|
244 | 247 | default:
|
245 | 248 | sprintf(str,"(HRESULT)0x%08X",hr);
|
246 | 249 | break;
|