| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | reading and writing tracks |
Hello,
Now that the topic is not as hot as it used to be, can one of the gurus out
there tell me why this fragment of code, almost copied out of the docs,
fails with error code... 87 ?
_ _ _ O / _ _ C_U_T_ H_E_R_E_ _ _ _
O \
#define INCL_DOSDEVICES /* Device values */
#include
#include
#include
#define DSK_LAYOUTNONSTANDARD 0
VOID main (void)
{
USHORT hDisk;
BYTE abBuf[512];
USHORT j, i, m;
APIRET rc;
TRACKLAYOUT trckl =
{
DSK_LAYOUTNONSTANDARD, /* Might not start with sector 1*/
0, /* Head 0 */
0, /* Cylinder 0 */
0, /* First Sector in Track Table */
1, /* One Sector in Track Table */
512 /* 512 Bytes Sector */
};
rc = DosPhysicalDisk(
INFO_GETIOCTLHANDLE, /* Get the handle */
(PBYTE) &hDisk, /* in here */
sizeof(USHORT),
"1:", /* first partitionable
hard disk */
3); /* 1:sz */
rc = DosDevIOCtl(hDisk,
IOCTL_PHYSICALDISK,
PDSK_READPHYSTRACK,
&trckl,
sizeof(trckl),
0,
abBuf,
sizeof(abBuf),
0);
if (rc==0) {
printf("\n\nDosDevIOCtl executed successfully.\n\n");
} else {
printf("\n\nDosDevIOCtl failed with ErrorCode: %d\n\n", rc);
}; /* endif */
DosPhysicalDisk(
INFO_FREEIOCTLHANDLE,
0,
0,
&hDisk,
sizeof(USHORT));
}
_ _ _ O / _ _ C_U_T_ H_E_R_E_ _ _ _
O \
--- Squish v1.01
* Origin: DataRescue's BBS +32-41-720237 (2:293/2213)SEEN-BY: 105/42 620/243 624/50 711/401 409 410 413 430 807 808 809 934 955 SEEN-BY: 712/407 515 628 704 713/888 800/1 7877/2809 @PATH: 293/2213 2602 270/101 105/103 42 712/515 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.