| 1 | /* $Id: pidl.h,v 1.6 2000-08-30 13:50:55 sandervl Exp $ */ | 
|---|
| 2 | /* | 
|---|
| 3 | * internal pidl functions | 
|---|
| 4 | * 1998 <juergen.schmied@metronet.de> | 
|---|
| 5 | * | 
|---|
| 6 | * DO NOT use this definitions outside the shell32.dll ! | 
|---|
| 7 | * | 
|---|
| 8 | * The contents of a pidl should never used from a application | 
|---|
| 9 | * directly. | 
|---|
| 10 | * | 
|---|
| 11 | * Undocumented: | 
|---|
| 12 | * MS says: the abID of SHITEMID should be treated as binary data and not | 
|---|
| 13 | * be interpreted by applications. Applies to everyone but MS itself. | 
|---|
| 14 | * Word95 interprets the contents of abID (Filesize/Date) so we have to go | 
|---|
| 15 | * for binary compatibility here. | 
|---|
| 16 | */ | 
|---|
| 17 |  | 
|---|
| 18 | #ifndef __WINE_PIDL_H | 
|---|
| 19 | #define __WINE_PIDL_H | 
|---|
| 20 |  | 
|---|
| 21 | #include "shlobj.h" | 
|---|
| 22 |  | 
|---|
| 23 | /* | 
|---|
| 24 | * the pidl does cache fileattributes to speed up SHGetAttributes when | 
|---|
| 25 | * displaying a big number of files. | 
|---|
| 26 | * | 
|---|
| 27 | * a pidl of NULL means the desktop | 
|---|
| 28 | * | 
|---|
| 29 | * The structure of the pidl seems to be a union. The first byte of the | 
|---|
| 30 | * PIDLDATA desribes the type of pidl. | 
|---|
| 31 | * | 
|---|
| 32 | *       object        ! first byte /  ! format       ! living space | 
|---|
| 33 | *                     ! size | 
|---|
| 34 | *       ---------------------------------------------------------------- | 
|---|
| 35 | *       my computer     0x1F/20         mycomp (2)      (usual) | 
|---|
| 36 | *       network         0x1F            mycomp | 
|---|
| 37 | *       bitbucket       0x1F            mycomp | 
|---|
| 38 | *       drive           0x23/25         drive           (usual) | 
|---|
| 39 | *       drive           0x25/25         drive           (lnk/persistant) | 
|---|
| 40 | *       drive           0x29/25         drive | 
|---|
| 41 | *       shell extension 0x2E            mycomp | 
|---|
| 42 | *       drive           0x2F            drive           (lnk/persistant) | 
|---|
| 43 | *       folder/file     0x30            folder/file (1) (lnk/persistant) | 
|---|
| 44 | *       folder          0x31            folder          (usual) | 
|---|
| 45 | *       value           0x32            file            (usual) | 
|---|
| 46 | *       workgroup       0x41            network (3) | 
|---|
| 47 | *       computer        0x42            network (4) | 
|---|
| 48 | *       whole network   0x47            network (5) | 
|---|
| 49 | *       MSITStore       0x61            htmlhlp (7) | 
|---|
| 50 | *       history/favorites 0xb1          file | 
|---|
| 51 | *       share           0xc3            network (6) | 
|---|
| 52 | * | 
|---|
| 53 | * guess: the persistant elements are non tracking | 
|---|
| 54 | * | 
|---|
| 55 | * (1) dummy byte is used, attributes are empty | 
|---|
| 56 | * (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D | 
|---|
| 57 | * (3) two strings       "workgroup" "microsoft network" | 
|---|
| 58 | * (4) one string        "\\sirius" | 
|---|
| 59 | * (5) one string        "whole network" | 
|---|
| 60 | * (6) one string        "\\sirius\c" | 
|---|
| 61 | * (7) contains string   "mk:@MSITStore:C:\path\file.chm::/path/filename.htm" | 
|---|
| 62 | *               GUID    871C5380-42A0-1069-A2EA-08002B30309D | 
|---|
| 63 | */ | 
|---|
| 64 |  | 
|---|
| 65 | #define PT_DESKTOP      0x00 /* internal */ | 
|---|
| 66 | #define PT_MYCOMP       0x1F | 
|---|
| 67 | #define PT_DRIVE        0x23 | 
|---|
| 68 | #define PT_DRIVE2       0x25 | 
|---|
| 69 | #define PT_DRIVE3       0x29 | 
|---|
| 70 | #define PT_SPECIAL      0x2E | 
|---|
| 71 | #define PT_DRIVE1       0x2F | 
|---|
| 72 | #define PT_FOLDER1      0x30 | 
|---|
| 73 | #define PT_FOLDER       0x31 | 
|---|
| 74 | #define PT_VALUE        0x32 | 
|---|
| 75 | #define PT_WORKGRP      0x41 | 
|---|
| 76 | #define PT_COMP         0x42 | 
|---|
| 77 | #define PT_NETWORK      0x47 | 
|---|
| 78 | #define PT_IESPECIAL    0xb1 | 
|---|
| 79 | #define PT_SHARE        0xc3 | 
|---|
| 80 |  | 
|---|
| 81 | #include "pshpack1.h" | 
|---|
| 82 | typedef BYTE PIDLTYPE; | 
|---|
| 83 |  | 
|---|
| 84 | typedef struct tagPIDLDATA | 
|---|
| 85 | {       PIDLTYPE type;                  /*00*/ | 
|---|
| 86 | union | 
|---|
| 87 | { struct | 
|---|
| 88 | { BYTE dummy;                 /*01*/ | 
|---|
| 89 | GUID guid;                  /*02*/ | 
|---|
| 90 | BYTE dummy1;                /*18*/ | 
|---|
| 91 | } mycomp; | 
|---|
| 92 | struct | 
|---|
| 93 | { CHAR szDriveName[20];       /*01*/ | 
|---|
| 94 | DWORD dwUnknown;            /*21*/ | 
|---|
| 95 | /* the drive seems to be 25 bytes every time */ | 
|---|
| 96 | } drive; | 
|---|
| 97 | struct | 
|---|
| 98 | { BYTE dummy;                 /*01 is 0x00 for files or dirs */ | 
|---|
| 99 | DWORD dwFileSize;           /*02*/ | 
|---|
| 100 | WORD uFileDate;             /*06*/ | 
|---|
| 101 | WORD uFileTime;             /*08*/ | 
|---|
| 102 | WORD uFileAttribs;          /*10*/ | 
|---|
| 103 | CHAR szNames[1];            /*12*/ | 
|---|
| 104 | /* Here are comming two strings. The first is the long name. | 
|---|
| 105 | The second the dos name when needed or just 0x00 */ | 
|---|
| 106 | } file, folder, generic; | 
|---|
| 107 | struct | 
|---|
| 108 | { WORD dummy;         /*01*/ | 
|---|
| 109 | CHAR szNames[1];    /*03*/ | 
|---|
| 110 | } network; | 
|---|
| 111 | struct | 
|---|
| 112 | { WORD dummy;         /*01*/ | 
|---|
| 113 | DWORD dummy1;       /*02*/ | 
|---|
| 114 | CHAR szName[1];     /*06*/ /* teminated by 0x00 0x00 */ | 
|---|
| 115 | } htmlhelp; | 
|---|
| 116 | }u; | 
|---|
| 117 | } PIDLDATA, *LPPIDLDATA; | 
|---|
| 118 | #include "poppack.h" | 
|---|
| 119 |  | 
|---|
| 120 | /* | 
|---|
| 121 | * getting special values from simple pidls | 
|---|
| 122 | */ | 
|---|
| 123 | DWORD   _ILSimpleGetText        (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); | 
|---|
| 124 | BOOL    _ILGetFileDate          (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); | 
|---|
| 125 | DWORD   _ILGetFileSize          (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); | 
|---|
| 126 | BOOL    _ILGetExtension         (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); | 
|---|
| 127 | void    _ILGetFileType          (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); | 
|---|
| 128 | DWORD   _ILGetFileAttributes    (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); | 
|---|
| 129 |  | 
|---|
| 130 | BOOL    _ILGetFileDateTime      (LPCITEMIDLIST pidl, FILETIME *ft); | 
|---|
| 131 | DWORD   _ILGetDrive             (LPCITEMIDLIST, LPSTR, UINT16); | 
|---|
| 132 |  | 
|---|
| 133 | /* | 
|---|
| 134 | * testing simple pidls | 
|---|
| 135 | */ | 
|---|
| 136 | BOOL    _ILIsDesktop            (LPCITEMIDLIST pidl); | 
|---|
| 137 | BOOL    _ILIsMyComputer         (LPCITEMIDLIST pidl); | 
|---|
| 138 | BOOL    _ILIsDrive              (LPCITEMIDLIST pidl); | 
|---|
| 139 | BOOL    _ILIsFolder             (LPCITEMIDLIST pidl); | 
|---|
| 140 | BOOL    _ILIsValue              (LPCITEMIDLIST pidl); | 
|---|
| 141 | BOOL    _ILIsSpecialFolder      (LPCITEMIDLIST pidl); | 
|---|
| 142 | BOOL    _ILIsPidlSimple         (LPCITEMIDLIST pidl); | 
|---|
| 143 |  | 
|---|
| 144 | /* | 
|---|
| 145 | * simple pidls from strings | 
|---|
| 146 | */ | 
|---|
| 147 | LPITEMIDLIST    _ILCreate       (PIDLTYPE,LPCVOID,UINT16); | 
|---|
| 148 |  | 
|---|
| 149 | LPITEMIDLIST    _ILCreateDesktop        (void); | 
|---|
| 150 | LPITEMIDLIST    _ILCreateMyComputer     (void); | 
|---|
| 151 | LPITEMIDLIST    _ILCreateIExplore       (void); | 
|---|
| 152 | LPITEMIDLIST    _ILCreateControl        (void); | 
|---|
| 153 | LPITEMIDLIST    _ILCreatePrinter        (void); | 
|---|
| 154 | LPITEMIDLIST    _ILCreateNetwork        (void); | 
|---|
| 155 | LPITEMIDLIST    _ILCreateBitBucket      (void); | 
|---|
| 156 | LPITEMIDLIST    _ILCreateDrive          (LPCSTR); | 
|---|
| 157 | LPITEMIDLIST    _ILCreateFolder         (WIN32_FIND_DATAA * stffile); | 
|---|
| 158 | LPITEMIDLIST    _ILCreateValue          (WIN32_FIND_DATAA * stffile); | 
|---|
| 159 | LPITEMIDLIST    _ILCreateSpecial        (LPCSTR szGUID); | 
|---|
| 160 |  | 
|---|
| 161 | /* | 
|---|
| 162 | * helper functions (getting struct-pointer) | 
|---|
| 163 | */ | 
|---|
| 164 | LPPIDLDATA      _ILGetDataPointer       (LPCITEMIDLIST); | 
|---|
| 165 | LPSTR           _ILGetTextPointer       (LPCITEMIDLIST); | 
|---|
| 166 | LPSTR           _ILGetSTextPointer      (LPCITEMIDLIST); | 
|---|
| 167 | REFIID          _ILGetGUIDPointer       (LPCITEMIDLIST pidl); | 
|---|
| 168 |  | 
|---|
| 169 | /* | 
|---|
| 170 | * debug helper | 
|---|
| 171 | */ | 
|---|
| 172 | #ifdef __WIN32OS2__ | 
|---|
| 173 | #ifdef DEBUG | 
|---|
| 174 | void pdump (LPCITEMIDLIST pidl); | 
|---|
| 175 | #else | 
|---|
| 176 | #define pdump(pidl) | 
|---|
| 177 | #endif | 
|---|
| 178 | //CB: needed in release build | 
|---|
| 179 | BOOL pcheck (LPCITEMIDLIST pidl); | 
|---|
| 180 | #else | 
|---|
| 181 | void    pdump   (LPCITEMIDLIST pidl); | 
|---|
| 182 | BOOL    pcheck  (LPCITEMIDLIST pidl); | 
|---|
| 183 | #endif | 
|---|
| 184 |  | 
|---|
| 185 | /* | 
|---|
| 186 | * aPidl helper | 
|---|
| 187 | */ | 
|---|
| 188 | void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl); | 
|---|
| 189 | LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl); | 
|---|
| 190 | LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPCIDA cida); | 
|---|
| 191 |  | 
|---|
| 192 | #endif | 
|---|