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

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

Executable updates, mostly.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 25.3 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 /*
222 *@@ RESOLVEFUNCTION:
223 * one of these structures each define
224 * a single function import to doshResolveImports.
225 *
226 *@@added V0.9.3 (2000-04-25) [umoeller]
227 */
228
229 typedef struct _RESOLVEFUNCTION
230 {
231 const char *pcszFunctionName;
232 PFN *ppFuncAddress;
233 } RESOLVEFUNCTION, *PRESOLVEFUNCTION;
234
235 APIRET doshResolveImports(PSZ pszModuleName,
236 HMODULE *phmod,
237 PRESOLVEFUNCTION paResolves,
238 ULONG cResolves);
239
240 /* ******************************************************************
241 *
242 * Performance Counters (CPU Load)
243 *
244 ********************************************************************/
245
246 #define CMD_PERF_INFO 0x41
247 #define CMD_KI_ENABLE 0x60
248 #define CMD_KI_DISABLE 0x61
249 #ifndef CMD_KI_RDCNT
250 #define CMD_KI_RDCNT 0x63
251 typedef APIRET APIENTRY FNDOSPERFSYSCALL(ULONG ulCommand,
252 ULONG ulParm1,
253 ULONG ulParm2,
254 ULONG ulParm3);
255 typedef FNDOSPERFSYSCALL *PFNDOSPERFSYSCALL;
256 #endif
257
258 typedef struct _CPUUTIL
259 {
260 ULONG ulTimeLow; // low 32 bits of time stamp
261 ULONG ulTimeHigh; // high 32 bits of time stamp
262 ULONG ulIdleLow; // low 32 bits of idle time
263 ULONG ulIdleHigh; // high 32 bits of idle time
264 ULONG ulBusyLow; // low 32 bits of busy time
265 ULONG ulBusyHigh; // high 32 bits of busy time
266 ULONG ulIntrLow; // low 32 bits of interrupt time
267 ULONG ulIntrHigh; // high 32 bits of interrupt time
268 } CPUUTIL, *PCPUUTIL;
269
270 // macro to convert 8-byte (low, high) time value to double
271 #define LL2F(high, low) (4294967296.0*(high)+(low))
272
273 /*
274 *@@ DOSHPERFSYS:
275 * structure used with doshPerfOpen.
276 *
277 *@@added V0.9.7 (2000-12-02) [umoeller]
278 *@@changed V0.9.9 (2001-03-14) [umoeller]: added interrupt load
279 */
280
281 typedef struct _DOSHPERFSYS
282 {
283 // output: no. of processors on the system
284 ULONG cProcessors;
285 // output: one CPU load for each CPU
286 PLONG palLoads;
287
288 // output: one CPU interrupt load for each CPU
289 PLONG palIntrs;
290
291 // each of the following ptrs points to an array of cProcessors items
292 PCPUUTIL paCPUUtils; // CPUUTIL structures
293 double *padBusyPrev; // previous "busy" calculations
294 double *padTimePrev; // previous "time" calculations
295 double *padIntrPrev; // previous "intr" calculations
296
297 // private stuff
298 HMODULE hmod;
299 BOOL fInitialized;
300 PFNDOSPERFSYSCALL pDosPerfSysCall;
301 } DOSHPERFSYS, *PDOSHPERFSYS;
302
303 APIRET doshPerfOpen(PDOSHPERFSYS *ppPerfSys);
304
305 APIRET doshPerfGet(PDOSHPERFSYS pPerfSys);
306
307 APIRET doshPerfClose(PDOSHPERFSYS *ppPerfSys);
308
309 /* ******************************************************************
310 *
311 * File name parsing
312 *
313 ********************************************************************/
314
315 APIRET doshGetDriveSpec(PCSZ pcszFullFile,
316 PSZ pszDrive,
317 PULONG pulDriveLen,
318 PBOOL pfIsUNC);
319
320 PSZ doshGetExtension(PCSZ pcszFilename);
321
322 /* ******************************************************************
323 *
324 * File helpers
325 *
326 ********************************************************************/
327
328 BOOL doshIsFileOnFAT(const char* pcszFileName);
329
330 APIRET doshIsValidFileName(const char* pcszFile,
331 BOOL fFullyQualified);
332
333 BOOL doshMakeRealName(PSZ pszTarget, PSZ pszSource, CHAR cReplace, BOOL fIsFAT);
334
335 APIRET doshQueryFileSize(HFILE hFile,
336 PULONG pulSize);
337
338 APIRET doshQueryPathSize(PCSZ pcszFile,
339 PULONG pulSize);
340
341 APIRET doshQueryPathAttr(const char* pcszFile,
342 PULONG pulAttr);
343
344 APIRET doshSetPathAttr(const char* pcszFile,
345 ULONG ulAttr);
346
347 /* APIRET doshOpenExisting(PCSZ pcszFilename,
348 ULONG ulOpenFlags,
349 HFILE *phf);
350 */
351
352 /*
353 *@@ XFILE:
354 *
355 *@@added V0.9.16 (2001-10-19) [umoeller]
356 */
357
358 typedef struct _XFILE
359 {
360 HFILE hf;
361 ULONG hmtx; // a HMTX really
362
363 PSZ pszFilename; // as given to doshOpen
364 ULONG flOpenMode; // as given to doshOpen
365
366 ULONG cbInitial, // intial file size on open (can be 0 if new)
367 cbCurrent; // current file size (raised with each write)
368
369 PBYTE pbCache; // if != NULL, cached data from doshReadAt
370 ULONG cbCache, // size of data in cbCache
371 ulReadFrom; // file offset where pbCache was read from
372 } XFILE, *PXFILE;
373
374 #define XOPEN_READ_EXISTING 0x0001
375 #define XOPEN_READWRITE_EXISTING 0x0002
376 #define XOPEN_READWRITE_APPEND 0x0003
377 #define XOPEN_READWRITE_NEW 0x0004
378 #define XOPEN_ACCESS_MASK 0xffff
379
380 #define XOPEN_BINARY 0x10000000
381
382 APIRET doshOpen(PCSZ pcszFilename,
383 ULONG flOpenMode,
384 PULONG pcbFile,
385 PXFILE *ppFile);
386
387 APIRET doshReadAt(PXFILE pFile,
388 ULONG ulOffset,
389 PULONG pcb,
390 PBYTE pbData);
391
392 APIRET doshWrite(PXFILE pFile,
393 ULONG cb,
394 PCSZ pbData);
395
396 APIRET doshWriteAt(PXFILE pFile,
397 ULONG ulOffset,
398 ULONG cb,
399 PCSZ pbData);
400
401 APIRET doshWriteLogEntry(PXFILE pFile,
402 const char* pcszFormat,
403 ...);
404
405 APIRET doshClose(PXFILE *ppFile);
406
407 APIRET doshLoadTextFile(PCSZ pcszFile,
408 PSZ* ppszContent,
409 PULONG pcbRead);
410
411 PSZ doshCreateBackupFileName(const char* pszExisting);
412
413 APIRET doshCreateTempFileName(PSZ pszTempFileName,
414 PCSZ pcszDir,
415 PCSZ pcszPrefix,
416 PCSZ pcszExt);
417
418 APIRET doshWriteTextFile(const char* pszFile,
419 const char* pszContent,
420 PULONG pulWritten,
421 PSZ pszBackup);
422
423
424 /* ******************************************************************
425 *
426 * Directory helpers
427 *
428 ********************************************************************/
429
430 BOOL doshQueryDirExist(PCSZ pcszDir);
431
432 APIRET doshCreatePath(PCSZ pcszPath,
433 BOOL fHidden);
434
435 APIRET doshQueryCurrentDir(PSZ pszBuf);
436
437 APIRET doshSetCurrentDir(PCSZ pcszDir);
438
439 #define DOSHDELDIR_RECURSE 0x0001
440 #define DOSHDELDIR_DELETEFILES 0x0002
441
442 APIRET doshDeleteDir(PCSZ pcszDir,
443 ULONG flFlags,
444 PULONG pulDirs,
445 PULONG pulFiles);
446
447 /* ******************************************************************
448 *
449 * Process helpers
450 *
451 ********************************************************************/
452
453 ULONG XWPENTRY doshMyPID(VOID);
454 typedef ULONG XWPENTRY DOSHMYPID(VOID);
455 typedef DOSHMYPID *PDOSHMYPID;
456
457 ULONG XWPENTRY doshMyTID(VOID);
458 typedef ULONG XWPENTRY DOSHMYTID(VOID);
459 typedef DOSHMYTID *PDOSHMYTID;
460
461 APIRET doshExecVIO(PCSZ pcszExecWithArgs,
462 PLONG plExitCode);
463
464 APIRET doshQuickStartSession(PCSZ pcszPath,
465 PCSZ pcszParams,
466 BOOL fForeground,
467 USHORT usPgmCtl,
468 BOOL fWait,
469 PULONG pulSID,
470 PPID ppid,
471 PUSHORT pusReturn);
472
473 APIRET doshSearchPath(PCSZ pcszPath,
474 PCSZ pcszFile,
475 PSZ pszExecutable,
476 ULONG cbExecutable);
477
478 APIRET doshFindExecutable(PCSZ pcszCommand,
479 PSZ pszExecutable,
480 ULONG cbExecutable,
481 PCSZ *papcszExtensions,
482 ULONG cExtensions);
483
484 /********************************************************************
485 *
486 * Partition functions
487 *
488 ********************************************************************/
489
490 /*
491 *@@ LVMINFO:
492 * informational structure created by
493 * doshQueryLVMInfo.
494 *
495 *@@added V0.9.9 (2001-04-07) [umoeller]
496 */
497
498 typedef struct _LVMINFO
499 {
500 HMODULE hmodLVM;
501
502 } LVMINFO, *PLVMINFO;
503
504 /* #define DOSH_PARTITIONS_LIMIT 10
505
506 #define PAR_UNUSED 0x00 // Unused
507 #define PAR_FAT12SMALL 0x01 // DOS FAT 12-bit < 10 Mb
508 #define PAR_XENIXROOT 0x02 // XENIX root
509 #define PAR_XENIXUSER 0x03 // XENIX user
510 #define PAR_FAT16SMALL 0x04 // DOS FAT 16-bit < 32 Mb
511 #define PAR_EXTENDED 0x05 // Extended partition
512 #define PAR_FAT16BIG 0x06 // DOS FAT 16-bit > 32 Mb
513 #define PAR_HPFS 0x07 // OS/2 HPFS
514 #define PAR_AIXBOOT 0x08 // AIX bootable partition
515 #define PAR_AIXDATA 0x09 // AIX bootable partition
516 #define PAR_BOOTMANAGER 0x0A // OS/2 Boot Manager
517 #define PAR_WINDOWS95 0x0B // Windows 95 32-bit FAT
518 #define PAR_WINDOWS95LB 0x0C // Windows 95 32-bit FAT with LBA
519 #define PAR_VFAT16BIG 0x0E // LBA VFAT (same as 06h but using LBA-mode)
520 #define PAR_VFAT16EXT 0x0F // LBA VFAT (same as 05h but using LBA-mode)
521 #define PAR_OPUS 0x10 // OPUS
522 #define PAR_HID12SMALL 0x11 // OS/2 hidden DOS FAT 12-bit
523 #define PAR_COMPAQDIAG 0x12 // Compaq diagnostic
524 #define PAR_HID16SMALL 0x14 // OS/2 hidden DOS FAT 16-bit
525 #define PAR_HID16BIG 0x16 // OS/2 hidden DOS FAT 16-bit
526 #define PAR_HIDHPFS 0x17 // OS/2 hidden HPFS
527 #define PAR_WINDOWSSWP 0x18 // AST Windows Swap File
528 #define PAR_NECDOS 0x24 // NEC MS-DOS 3.x
529 #define PAR_THEOS 0x38 // THEOS
530 #define PAR_VENIX 0x40 // VENIX
531 #define PAR_RISCBOOT 0x41 // Personal RISC boot
532 #define PAR_SFS 0x42 // SFS
533 #define PAR_ONTRACK 0x50 // Ontrack
534 #define PAR_ONTRACKEXT 0x51 // Ontrack extended partition
535 #define PAR_CPM 0x52 // CP/M
536 #define PAR_UNIXSYSV 0x63 // UNIX SysV/386
537 #define PAR_NOVELL_64 0x64 // Novell
538 #define PAR_NOVELL_65 0x65 // Novell
539 #define PAR_NOVELL_67 0x67 // Novell
540 #define PAR_NOVELL_68 0x68 // Novell
541 #define PAR_NOVELL_69 0x69 // Novell
542 #define PAR_PCIX 0x75 // PCIX
543 #define PAR_MINIX 0x80 // MINIX
544 #define PAR_LINUX 0x81 // Linux
545 #define PAR_LINUXSWAP 0x82 // Linux Swap Partition
546 #define PAR_LINUXFILE 0x83 // Linux File System
547 #define PAR_FREEBSD 0xA5 // FreeBSD
548 #define PAR_BBT 0xFF // BBT
549 */
550
551 // one-byte alignment
552 #pragma pack(1)
553
554 /*
555 *@@ PAR_INFO:
556 * partition table
557 */
558
559 typedef struct _PAR_INFO
560 {
561 BYTE bBootFlag; // 0=not active, 80H = active (boot this partition
562 BYTE bBeginHead; // partition begins at this head...
563 USHORT rBeginSecCyl; // ...and this sector and cylinder (see below)
564 BYTE bFileSysCode; // file system type
565 BYTE bEndHead; // partition ends at this head...
566 USHORT bEndSecCyl; // ...and this sector and cylinder (see below)
567 ULONG lBeginAbsSec; // partition begins at this absolute sector #
568 ULONG lTotalSects; // total sectors in this partition
569 } PAR_INFO, *PPAR_INFO;
570
571 /*
572 *@@ MBR_INFO:
573 * master boot record table.
574 * This has the four primary partitions.
575 */
576
577 typedef struct _MBR_INFO // MBR
578 {
579 BYTE aBootCode[0x1BE]; // abBootCode master boot executable code
580 PAR_INFO sPrtnInfo[4]; // primary partition entries
581 USHORT wPrtnTblSig; // partition table signature (aa55H)
582 } MBR_INFO, *PMBR_INFO;
583
584 /*
585 *@@ SYS_INFO:
586 *
587 */
588
589 typedef struct _SYS_INFO
590 {
591 BYTE startable;
592 BYTE unknown[3];
593 BYTE bootable;
594 BYTE name[8];
595 BYTE reservd[3];
596 } SYS_INFO, *PSYS_INFO;
597
598 /*
599 *@@ SYE_INFO:
600 *
601 */
602
603 typedef struct _SYE_INFO
604 {
605 BYTE bootable;
606 BYTE name[8];
607 } SYE_INFO, *PSYE_INFO;
608
609 /*
610 *@@ EXT_INFO:
611 *
612 */
613
614 typedef struct _EXT_INFO
615 {
616 BYTE aBootCode[0x18A]; // abBootCode master boot executable code
617 SYE_INFO sBmNames[4]; // System Names
618 BYTE bReserved[16]; // reserved
619 PAR_INFO sPrtnInfo[4]; // partitioms entrys
620 USHORT wPrtnTblSig; // partition table signature (aa55H)
621 } EXT_INFO, *PEXT_INFO;
622
623 typedef struct _PARTITIONINFO *PPARTITIONINFO;
624
625 /*
626 *@@ PARTITIONINFO:
627 * informational structure returned
628 * by doshGetPartitionsList. One of
629 * these items is created for each
630 * bootable partition.
631 */
632
633 typedef struct _PARTITIONINFO
634 {
635 BYTE bDisk; // drive number
636 CHAR cLetter; // probable drive letter or ' ' if none
637 BYTE bFSType; // file system type
638 PCSZ pcszFSType; // file system name (as returned by
639 // doshType2FSName, can be NULL!)
640 BOOL fPrimary; // primary partition?
641 BOOL fBootable; // bootable by Boot Manager?
642 CHAR szBootName[9]; // Boot Manager name, if (fBootable)
643 ULONG ulSize; // size MBytes
644 PPARTITIONINFO pNext; // next info or NULL if last
645 } PARTITIONINFO;
646
647 UINT doshQueryDiskCount(VOID);
648
649 APIRET doshReadSector(USHORT disk,
650 void *buff,
651 USHORT head,
652 USHORT cylinder,
653 USHORT sector);
654
655 // restore original alignment
656 #pragma pack()
657
658 const char* doshType2FSName(unsigned char bFSType);
659
660 APIRET doshGetBootManager(USHORT *pusDisk,
661 USHORT *pusPart,
662 PAR_INFO *BmInfo);
663
664 typedef struct _PARTITIONSLIST
665 {
666 PLVMINFO pLVMInfo; // != NULL if LVM is installed
667
668 // partitions array
669 PPARTITIONINFO pPartitionInfo;
670 USHORT cPartitions;
671 } PARTITIONSLIST, *PPARTITIONSLIST;
672
673 APIRET doshGetPartitionsList(PPARTITIONSLIST *ppList,
674 PUSHORT pusContext);
675
676 APIRET doshFreePartitionsList(PPARTITIONSLIST ppList);
677
678 APIRET doshQueryLVMInfo(PLVMINFO *ppLVMInfo);
679
680 APIRET doshReadLVMPartitions(PLVMINFO pInfo,
681 PPARTITIONINFO *ppPartitionInfo,
682 PUSHORT pcPartitions);
683
684 VOID doshFreeLVMInfo(PLVMINFO pInfo);
685
686 /* ******************************************************************
687 *
688 * Wildcard matching
689 *
690 ********************************************************************/
691
692 BOOL doshMatch(const char *pcszMask,
693 const char *pcszName);
694
695#endif
696
697#if __cplusplus
698}
699#endif
700
Note: See TracBrowser for help on using the repository browser.