[1] | 1 | /*DDK*************************************************************************/
|
---|
| 2 | /* */
|
---|
| 3 | /* COPYRIGHT Copyright (C) 1991, 2003 IBM Corporation */
|
---|
| 4 | /* */
|
---|
| 5 | /* The following IBM OS/2 source code is provided to you solely for */
|
---|
| 6 | /* the purpose of assisting you in your development of OS/2 device */
|
---|
| 7 | /* drivers. You may use this code in accordance with the IBM License */
|
---|
| 8 | /* Agreement provided in the IBM Developer Connection Device Driver */
|
---|
| 9 | /* Source Kit for OS/2. This Copyright statement may not be removed. */
|
---|
| 10 | /* */
|
---|
| 11 | /*****************************************************************************/
|
---|
| 12 | /**************************************************************************
|
---|
| 13 | *
|
---|
| 14 | * SOURCE FILE NAME = package.h
|
---|
| 15 | *
|
---|
| 16 | * DESCRIPTIVE NAME = package format definitions
|
---|
| 17 | *
|
---|
| 18 | *
|
---|
| 19 | * VERSION = V2.0
|
---|
| 20 | *
|
---|
| 21 | * DATE
|
---|
| 22 | *
|
---|
| 23 | * DESCRIPTION : declarations of PAK structures, manipulation functions
|
---|
| 24 | *
|
---|
| 25 | * FUNCTIONS
|
---|
| 26 | *
|
---|
| 27 | * NOTES
|
---|
| 28 | *
|
---|
| 29 | * STRUCTURES
|
---|
| 30 | *
|
---|
| 31 | * EXTERNAL REFERENCES
|
---|
| 32 | *
|
---|
| 33 | * EXTERNAL FUNCTIONS
|
---|
| 34 | *
|
---|
| 35 | */
|
---|
| 36 | #pragma pack(1)
|
---|
| 37 | #ifndef package_h_
|
---|
| 38 | #define package_h_
|
---|
| 39 |
|
---|
| 40 | //
|
---|
| 41 | // IMPORTANT!
|
---|
| 42 | // Do not modify existing package formats.
|
---|
| 43 | // Only add new, only if you really really need to.
|
---|
| 44 | //
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | //
|
---|
| 49 | // PAK file Header structure . This structure contains PPB file identifier
|
---|
| 50 | // Table size and number of entries in the PPB file .
|
---|
| 51 | //
|
---|
| 52 |
|
---|
| 53 | typedef struct _PAKSIGNATURE
|
---|
| 54 | {
|
---|
| 55 | CHAR szName[40];
|
---|
| 56 | ULONG ulCRC; // not used in V1. should check integrity of entry directory, at least.
|
---|
| 57 | SHORT iTblSize;
|
---|
| 58 | SHORT iEntries;
|
---|
| 59 | CHAR free[4];
|
---|
| 60 | } PAKSIGNATURE, *PPAKSIGNATURE;
|
---|
| 61 |
|
---|
| 62 | //
|
---|
| 63 | // Various signatures we that are out there
|
---|
| 64 | //
|
---|
| 65 |
|
---|
| 66 | #define PAKSIGNATURE_DEVPACK_V1 "IBM DDPAK V1.0"
|
---|
| 67 | #define PAKSIGNATURE_FONTPACK_V1 "IBM FONTS V1.0"
|
---|
| 68 |
|
---|
| 69 | //
|
---|
| 70 | // These are names of packages that driver recognizes
|
---|
| 71 | // Must be consistent with makefile and PIN hardwired values
|
---|
| 72 | //
|
---|
| 73 | #define PAKNAME_IBMDEV_PACK "printer1.pak"
|
---|
| 74 | #define PAKNAME_AUXDEV_PACK "auxprint.pak"
|
---|
| 75 |
|
---|
| 76 | #define PAKNAME_IBMFONT_PACK "font1.pak"
|
---|
| 77 | #define PAKNAME_AUXFONT_PACK "auxfont.pak"
|
---|
| 78 |
|
---|
| 79 | //
|
---|
| 80 | // Various directory entry types (indicated by PAKSIGNATURE)
|
---|
| 81 | //
|
---|
| 82 |
|
---|
| 83 | // printer device package
|
---|
| 84 | typedef struct _PAK_DEV_DIRENTRY
|
---|
| 85 | {
|
---|
| 86 | CHAR szDeviceName[40];
|
---|
| 87 | ULONG ulOffset;
|
---|
| 88 | ULONG ulSize;
|
---|
| 89 | ULONG ulFlags;
|
---|
| 90 | CHAR free[4];
|
---|
| 91 | } PAK_DEV_DIRENTRY, *PPAK_DEV_DIRENTRY;
|
---|
| 92 |
|
---|
| 93 |
|
---|
| 94 | // device font package
|
---|
| 95 | typedef struct _PAK_FONT_DIRENTRY
|
---|
| 96 | {
|
---|
| 97 | CHAR szFontName[40];
|
---|
| 98 | CHAR szFontFullName[40];
|
---|
| 99 | ULONG ulOffset;
|
---|
| 100 | ULONG ulSize;
|
---|
| 101 | ULONG ulFlags;
|
---|
| 102 | CHAR free[4];
|
---|
| 103 | } PAK_FONT_DIRENTRY, *PPAK_FONT_DIRENTRY;
|
---|
| 104 |
|
---|
| 105 |
|
---|
| 106 | //
|
---|
| 107 | // Functions
|
---|
| 108 | //
|
---|
| 109 | PBYTE LoadPakDirectory( PVOID pHeap, PSZ pszPakFile, PSZ pszExpectedSignature, ULONG ulSegmentSize );
|
---|
| 110 |
|
---|
| 111 | PPAK_FONT_DIRENTRY GetFontDirEntry( PSZ pszFontName, PBYTE pDirectoryMem );
|
---|
| 112 | PPAK_FONT_DIRENTRY GetFontDirEntryByFullName( PSZ pszFontFullName, PBYTE pDirectoryMem );
|
---|
| 113 | PPAK_DEV_DIRENTRY GetDeviceDirEntry( PSZ pszDeviceName, PBYTE pDirectoryMem);
|
---|
| 114 |
|
---|
| 115 | PBYTE LoadPakDeviceSegment ( PVOID pHeap, PSZ pszPakFile, PBYTE pDirectoryMem, PSZ pszDeviceName);
|
---|
| 116 | PBYTE LoadPakFontSegment ( PVOID pHeap, PSZ pszPakFile, PBYTE pDirectoryMem, PSZ pszFontName);
|
---|
| 117 |
|
---|
| 118 |
|
---|
| 119 | #endif
|
---|