From fa9950f93e70b6358a69e85fa3f5e9671b5f7535 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Sat, 26 Jan 2008 03:15:52 +0100 Subject: [PATCH] winedump: Add support for dumping SZ_LINK and SPECIAL_FOLDER data blocks. --- tools/winedump/lnk.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tools/winedump/lnk.c b/tools/winedump/lnk.c index 590a9d1a6fe..53d2a55cf30 100644 --- a/tools/winedump/lnk.c +++ b/tools/winedump/lnk.c @@ -63,6 +63,8 @@ typedef enum { SLDF_RESERVED = 0x80000000, } SHELL_LINK_DATA_FLAGS; +#define EXP_SZ_LINK_SIG 0xa0000001 +#define EXP_SPECIAL_FOLDER_SIG 0xa0000005 #define EXP_DARWIN_ID_SIG 0xa0000006 #define EXP_SZ_ICON_SIG 0xa0000007 @@ -116,6 +118,14 @@ typedef struct _LOCAL_VOLUME_INFO DWORD dwVolLabelOfs; } LOCAL_VOLUME_INFO; +typedef struct +{ + DWORD cbSize; + DWORD dwSignature; + DWORD idSpecialFolder; + DWORD cbOffset; +} EXP_SPECIAL_FOLDER; + typedef struct lnk_string_tag { unsigned short size; @@ -288,6 +298,17 @@ static int base85_to_guid( const char *str, LPGUID guid ) return 1; } +static int dump_special_folder_block(const DATABLOCK_HEADER* bhdr) +{ + const EXP_SPECIAL_FOLDER *sfb = (const EXP_SPECIAL_FOLDER*)bhdr; + printf("Special folder block\n"); + printf("--------------------\n\n"); + printf("folder = 0x%04x\n", sfb->idSpecialFolder); + printf("offset = %d\n", sfb->cbOffset); + printf("\n"); + return 0; +} + static int dump_sz_block(const DATABLOCK_HEADER* bhdr, const char* label) { const LINK_SZ_BLOCK *szp = (const LINK_SZ_BLOCK*)bhdr; @@ -481,6 +502,12 @@ void lnk_dump(void) break; switch (bhdr->dwSignature) { + case EXP_SZ_LINK_SIG: + dump_sz_block(bhdr, "exp.link"); + break; + case EXP_SPECIAL_FOLDER_SIG: + dump_special_folder_block(bhdr); + break; case EXP_SZ_ICON_SIG: dump_sz_block(bhdr, "icon"); break;