Changeset 18806 in vbox for trunk/src/VBox
- Timestamp:
- Apr 7, 2009 11:41:25 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c
r18786 r18806 35 35 static void startVM(IVirtualBox *virtualBox, ISession *session, nsID *id); 36 36 37 int refcount = 0;37 int volatile g_refcount = 0; 38 38 39 39 /** … … 81 81 } 82 82 83 nsresult OnMousePointerShapeChange(83 static nsresult OnMousePointerShapeChange( 84 84 IConsoleCallback *this_, 85 85 PRBool visible, … … 95 95 } 96 96 97 nsresult OnMouseCapabilityChange(97 static nsresult OnMouseCapabilityChange( 98 98 IConsoleCallback *this_, 99 99 PRBool supportsAbsolute, … … 104 104 } 105 105 106 nsresult OnKeyboardLedsChange(106 static nsresult OnKeyboardLedsChange( 107 107 IConsoleCallback *this_, 108 108 PRBool numLock, … … 114 114 } 115 115 116 nsresult OnStateChange(116 static nsresult OnStateChange( 117 117 IConsoleCallback *this_, 118 118 PRUint32 state … … 124 124 } 125 125 126 nsresult OnAdditionsStateChange(IConsoleCallback *this_ )127 { 128 printf("%d here\n",__LINE__); 129 return 0; 130 } 131 132 nsresult OnDVDDriveChange(IConsoleCallback *this_ )133 { 134 printf("%d here\n",__LINE__); 135 return 0; 136 } 137 138 nsresult OnFloppyDriveChange(IConsoleCallback *this_ )139 { 140 printf("%d here\n",__LINE__); 141 return 0; 142 } 143 144 nsresult OnNetworkAdapterChange(126 static nsresult OnAdditionsStateChange(IConsoleCallback *this_ ) 127 { 128 printf("%d here\n",__LINE__); 129 return 0; 130 } 131 132 static nsresult OnDVDDriveChange(IConsoleCallback *this_ ) 133 { 134 printf("%d here\n",__LINE__); 135 return 0; 136 } 137 138 static nsresult OnFloppyDriveChange(IConsoleCallback *this_ ) 139 { 140 printf("%d here\n",__LINE__); 141 return 0; 142 } 143 144 static nsresult OnNetworkAdapterChange( 145 145 IConsoleCallback *this_, 146 146 INetworkAdapter * networkAdapter … … 150 150 } 151 151 152 nsresult OnSerialPortChange(152 static nsresult OnSerialPortChange( 153 153 IConsoleCallback *this_, 154 154 ISerialPort * serialPort … … 158 158 } 159 159 160 nsresult OnParallelPortChange(160 static nsresult OnParallelPortChange( 161 161 IConsoleCallback *this_, 162 162 IParallelPort * parallelPort … … 166 166 } 167 167 168 nsresult OnStorageControllerChange(IConsoleCallback *this_ )169 { 170 printf("%d here\n",__LINE__); 171 return 0; 172 } 173 174 nsresult OnVRDPServerChange(IConsoleCallback *this_ )175 { 176 printf("%d here\n",__LINE__); 177 return 0; 178 } 179 180 nsresult OnUSBControllerChange(IConsoleCallback *this_ )181 { 182 printf("%d here\n",__LINE__); 183 return 0; 184 } 185 186 nsresult OnUSBDeviceStateChange(168 static nsresult OnStorageControllerChange(IConsoleCallback *this_ ) 169 { 170 printf("%d here\n",__LINE__); 171 return 0; 172 } 173 174 static nsresult OnVRDPServerChange(IConsoleCallback *this_ ) 175 { 176 printf("%d here\n",__LINE__); 177 return 0; 178 } 179 180 static nsresult OnUSBControllerChange(IConsoleCallback *this_ ) 181 { 182 printf("%d here\n",__LINE__); 183 return 0; 184 } 185 186 static nsresult OnUSBDeviceStateChange( 187 187 IConsoleCallback *this_, 188 188 IUSBDevice * device, … … 194 194 } 195 195 196 nsresult OnSharedFolderChange(196 static nsresult OnSharedFolderChange( 197 197 IConsoleCallback *this_, 198 198 PRUint32 scope … … 202 202 } 203 203 204 nsresult OnRuntimeError(204 static nsresult OnRuntimeError( 205 205 IConsoleCallback *this_, 206 206 PRBool fatal, … … 212 212 } 213 213 214 nsresult OnCanShowWindow(214 static nsresult OnCanShowWindow( 215 215 IConsoleCallback *this_, 216 216 PRBool * canShow … … 220 220 } 221 221 222 nsresult OnShowWindow(222 static nsresult OnShowWindow( 223 223 IConsoleCallback *this_, 224 224 PRUint64 * winId … … 229 229 230 230 231 nsresult AddRef(IConsoleCallback *this_) 232 { 231 static nsresult AddRef(nsISupports *this_) 232 { 233 nsresult c; 234 233 235 printf("AddRef\n"); 234 refcount++; 235 return refcount; 236 } 237 238 nsresult Release(IConsoleCallback *this_) 239 { 236 c = g_refcount++; 237 return c; 238 } 239 240 static nsresult Release(nsISupports *this_) 241 { 242 nsresult c; 240 243 printf("Release\n"); 241 refcount--; 242 return refcount; 243 } 244 245 nsresult QueryInterface(IConsoleCallback *this_, const nsID *iid, void **resultp) 246 { 244 245 c = g_refcount--; 246 if (c == 0) 247 { 248 /* delete object */ 249 #if 0 /* test */ 250 free(this_->vtbl); 251 free(this_); 252 #endif 253 } 254 return c; 255 } 256 257 static nsresult QueryInterface(nsISupports *this_, const nsID *iid, void **resultp) 258 { 259 IConsoleCallback *that = (IConsoleCallback *)this_; 260 247 261 printf("QueryInterface\n"); 248 refcount++; 249 *resultp = this_; 262 /* match iid */ 263 g_refcount++; 264 *resultp = that; 250 265 return 0; 251 266 } … … 287 302 consoleCallback->vtbl->OnCanShowWindow = &OnCanShowWindow; 288 303 consoleCallback->vtbl->OnShowWindow = &OnShowWindow; 304 g_refcount = 1; 289 305 290 306 printf("%d here\n",__LINE__); … … 292 308 printf("%d here\n",__LINE__); 293 309 294 int run = 10; 295 while (run-- > 0) { 296 sleep(1); 297 printf("waiting here:%d\n",run); 298 fflush(stdout); 310 { 311 int run = 10; 312 while (run-- > 0) { 313 sleep(1); 314 printf("waiting here:%d\n",run); 315 fflush(stdout); 316 } 299 317 } 300 318 console->vtbl->UnregisterCallback(console, consoleCallback); 301 319 } 302 //free(consoleCallback->vtbl); 303 //free(consoleCallback); 320 /*consoleCallback->vtbl->Release(consoleCallback);*/ 304 321 } 305 322 session->vtbl->Close((void *)session); … … 447 464 448 465 machine->vtbl->GetId(machine, &iid); 449 / /startVM(virtualBox, session, iid);466 /*startVM(virtualBox, session, iid);*/ 450 467 registerCallBack(virtualBox, session, iid); 451 468 … … 464 481 if (machine) 465 482 { 466 machine->vtbl->nsisupports.Release(( void*)machine);483 machine->vtbl->nsisupports.Release((nsISupports *)machine); 467 484 } 468 485 }
Note:
See TracChangeset
for help on using the changeset viewer.