Click here to Skip to main content
15,923,681 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
GeneralRe: Assembly language Pin
alaquniabi8-Jul-06 20:48
alaquniabi8-Jul-06 20:48 
GeneralRe: Assembly language Pin
ira9119-Jul-06 23:59
ira9119-Jul-06 23:59 
AnswerRe: Assembly language Pin
Steve Echols7-Jul-06 13:23
Steve Echols7-Jul-06 13:23 
QuestionMonitor Resolution? Pin
#hackC++16-Jun-06 4:41
#hackC++16-Jun-06 4:41 
AnswerRe: Monitor Resolution? Pin
Dan Neely16-Jun-06 4:54
Dan Neely16-Jun-06 4:54 
AnswerRe: Monitor Resolution? Pin
Farhan Noor Qureshi16-Jun-06 5:59
Farhan Noor Qureshi16-Jun-06 5:59 
QuestionHow to get SRB_HaId, SRB_Target and SRB_Lun? Pin
Syouki_kou15-Jun-06 16:32
Syouki_kou15-Jun-06 16:32 
AnswerRe: How to get SRB_HaId, SRB_Target and SRB_Lun? Pin
kakan15-Jun-06 21:21
professionalkakan15-Jun-06 21:21 
Do something like this (just plain C(++), no unicode support):

char Drive[MAX_PATH];
char m_UseDrive = 'j';
HANDLE hDrive;

sprintf(Drive,"\\\\.\\%c:", m_UseDrive);

hDrive = CreateFile(Drive, GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);

if(hDrive == INVALID_HANDLE_VALUE) {
// Error
}


// These defines comes from devioctl.h and ntddscsi.h
// Include them if you've got them.
#define FILE_DEVICE_CONTROLLER 0x00000004
#define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
#define IOCTL_SCSI_GET_ADDRESS CTL_CODE(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS)

typedef struct _SCSI_ADDRESS {
ULONG Length; // Contains the length of this structure in bytes. .
UCHAR PortNumber; // Contains the number of the SCSI adapter.
UCHAR PathId; // Contains the number of the bus.
UCHAR TargetId; // Contains the number of the target device.
UCHAR Lun; // Contains the logical unit number.
}SCSI_ADDRESS, *PSCSI_ADDRESS;

// The real code starts here

#define MAX_DATA_BUFFER 2048

UCHAR dataBuffer[MAX_DATA_BUFFER];
ULONG bytesReturned;
BOOL bRetVal;


ZeroMemory(&dataBuffer[0], sizeof(dataBuffer));

// Get the device address information.
bRetVal = DeviceIoControl(hDrive, IOCTL_SCSI_GET_ADDRESS, NULL,
0, dataBuffer, sizeof(dataBuffer), &bytesReturned, FALSE);

if(bRetVal == TRUE && bytesReturned == sizeof(SCSI_ADDRESS)) {
// OK! Got the SCSI address!
PSCSI_ADDRESS ps = (PSCSI_ADDRESS)&dataBuffer[0];
// Check out ps
printf("PortNumber:%d, PathId:%d, TargetId:%d, Lun:%d",
ps->PortNumber, ps->PathId, ps->TargetId, ps->Lun);
}
CloseHandle(hDrive);



GeneralRe: How to get SRB_HaId, SRB_Target and SRB_Lun? Pin
Syouki_kou18-Jun-06 15:31
Syouki_kou18-Jun-06 15:31 
GeneralRe: How to get SRB_HaId, SRB_Target and SRB_Lun? Pin
kakan18-Jun-06 19:40
professionalkakan18-Jun-06 19:40 
QuestionVPN/Remote Desktop [modified] Pin
Rohde14-Jun-06 2:27
Rohde14-Jun-06 2:27 
AnswerRe: VPN/Remote Desktop Pin
Aryo Handono5-Jul-06 18:53
professionalAryo Handono5-Jul-06 18:53 
QuestionScreen Savers - Do they serve any purpose anymore? Pin
JSadleir13-Jun-06 15:44
JSadleir13-Jun-06 15:44 
AnswerRe: Screen Savers - Do they serve any purpose anymore? Pin
Michael Dunn13-Jun-06 21:38
sitebuilderMichael Dunn13-Jun-06 21:38 
GeneralRe: Screen Savers - Do they serve any purpose anymore? Pin
Sebastian Schneider15-Jun-06 18:24
Sebastian Schneider15-Jun-06 18:24 
GeneralRe: Screen Savers - Do they serve any purpose anymore? Pin
JSadleir18-Jun-06 15:13
JSadleir18-Jun-06 15:13 
AnswerRe: Screen Savers - Do they serve any purpose anymore? Pin
Member 9616-Jun-06 5:28
Member 9616-Jun-06 5:28 
QuestionThe Complete Idiot's Guide to Writing drivers Pin
xatkaru9-Jun-06 23:15
xatkaru9-Jun-06 23:15 
AnswerRe: The Complete Idiot's Guide to Writing drivers Pin
progload13-Jun-06 17:32
progload13-Jun-06 17:32 
GeneralRe: The Complete Idiot's Guide to Writing drivers Pin
fat_boy30-Jun-06 5:22
fat_boy30-Jun-06 5:22 
AnswerRe: The Complete Idiot's Guide to Writing drivers Pin
fat_boy30-Jun-06 5:22
fat_boy30-Jun-06 5:22 
Questionleagle / complience question Pin
Ray Cassick8-Jun-06 19:28
Ray Cassick8-Jun-06 19:28 
AnswerRe: leagle / complience question Pin
Sebastian Schneider8-Jun-06 22:40
Sebastian Schneider8-Jun-06 22:40 
AnswerRe: leagle / complience question Pin
S Douglas9-Jun-06 20:23
professionalS Douglas9-Jun-06 20:23 
Questionspeed test Pin
ramamaru8-Jun-06 9:44
ramamaru8-Jun-06 9:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.