From be90e005599d030c8d3c340eef5dfd0fb4cf62b7 Mon Sep 17 00:00:00 2001 From: Juergen Schmied Date: Sun, 22 Nov 1998 18:28:03 +0000 Subject: [PATCH] New function: _ILGetExtension. --- dlls/shell32/pidl.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 0201c1feaf8..50f85bd80fc 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -980,6 +980,28 @@ BOOL32 WINAPI _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT32 uOutSize) sprintf(stemp,"%lu", pdata->u.file.dwFileSize); return GetNumberFormat32A(LOCALE_USER_DEFAULT, 0, stemp, NULL, pOut, uOutSize); } + +BOOL32 WINAPI _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT32 uOutSize) +{ char pTemp[MAX_PATH]; + int i; + + TRACE(pidl,"pidl=%p\n",pidl); + + if ( ! _ILGetValueText(pidl, pTemp, MAX_PATH)) + { return FALSE; + } + + for (i=0; pTemp[i]!='.' && pTemp[i];i++); + + if (!pTemp[i]) + return FALSE; + + strncpy(pOut, &pTemp[i], uOutSize); + TRACE(pidl,"%s\n",pOut); + + return TRUE; +} + /************************************************************************** * IDLList "Item ID List List" *