10 Apr
2007
10 Apr
'07
6:03 a.m.
Thanks for the comments. I have corrected most and will resubmit. Dmitry Timoshkov wrote:
+ + type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE; + + /* + * FileStruct already has one byte for the first name, so use len - 1 in + * size calculation + */ + wlen = lstrlenW(wfd->cFileName); + pidl = _ILAlloc(type, sizeof(FileStruct) + (alen - 1) + (alen & 0x1) + + sizeof(FileStructW) + wlen * sizeof(WCHAR) + sizeof(WORD)) ;
What (alen & 0x1) is for?
the (alen & 0x1) has to do with byte aligning the FileStructW. It is based on the code in UNIXFS_build_shitemid of shfldr_unixfs.c -aric