source: trunk/include/helpers/dosh.h@ 132

Last change on this file since 132 was 132, checked in by umoeller, 24 years ago

Misc changes.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 25.6 KB
Line 
1
2/*
3 *@@sourcefile dosh.h:
4 * header file for dosh.c. See remarks there.
5 *
6 * Note: Version numbering in this file relates to XWorkplace version
7 * numbering.
8 *
9 *@@include #define INCL_DOSPROCESS
10 *@@include #define INCL_DOSDEVIOCTL // for doshQueryDiskParams only
11 *@@include #include <os2.h>
12 *@@include #include "helpers\dosh.h"
13 */
14
15/* This file Copyright (C) 1997-2001 Ulrich M”ller,
16 * Dmitry A. Steklenev.
17 * This file is part of the "XWorkplace helpers" source package.
18 * This is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published
20 * by the Free Software Foundation, in version 2 as it comes in the
21 * "COPYING" file of the XWorkplace main distribution.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 */
27
28#if __cplusplus
29extern "C" {
30#endif
31
32#ifndef DOSH_HEADER_INCLUDED
33 #define DOSH_HEADER_INCLUDED
34
35 /* ******************************************************************
36 *
37 * Miscellaneous
38 *
39 ********************************************************************/
40
41 CHAR doshGetChar(VOID);
42
43 BOOL doshQueryShiftState(VOID);
44
45 ULONG doshIsWarp4(VOID);
46
47 PSZ doshQuerySysErrorMsg(APIRET arc);
48
49 ULONG doshQuerySysUptime(VOID);
50
51 /* ******************************************************************
52 *
53 * Memory helpers
54 *
55 ********************************************************************/
56
57 PVOID doshMalloc(ULONG cb,
58 APIRET *parc);
59
60 APIRET doshAllocArray(ULONG c,
61 ULONG cbArrayItem,
62 PBYTE *ppv,
63 PULONG pcbAllocated);
64
65 PVOID doshAllocSharedMem(ULONG ulSize,
66 const char* pcszName);
67
68 PVOID doshRequestSharedMem(PCSZ pcszName);
69
70 /* ******************************************************************
71 *
72 * Drive helpers
73 *
74 ********************************************************************/
75
76 APIRET doshIsFixedDisk(ULONG ulLogicalDrive,
77 PBOOL pfFixed);
78
79 #ifdef INCL_DOSDEVIOCTL
80
81 // flags for DRIVEPARMS.usDeviceAttrs (see DSK_GETDEVICEPARAMS in CPREF):
82 #define DEVATTR_REMOVEABLE 0x0001 // drive is removeable
83 #define DEVATTR_CHANGELINE 0x0002 // media has been removed since last I/O operation
84 #define DEVATTR_GREATER16MB 0x0004 // physical device driver supports physical addresses > 16 MB
85
86 // #pragma pack(1)
87
88 /*
89 * DRIVEPARAMS:
90 * structure used for doshQueryDiskParams.
91 * removed this, we can directly use BIOSPARAMETERBLOCK
92 * V0.9.13 (2001-06-14) [umoeller]
93 */
94
95 /* typedef struct _DRIVEPARAMS
96 {
97 BIOSPARAMETERBLOCK bpb;
98 // BIOS parameter block. This is the first sector
99 // (at byte 0) in each partition. This is defined
100 // in the OS2 headers as follows:
101
102 typedef struct _BIOSPARAMETERBLOCK {
103 0 USHORT usBytesPerSector;
104 // Number of bytes per sector.
105 2 BYTE bSectorsPerCluster;
106 // Number of sectors per cluster.
107 3 USHORT usReservedSectors;
108 // Number of reserved sectors.
109 5 BYTE cFATs;
110 // Number of FATs.
111 6 USHORT cRootEntries;
112 // Number of root directory entries.
113 8 USHORT cSectors;
114 // Number of sectors.
115 10 BYTE bMedia;
116 // Media descriptor.
117 11 USHORT usSectorsPerFAT;
118 // Number of secctors per FAT.
119 13 USHORT usSectorsPerTrack;
120 // Number of sectors per track.
121 15 USHORT cHeads;
122 // Number of heads.
123 17 ULONG cHiddenSectors;
124 // Number of hidden sectors.
125 21 ULONG cLargeSectors;
126 // Number of large sectors.
127 25 BYTE abReserved[6];
128 // Reserved.
129 31 USHORT cCylinders;
130 // Number of cylinders defined for the physical
131 // device.
132 33 BYTE bDeviceType;
133 // Physical layout of the specified device.
134 34 USHORT fsDeviceAttr;
135 // A bit field that returns flag information
136 // about the specified drive.
137 } BIOSPARAMETERBLOCK;
138
139 // removed the following fields... these are already
140 // in the extended BPB structure, as defined in the
141 // Toolkit's BIOSPARAMETERBLOCK struct. Checked this,
142 // the definition is the same for the Toolkit 3 and 4.5.
143
144 USHORT usCylinders;
145 // no. of cylinders
146 UCHAR ucDeviceType;
147 // device type; according to the IBM Control
148 // Program Reference (see DSK_GETDEVICEPARAMS),
149 // this value can be:
150 // -- 0: 48 TPI low-density diskette drive
151 // -- 1: 96 TPI high-density diskette drive
152 // -- 2: 3.5-inch 720KB diskette drive
153 // -- 3: 8-Inch single-density diskette drive
154 // -- 4: 8-Inch double-density diskette drive
155 // -- 5: Fixed disk
156 // -- 6: Tape drive
157 // -- 7: Other (includes 1.44MB 3.5-inch diskette drive
158 // and CD-ROMs)
159 // -- 8: R/W optical disk
160 // -- 9: 3.5-inch 4.0MB diskette drive (2.88MB formatted)
161 USHORT usDeviceAttrs;
162 // DEVATTR_* flags
163 } DRIVEPARAMS, *PDRIVEPARAMS;
164 #pragma pack() */
165
166 APIRET doshQueryDiskParams(ULONG ulLogicalDrive,
167 PBIOSPARAMETERBLOCK pdp);
168
169 BOOL XWPENTRY doshIsCDROM(PBIOSPARAMETERBLOCK pdp);
170
171 #endif
172
173 APIRET XWPENTRY doshHasAudioCD(ULONG ulLogicalDrive,
174 HFILE hfDrive,
175 BOOL fMixedModeCD,
176 PBOOL pfAudio);
177
178 VOID XWPENTRY doshEnumDrives(PSZ pszBuffer,
179 PCSZ pcszFileSystem,
180 BOOL fSkipRemoveables);
181 typedef VOID XWPENTRY DOSHENUMDRIVES(PSZ pszBuffer,
182 PCSZ pcszFileSystem,
183 BOOL fSkipRemoveables);
184 typedef DOSHENUMDRIVES *PDOSHENUMDRIVES;
185
186 CHAR doshQueryBootDrive(VOID);
187
188 #define ERROR_AUDIO_CD_ROM 10000
189
190 #define ASSERTFL_MIXEDMODECD 0x0001
191
192 APIRET doshAssertDrive(ULONG ulLogicalDrive,
193 ULONG fl);
194
195 APIRET doshSetLogicalMap(ULONG ulLogicalDrive);
196
197 APIRET XWPENTRY doshQueryDiskSize(ULONG ulLogicalDrive, double *pdSize);
198 typedef APIRET XWPENTRY DOSHQUERYDISKSIZE(ULONG ulLogicalDrive, double *pdSize);
199 typedef DOSHQUERYDISKSIZE *PDOSHQUERYDISKSIZE;
200
201 APIRET XWPENTRY doshQueryDiskFree(ULONG ulLogicalDrive, double *pdFree);
202 typedef APIRET XWPENTRY DOSHQUERYDISKFREE(ULONG ulLogicalDrive, double *pdFree);
203 typedef DOSHQUERYDISKFREE *PDOSHQUERYDISKFREE;
204
205 APIRET XWPENTRY doshQueryDiskFSType(ULONG ulLogicalDrive, PSZ pszBuf, ULONG cbBuf);
206 typedef APIRET XWPENTRY DOSHQUERYDISKFSTYPE(ULONG ulLogicalDrive, PSZ pszBuf, ULONG cbBuf);
207 typedef DOSHQUERYDISKFSTYPE *PDOSHQUERYDISKFSTYPE;
208
209 APIRET doshQueryDiskLabel(ULONG ulLogicalDrive,
210 PSZ pszVolumeLabel);
211
212 APIRET doshSetDiskLabel(ULONG ulLogicalDrive,
213 PSZ pszNewLabel);
214
215 /* ******************************************************************
216 *
217 * Module handling helpers
218 *
219 ********************************************************************/
220
221 APIRET doshQueryProcAddr(PCSZ pcszModuleName,
222 ULONG ulOrdinal,
223 PFN *ppfn);
224
225 /*
226 *@@ RESOLVEFUNCTION:
227 * one of these structures each define
228 * a single function import to doshResolveImports.
229 *
230 *@@added V0.9.3 (2000-04-25) [umoeller]
231 */
232
233 typedef struct _RESOLVEFUNCTION
234 {
235 const char *pcszFunctionName;
236 PFN *ppFuncAddress;
237 } RESOLVEFUNCTION, *PRESOLVEFUNCTION;
238
239 typedef const struct _RESOLVEFUNCTION *PCRESOLVEFUNCTION;
240
241 APIRET doshResolveImports(PCSZ pcszModuleName,
242 HMODULE *phmod,
243 PCRESOLVEFUNCTION paResolves,
244 ULONG cResolves);
245
246 /* ******************************************************************
247 *
248 * Performance Counters (CPU Load)
249 *
250 ********************************************************************/
251
252 #define CMD_PERF_INFO 0x41
253 #define CMD_KI_ENABLE 0x60
254 #define CMD_KI_DISABLE 0x61
255 #ifndef CMD_KI_RDCNT
256 #define CMD_KI_RDCNT 0x63
257 typedef APIRET APIENTRY FNDOSPERFSYSCALL(ULONG ulCommand,
258 ULONG ulParm1,
259 ULONG ulParm2,
260 ULONG ulParm3);
261 typedef FNDOSPERFSYSCALL *PFNDOSPERFSYSCALL;
262 #endif
263
264 typedef struct _CPUUTIL
265 {
266 ULONG ulTimeLow; // low 32 bits of time stamp
267 ULONG ulTimeHigh; // high 32 bits of time stamp
268 ULONG ulIdleLow; // low 32 bits of idle time
269 ULONG ulIdleHigh; // high 32 bits of idle time
270 ULONG ulBusyLow; // low 32 bits of busy time
271 ULONG ulBusyHigh; // high 32 bits of busy time
272 ULONG ulIntrLow; // low 32 bits of interrupt time
273 ULONG ulIntrHigh; // high 32 bits of interrupt time
274 } CPUUTIL, *PCPUUTIL;
275
276 // macro to convert 8-byte (low, high) time value to double
277 #define LL2F(high, low) (4294967296.0*(high)+(low))
278
279 /*
280 *@@ DOSHPERFSYS:
281 * structure used with doshPerfOpen.
282 *
283 *@@added V0.9.7 (2000-12-02) [umoeller]
284 *@@changed V0.9.9 (2001-03-14) [umoeller]: added interrupt load
285 */
286
287 typedef struct _DOSHPERFSYS
288 {
289 // output: no. of processors on the system
290 ULONG cProcessors;
291 // output: one CPU load for each CPU
292 PLONG palLoads;
293
294 // output: one CPU interrupt load for each CPU
295 PLONG palIntrs;
296
297 // each of the following ptrs points to an array of cProcessors items
298 PCPUUTIL paCPUUtils; // CPUUTIL structures
299 double *padBusyPrev; // previous "busy" calculations
300 double *padTimePrev; // previous "time" calculations
301 double *padIntrPrev; // previous "intr" calculations
302
303 // private stuff
304 HMODULE hmod;
305 BOOL fInitialized;
306 PFNDOSPERFSYSCALL pDosPerfSysCall;
307 } DOSHPERFSYS, *PDOSHPERFSYS;
308
309 APIRET doshPerfOpen(PDOSHPERFSYS *ppPerfSys);
310
311 APIRET doshPerfGet(PDOSHPERFSYS pPerfSys);
312
313 APIRET doshPerfClose(PDOSHPERFSYS *ppPerfSys);
314
315 /* ******************************************************************
316 *
317 * File name parsing
318 *
319 ********************************************************************/
320
321 APIRET doshGetDriveSpec(PCSZ pcszFullFile,
322 PSZ pszDrive,
323 PULONG pulDriveLen,
324 PBOOL pfIsUNC);
325
326 PSZ doshGetExtension(PCSZ pcszFilename);
327
328 /* ******************************************************************
329 *
330 * File helpers
331 *
332 ********************************************************************/
333
334 BOOL doshIsFileOnFAT(const char* pcszFileName);
335
336 APIRET doshIsValidFileName(const char* pcszFile,
337 BOOL fFullyQualified);
338
339 BOOL doshMakeRealName(PSZ pszTarget, PSZ pszSource, CHAR cReplace, BOOL fIsFAT);
340
341 APIRET doshQueryFileSize(HFILE hFile,
342 PULONG pulSize);
343
344 APIRET doshQueryPathSize(PCSZ pcszFile,
345 PULONG pulSize);
346
347 APIRET doshQueryPathAttr(const char* pcszFile,
348 PULONG pulAttr);
349
350 APIRET doshSetPathAttr(const char* pcszFile,
351 ULONG ulAttr);
352
353 /* APIRET doshOpenExisting(PCSZ pcszFilename,
354 ULONG ulOpenFlags,
355 HFILE *phf);
356 */
357
358 /*
359 *@@ XFILE:
360 *
361 *@@added V0.9.16 (2001-10-19) [umoeller]
362 */
363
364 typedef struct _XFILE
365 {
366 HFILE hf;
367 ULONG hmtx; // a HMTX really
368
369 PSZ pszFilename; // as given to doshOpen
370 ULONG flOpenMode; // as given to doshOpen
371
372 ULONG cbInitial, // intial file size on open (can be 0 if new)
373 cbCurrent; // current file size (raised with each write)
374
375 PBYTE pbCache; // if != NULL, cached data from doshReadAt
376 ULONG cbCache, // size of data in cbCache
377 ulReadFrom; // file offset where pbCache was read from
378 } XFILE, *PXFILE;
379
380 #define XOPEN_READ_EXISTING 0x0001
381 #define XOPEN_READWRITE_EXISTING 0x0002
382 #define XOPEN_READWRITE_APPEND 0x0003
383 #define XOPEN_READWRITE_NEW 0x0004
384 #define XOPEN_ACCESS_MASK 0xffff
385
386 #define XOPEN_BINARY 0x10000000
387
388 APIRET doshOpen(PCSZ pcszFilename,
389 ULONG flOpenMode,
390 PULONG pcbFile,
391 PXFILE *ppFile);
392
393 #define DRFL_NOCACHE 0x0001
394 #define DRFL_FAILIFLESS 0x0002
395
396 APIRET doshReadAt(PXFILE pFile,
397 ULONG ulOffset,
398 PULONG pcb,
399 PBYTE pbData,
400 ULONG fl);
401
402 APIRET doshWrite(PXFILE pFile,
403 ULONG cb,
404 PCSZ pbData);
405
406 APIRET doshWriteAt(PXFILE pFile,
407 ULONG ulOffset,
408 ULONG cb,
409 PCSZ pbData);
410
411 APIRET doshWriteLogEntry(PXFILE pFile,
412 const char* pcszFormat,
413 ...);
414
415 APIRET doshClose(PXFILE *ppFile);
416
417 APIRET doshLoadTextFile(PCSZ pcszFile,
418 PSZ* ppszContent,
419 PULONG pcbRead);
420
421 PSZ doshCreateBackupFileName(const char* pszExisting);
422
423 APIRET doshCreateTempFileName(PSZ pszTempFileName,
424 PCSZ pcszDir,
425 PCSZ pcszPrefix,
426 PCSZ pcszExt);
427
428 APIRET doshWriteTextFile(const char* pszFile,
429 const char* pszContent,
430 PULONG pulWritten,
431 PSZ pszBackup);
432
433
434 /* ******************************************************************
435 *
436 * Directory helpers
437 *
438 ********************************************************************/
439
440 BOOL doshQueryDirExist(PCSZ pcszDir);
441
442 APIRET doshCreatePath(PCSZ pcszPath,
443 BOOL fHidden);
444
445 APIRET doshQueryCurrentDir(PSZ pszBuf);
446
447 APIRET doshSetCurrentDir(PCSZ pcszDir);
448
449 #define DOSHDELDIR_RECURSE 0x0001
450 #define DOSHDELDIR_DELETEFILES 0x0002
451
452 APIRET doshDeleteDir(PCSZ pcszDir,
453 ULONG flFlags,
454 PULONG pulDirs,
455 PULONG pulFiles);
456
457 /* ******************************************************************
458 *
459 * Process helpers
460 *
461 ********************************************************************/
462
463 ULONG XWPENTRY doshMyPID(VOID);
464 typedef ULONG XWPENTRY DOSHMYPID(VOID);
465 typedef DOSHMYPID *PDOSHMYPID;
466
467 ULONG XWPENTRY doshMyTID(VOID);
468 typedef ULONG XWPENTRY DOSHMYTID(VOID);
469 typedef DOSHMYTID *PDOSHMYTID;
470
471 APIRET doshExecVIO(PCSZ pcszExecWithArgs,
472 PLONG plExitCode);
473
474 APIRET doshQuickStartSession(PCSZ pcszPath,
475 PCSZ pcszParams,
476 BOOL fForeground,
477 USHORT usPgmCtl,
478 BOOL fWait,
479 PULONG pulSID,
480 PPID ppid,
481 PUSHORT pusReturn);
482
483 APIRET doshSearchPath(PCSZ pcszPath,
484 PCSZ pcszFile,
485 PSZ pszExecutable,
486 ULONG cbExecutable);
487
488 APIRET doshFindExecutable(PCSZ pcszCommand,
489 PSZ pszExecutable,
490 ULONG cbExecutable,
491 PCSZ *papcszExtensions,
492 ULONG cExtensions);
493
494 /********************************************************************
495 *
496 * Partition functions
497 *
498 ********************************************************************/
499
500 /*
501 *@@ LVMINFO:
502 * informational structure created by
503 * doshQueryLVMInfo.
504 *
505 *@@added V0.9.9 (2001-04-07) [umoeller]
506 */
507
508 typedef struct _LVMINFO
509 {
510 HMODULE hmodLVM;
511
512 } LVMINFO, *PLVMINFO;
513
514 /* #define DOSH_PARTITIONS_LIMIT 10
515
516 #define PAR_UNUSED 0x00 // Unused
517 #define PAR_FAT12SMALL 0x01 // DOS FAT 12-bit < 10 Mb
518 #define PAR_XENIXROOT 0x02 // XENIX root
519 #define PAR_XENIXUSER 0x03 // XENIX user
520 #define PAR_FAT16SMALL 0x04 // DOS FAT 16-bit < 32 Mb
521 #define PAR_EXTENDED 0x05 // Extended partition
522 #define PAR_FAT16BIG 0x06 // DOS FAT 16-bit > 32 Mb
523 #define PAR_HPFS 0x07 // OS/2 HPFS
524 #define PAR_AIXBOOT 0x08 // AIX bootable partition
525 #define PAR_AIXDATA 0x09 // AIX bootable partition
526 #define PAR_BOOTMANAGER 0x0A // OS/2 Boot Manager
527 #define PAR_WINDOWS95 0x0B // Windows 95 32-bit FAT
528 #define PAR_WINDOWS95LB 0x0C // Windows 95 32-bit FAT with LBA
529 #define PAR_VFAT16BIG 0x0E // LBA VFAT (same as 06h but using LBA-mode)
530 #define PAR_VFAT16EXT 0x0F // LBA VFAT (same as 05h but using LBA-mode)
531 #define PAR_OPUS 0x10 // OPUS
532 #define PAR_HID12SMALL 0x11 // OS/2 hidden DOS FAT 12-bit
533 #define PAR_COMPAQDIAG 0x12 // Compaq diagnostic
534 #define PAR_HID16SMALL 0x14 // OS/2 hidden DOS FAT 16-bit
535 #define PAR_HID16BIG 0x16 // OS/2 hidden DOS FAT 16-bit
536 #define PAR_HIDHPFS 0x17 // OS/2 hidden HPFS
537 #define PAR_WINDOWSSWP 0x18 // AST Windows Swap File
538 #define PAR_NECDOS 0x24 // NEC MS-DOS 3.x
539 #define PAR_THEOS 0x38 // THEOS
540 #define PAR_VENIX 0x40 // VENIX
541 #define PAR_RISCBOOT 0x41 // Personal RISC boot
542 #define PAR_SFS 0x42 // SFS
543 #define PAR_ONTRACK 0x50 // Ontrack
544 #define PAR_ONTRACKEXT 0x51 // Ontrack extended partition
545 #define PAR_CPM 0x52 // CP/M
546 #define PAR_UNIXSYSV 0x63 // UNIX SysV/386
547 #define PAR_NOVELL_64 0x64 // Novell
548 #define PAR_NOVELL_65 0x65 // Novell
549 #define PAR_NOVELL_67 0x67 // Novell
550 #define PAR_NOVELL_68 0x68 // Novell
551 #define PAR_NOVELL_69 0x69 // Novell
552 #define PAR_PCIX 0x75 // PCIX
553 #define PAR_MINIX 0x80 // MINIX
554 #define PAR_LINUX 0x81 // Linux
555 #define PAR_LINUXSWAP 0x82 // Linux Swap Partition
556 #define PAR_LINUXFILE 0x83 // Linux File System
557 #define PAR_FREEBSD 0xA5 // FreeBSD
558 #define PAR_BBT 0xFF // BBT
559 */
560
561 // one-byte alignment
562 #pragma pack(1)
563
564 /*
565 *@@ PAR_INFO:
566 * partition table
567 */
568
569 typedef struct _PAR_INFO
570 {
571 BYTE bBootFlag; // 0=not active, 80H = active (boot this partition
572 BYTE bBeginHead; // partition begins at this head...
573 USHORT rBeginSecCyl; // ...and this sector and cylinder (see below)
574 BYTE bFileSysCode; // file system type
575 BYTE bEndHead; // partition ends at this head...
576 USHORT bEndSecCyl; // ...and this sector and cylinder (see below)
577 ULONG lBeginAbsSec; // partition begins at this absolute sector #
578 ULONG lTotalSects; // total sectors in this partition
579 } PAR_INFO, *PPAR_INFO;
580
581 /*
582 *@@ MBR_INFO:
583 * master boot record table.
584 * This has the four primary partitions.
585 */
586
587 typedef struct _MBR_INFO // MBR
588 {
589 BYTE aBootCode[0x1BE]; // abBootCode master boot executable code
590 PAR_INFO sPrtnInfo[4]; // primary partition entries
591 USHORT wPrtnTblSig; // partition table signature (aa55H)
592 } MBR_INFO, *PMBR_INFO;
593
594 /*
595 *@@ SYS_INFO:
596 *
597 */
598
599 typedef struct _SYS_INFO
600 {
601 BYTE startable;
602 BYTE unknown[3];
603 BYTE bootable;
604 BYTE name[8];
605 BYTE reservd[3];
606 } SYS_INFO, *PSYS_INFO;
607
608 /*
609 *@@ SYE_INFO:
610 *
611 */
612
613 typedef struct _SYE_INFO
614 {
615 BYTE bootable;
616 BYTE name[8];
617 } SYE_INFO, *PSYE_INFO;
618
619 /*
620 *@@ EXT_INFO:
621 *
622 */
623
624 typedef struct _EXT_INFO
625 {
626 BYTE aBootCode[0x18A]; // abBootCode master boot executable code
627 SYE_INFO sBmNames[4]; // System Names
628 BYTE bReserved[16]; // reserved
629 PAR_INFO sPrtnInfo[4]; // partitioms entrys
630 USHORT wPrtnTblSig; // partition table signature (aa55H)
631 } EXT_INFO, *PEXT_INFO;
632
633 typedef struct _PARTITIONINFO *PPARTITIONINFO;
634
635 /*
636 *@@ PARTITIONINFO:
637 * informational structure returned
638 * by doshGetPartitionsList. One of
639 * these items is created for each
640 * bootable partition.
641 */
642
643 typedef struct _PARTITIONINFO
644 {
645 BYTE bDisk; // drive number
646 CHAR cLetter; // probable drive letter or ' ' if none
647 BYTE bFSType; // file system type
648 PCSZ pcszFSType; // file system name (as returned by
649 // doshType2FSName, can be NULL!)
650 BOOL fPrimary; // primary partition?
651 BOOL fBootable; // bootable by Boot Manager?
652 CHAR szBootName[9]; // Boot Manager name, if (fBootable)
653 ULONG ulSize; // size MBytes
654 PPARTITIONINFO pNext; // next info or NULL if last
655 } PARTITIONINFO;
656
657 UINT doshQueryDiskCount(VOID);
658
659 APIRET doshReadSector(USHORT disk,
660 void *buff,
661 USHORT head,
662 USHORT cylinder,
663 USHORT sector);
664
665 // restore original alignment
666 #pragma pack()
667
668 const char* doshType2FSName(unsigned char bFSType);
669
670 APIRET doshGetBootManager(USHORT *pusDisk,
671 USHORT *pusPart,
672 PAR_INFO *BmInfo);
673
674 typedef struct _PARTITIONSLIST
675 {
676 PLVMINFO pLVMInfo; // != NULL if LVM is installed
677
678 // partitions array
679 PPARTITIONINFO pPartitionInfo;
680 USHORT cPartitions;
681 } PARTITIONSLIST, *PPARTITIONSLIST;
682
683 APIRET doshGetPartitionsList(PPARTITIONSLIST *ppList,
684 PUSHORT pusContext);
685
686 APIRET doshFreePartitionsList(PPARTITIONSLIST ppList);
687
688 APIRET doshQueryLVMInfo(PLVMINFO *ppLVMInfo);
689
690 APIRET doshReadLVMPartitions(PLVMINFO pInfo,
691 PPARTITIONINFO *ppPartitionInfo,
692 PUSHORT pcPartitions);
693
694 VOID doshFreeLVMInfo(PLVMINFO pInfo);
695
696 /* ******************************************************************
697 *
698 * Wildcard matching
699 *
700 ********************************************************************/
701
702 BOOL doshMatch(PCSZ pcszMask,
703 PCSZ pcszName);
704
705#endif
706
707#if __cplusplus
708}
709#endif
710
Note: See TracBrowser for help on using the repository browser.