| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | PDSK_LOCKPHYSDRIVE Problem |
Hi all!
I have some troubles using the above IOCtl in Warp 4.
It's a system with 5 SCSI disks:
- 0: 200MB C: OS/2 System
- 1: 150MB empty
- 2: 150MB empty
- 3: 150MB empty
- 4: 520MB empty
Trying to lock the first disk gives error 33, this is expected. Locking
disk 1 and 2 give no error. But when I try to lock disk 3 or 4 the floppy
disk starts spinning and I get error 21 or 33 depending whether a disk is
inserted or not.
Removing a 150MB disk gives the same results, updating to FP#6, too.
I have no idea why the floppy disk is access at all, especially as I check
the drive parameters before locking (via PDSK_GETPHYSDEVICEPARAMS) and they
look OK.
Has anyone tried to use PDSK_LOCKPHYSDRIVE on a comparable system? I want
to lock a disk before I create RAID partitions on it so my code should work
in a 20 disk system...
C-x C-s
Vitus
The below code has been developed on a Warp 3 FP#32 System which had a
2100MB disk and the three 150MB and worked OK. (you may request a simple
surface check program including the source as magic PDSK)
===============================================
PUBLIC APIRET
PDskOpen(ULONG idx,PULONG handle)
{
APIRET rc;
char str[20];
PDEVTAB dt = Allocate();
sprintf(str, "%lu:", idx+1);
rc = DosPhysicalDisk(INFO_GETIOCTLHANDLE,
&dt->hd, sizeof(dt->hd),
str, strlen(str)+1);
if( rc == 0 )
{
UCHAR ucParm = 0;
ULONG ulParmLen = sizeof(ucParm);
ULONG ulDataLen = sizeof(dt->layout);
rc = DosDevIOCtl(dt->hd, IOCTL_PHYSICALDISK, PDSK_GETPHYSDEVICEPARAMS,
&ucParm, ulParmLen, &ulParmLen,
&dt->layout, ulDataLen, &ulDataLen);
...
*handle = (ULONG)dt;
}
return rc;
}
PUBLIC APIRET
PDskLock(ULONG handle)
{
PDEVTAB dt = (PDEVTAB)handle;
UCHAR ucParm = 0;
ULONG ulParmLen = sizeof(ucParm);
UCHAR aucData[31];
ULONG ulDataLen = sizeof(aucData);
memset(aucData, 0, sizeof(aucData));
return DosDevIOCtl(dt->hd, IOCTL_PHYSICALDISK, PDSK_LOCKPHYSDRIVE,
&ucParm, ulParmLen, &ulParmLen,
aucData, ulDataLen, &ulDataLen);
}
=================================================
Team OS/2 Germany #835, Fidonet, OS2Net, FAX/BBS: +49-5136-893003, ...
--- Sqed/rexx 464:
* Origin: (Dos + Windows + ATM) < OS/2! (2:2474/424.1)SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 635/444 506 728 639/252 SEEN-BY: 670/218 @PATH: 2474/424 400 200 2613/404 5 140/1 396/1 633/260 635/506 728 633/267 |
|
| 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™.