Changeset 4265 for trunk/src/wnaspi32/winaspi32.cpp
- Timestamp:
- Sep 15, 2000, 3:25:50 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wnaspi32/winaspi32.cpp
r4260 r4265 1 /* $Id: winaspi32.cpp,v 1. 8 2000-09-14 19:09:17sandervl Exp $ */1 /* $Id: winaspi32.cpp,v 1.9 2000-09-15 13:25:50 sandervl Exp $ */ 2 2 /* 3 3 * WNASPI routines … … 28 28 //#include "callback.h" 29 29 30 #ifdef DEBUG 31 #define DEBUG_BUFFER 32 #endif 33 30 34 DEFAULT_DEBUG_CHANNEL(aspi) 31 35 ODINDEBUGCHANNEL(WNASPI32) … … 80 84 cdb = &prb->CDBByte[0]; 81 85 cmd = prb->CDBByte[0]; 82 if (TRACE_ON(aspi)) 83 { 84 DPRINTF("CDB buffer["); 86 #ifdef DEBUG_BUFFER 87 dprintfNoEOL(("CDB buffer[")); 85 88 for (i = 0; i < prb->SRB_CDBLen; i++) { 86 if (i != 0) DPRINTF(",");87 DPRINTF("%02x", *cdb++);88 } 89 DPRINTF("]\n");90 } 89 if (i != 0) dprintfNoEOL((",0x%02x", *cdb++)); 90 else dprintfNoEOL(("0x%02x", *cdb++)); 91 } 92 dprintfNoEOL(("]\n")); 93 #endif 91 94 } 92 95 … … 178 181 lpPRB->SRB_BufPointer, 179 182 lpPRB->SRB_BufLen); 183 184 #ifdef DEBUG_BUFFER 185 char *cdb = (char *)lpPRB->SRB_BufPointer; 186 dprintfNoEOL(("Write SRB buffer[")); 187 for (int i = 0; i < lpPRB->SRB_BufLen; i++) { 188 if (i != 0) dprintfNoEOL((",0x%02x", *cdb++)); 189 else dprintfNoEOL(("0x%02x", *cdb++)); 190 } 191 dprintfNoEOL(("]\n")); 192 #endif 180 193 } 181 194 } … … 195 208 aspi->buffer, 196 209 lpPRB->SRB_BufLen); 210 #ifdef DEBUG_BUFFER 211 char *cdb = (char *)lpPRB->SRB_BufPointer; 212 dprintfNoEOL(("Read SRB buffer[")); 213 for (int i = 0; i < lpPRB->SRB_BufLen; i++) { 214 if (i != 0) dprintfNoEOL((",0x%02x", *cdb++)); 215 else dprintfNoEOL(("0x%02x", *cdb++)); 216 } 217 dprintfNoEOL(("]\n")); 218 #endif 219 197 220 } 198 221 } … … 251 274 { 252 275 LONG rc; 253 scsiObj *aspi;254 ULONG hmtxDriver;255 276 BYTE bNumDrv; 256 277 HKEY hkeyDrvInfo; … … 263 284 bNumDrv = 0; 264 285 265 aspi = new scsiObj(); 266 267 if( fGainDrvAccess( FALSE, &hmtxDriver) ) // Do nonblocking call for info 268 { 269 270 if(aspi->init(65535)==TRUE) 271 { 272 286 if(aspi->access(FALSE)) //'non-blocking' call 287 { 273 288 bNumDrv = aspi->getNumHosts(); 274 289 brc = SS_COMP; … … 287 302 RegCloseKey( hkeyDrvInfo); 288 303 } 289 aspi->close(); 290 } 291 else 292 brc = SS_FAILED_INIT; 293 294 fReleaseDrvAccess( hmtxDriver); 304 aspi->release(); 295 305 } 296 306 else … … 324 334 } 325 335 } 326 delete aspi;327 336 328 337 return ((brc << 8) | bNumDrv); /* FIXME: get # of host adapters installed */ … … 337 346 ULONG ulParam, ulReturn; 338 347 BYTE bRC; 339 scsiObj *aspi;340 ULONG hmtxDriver;341 348 LONG rc; 342 349 … … 357 364 } 358 365 359 aspi = new scsiObj();360 361 366 dwRC = SS_ERR; 362 367 363 if( fGainDrvAccess( TRUE, &hmtxDriver) ) // Block if a SRB is pending 364 { 365 if(aspi->init(65535)==TRUE) 366 { 368 if(aspi->access(TRUE)) // Block if a SRB is pending 369 { 367 370 switch (lpSRB->common.SRB_Cmd) 368 371 { … … 414 417 break; 415 418 416 } // end switch (lpSRB->common.SRB_Cmd) 417 418 } 419 else 420 { 421 dwRC = bRC; 422 } 423 424 fReleaseDrvAccess( hmtxDriver); 425 aspi->close(); 419 } // end switch (lpSRB->common.SRB_Cmd) 420 421 aspi->release(); 426 422 } 427 423 else 428 424 { 429 dwRC = SS_NO_ASPI; 430 } 431 delete aspi; 425 dwRC = SS_NO_ASPI; 426 } 432 427 433 428 return dwRC;
Note:
See TracChangeset
for help on using the changeset viewer.