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