source: trunk/src/shell32/pidl.h

Last change on this file was 7031, checked in by phaller, 24 years ago

performance improvement on ILSimpleGetText used for comparison

File size: 5.4 KB
RevLine 
[1214]1/*
2 * internal pidl functions
3 * 1998 <juergen.schmied@metronet.de>
4 *
5 * DO NOT use this definitions outside the shell32.dll !
6 *
7 * The contents of a pidl should never used from a application
[4121]8 * directly.
[1214]9 *
[4121]10 * Undocumented:
11 * MS says: the abID of SHITEMID should be treated as binary data and not
12 * be interpreted by applications. Applies to everyone but MS itself.
13 * Word95 interprets the contents of abID (Filesize/Date) so we have to go
14 * for binary compatibility here.
[1214]15 */
[4121]16
[1214]17#ifndef __WINE_PIDL_H
18#define __WINE_PIDL_H
19
20#include "shlobj.h"
21
[4121]22/*
[1214]23* the pidl does cache fileattributes to speed up SHGetAttributes when
24* displaying a big number of files.
25*
26* a pidl of NULL means the desktop
27*
28* The structure of the pidl seems to be a union. The first byte of the
29* PIDLDATA desribes the type of pidl.
30*
[4121]31* object ! first byte / ! format ! living space
32* ! size
33* ----------------------------------------------------------------
34* my computer 0x1F/20 mycomp (2) (usual)
35* network 0x1F mycomp
36* bitbucket 0x1F mycomp
37* drive 0x23/25 drive (usual)
38* drive 0x25/25 drive (lnk/persistant)
39* drive 0x29/25 drive
40* shell extension 0x2E mycomp
41* drive 0x2F drive (lnk/persistant)
42* folder/file 0x30 folder/file (1) (lnk/persistant)
43* folder 0x31 folder (usual)
44* value 0x32 file (usual)
45* workgroup 0x41 network (3)
46* computer 0x42 network (4)
47* whole network 0x47 network (5)
48* MSITStore 0x61 htmlhlp (7)
49* history/favorites 0xb1 file
50* share 0xc3 network (6)
[1214]51*
52* guess: the persistant elements are non tracking
53*
54* (1) dummy byte is used, attributes are empty
55* (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
[4121]56* (3) two strings "workgroup" "microsoft network"
57* (4) one string "\\sirius"
58* (5) one string "whole network"
59* (6) one string "\\sirius\c"
[1214]60* (7) contains string "mk:@MSITStore:C:\path\file.chm::/path/filename.htm"
[4121]61* GUID 871C5380-42A0-1069-A2EA-08002B30309D
[1214]62*/
63
[4121]64#define PT_DESKTOP 0x00 /* internal */
65#define PT_MYCOMP 0x1F
66#define PT_DRIVE 0x23
67#define PT_DRIVE2 0x25
68#define PT_DRIVE3 0x29
69#define PT_SPECIAL 0x2E
70#define PT_DRIVE1 0x2F
71#define PT_FOLDER1 0x30
72#define PT_FOLDER 0x31
73#define PT_VALUE 0x32
74#define PT_WORKGRP 0x41
75#define PT_COMP 0x42
76#define PT_NETWORK 0x47
[5618]77#define PT_IESPECIAL1 0x61
78#define PT_IESPECIAL2 0xb1
[4121]79#define PT_SHARE 0xc3
[1214]80
81#include "pshpack1.h"
82typedef BYTE PIDLTYPE;
83
84typedef struct tagPIDLDATA
[4121]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;
[1214]117} PIDLDATA, *LPPIDLDATA;
118#include "poppack.h"
119
120/*
121 * getting special values from simple pidls
122 */
[4121]123DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
[7031]124int _ILSimpleCompareText (LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
[4121]125BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
126DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
127BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
128void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
129DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
[1214]130
[4121]131BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft);
[5618]132DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT);
[1214]133
134/*
135 * testing simple pidls
136 */
[4121]137BOOL _ILIsDesktop (LPCITEMIDLIST pidl);
138BOOL _ILIsMyComputer (LPCITEMIDLIST pidl);
139BOOL _ILIsDrive (LPCITEMIDLIST pidl);
140BOOL _ILIsFolder (LPCITEMIDLIST pidl);
141BOOL _ILIsValue (LPCITEMIDLIST pidl);
142BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl);
143BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl);
[1214]144
145/*
146 * simple pidls from strings
147 */
[5618]148LPITEMIDLIST _ILCreate (PIDLTYPE,LPCVOID,UINT);
[1214]149
[4121]150LPITEMIDLIST _ILCreateDesktop (void);
151LPITEMIDLIST _ILCreateMyComputer (void);
152LPITEMIDLIST _ILCreateIExplore (void);
153LPITEMIDLIST _ILCreateControl (void);
154LPITEMIDLIST _ILCreatePrinter (void);
155LPITEMIDLIST _ILCreateNetwork (void);
156LPITEMIDLIST _ILCreateBitBucket (void);
157LPITEMIDLIST _ILCreateDrive (LPCSTR);
158LPITEMIDLIST _ILCreateFolder (WIN32_FIND_DATAA * stffile);
159LPITEMIDLIST _ILCreateValue (WIN32_FIND_DATAA * stffile);
160LPITEMIDLIST _ILCreateSpecial (LPCSTR szGUID);
[1214]161
162/*
163 * helper functions (getting struct-pointer)
164 */
[4121]165LPPIDLDATA _ILGetDataPointer (LPCITEMIDLIST);
166LPSTR _ILGetTextPointer (LPCITEMIDLIST);
167LPSTR _ILGetSTextPointer (LPCITEMIDLIST);
168REFIID _ILGetGUIDPointer (LPCITEMIDLIST pidl);
[1214]169
[4121]170/*
171 * debug helper
[1543]172 */
[5626]173#if defined(__WIN32OS2__) && defined(DEBUG)
174void pdump (LPCITEMIDLIST pidl);
175#else
176#define pdump(pidl)
177#endif
178BOOL pcheck (LPCITEMIDLIST pidl);
[1543]179
[4032]180/*
181 * aPidl helper
182 */
[4121]183void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl);
184LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl);
185LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPCIDA cida);
[4032]186
[1214]187#endif
Note: See TracBrowser for help on using the repository browser.