mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
592 B
38 lines
592 B
|
|
#include <mytypes.h>
|
|
#include <misclib.h>
|
|
#include <diskio.h>
|
|
#include <partimag.h>
|
|
|
|
|
|
BOOL
|
|
_far
|
|
IsMasterDisk(
|
|
IN UINT DiskId,
|
|
OUT FPVOID IoBuffer
|
|
)
|
|
{
|
|
BOOL b;
|
|
HDISK hDisk;
|
|
PMASTER_DISK p;
|
|
|
|
b = FALSE;
|
|
if(hDisk = OpenDisk(DiskId)) {
|
|
|
|
if(ReadDisk(hDisk,1,1,IoBuffer)) {
|
|
|
|
p = IoBuffer;
|
|
|
|
if((p->Signature == MASTER_DISK_SIGNATURE)
|
|
&& (p->Size == sizeof(MASTER_DISK))
|
|
&& p->StartupPartitionStartSector) {
|
|
|
|
b = TRUE;
|
|
}
|
|
}
|
|
|
|
CloseDisk(hDisk);
|
|
}
|
|
|
|
return(b);
|
|
}
|