Author: janderwald
Date: Sat Oct 20 05:18:08 2007
New Revision: 29694
URL:
http://svn.reactos.org/svn/reactos?rev=29694&view=rev
Log:
- implement shellnew operations for type "Data" and "FileName"
Modified:
trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c
Modified: trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_bg_c…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c (original)
+++ trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c Sat Oct 20 05:18:08 2007
@@ -268,6 +268,8 @@
STARTUPINFOW sInfo;
PROCESS_INFORMATION pi;
UINT i, target;
+ HANDLE hFile;
+ DWORD dwWritten;
static const WCHAR szNew[] = { 'N','e','w',' ',0 };
//FIXME
static const WCHAR szP1[] = { '%', '1', 0 };
@@ -347,18 +349,9 @@
break;
}
case SHELLNEW_TYPE_DATA:
- {
-
- break;
- }
case SHELLNEW_TYPE_FILENAME:
- {
-
- break;
- }
case SHELLNEW_TYPE_NULLFILE:
{
- HANDLE hFile;
i = 2;
wcscpy(szBuffer, strTemp.u.pOleStr);
@@ -374,8 +367,20 @@
swprintf(szPath, szFormat, szBuffer, i, pCurItem->szExt);
i++;
}while(hFile == INVALID_HANDLE_VALUE);
- break;
+
+ if (pCurItem->Type == SHELLNEW_TYPE_DATA)
+ {
+ i = WideCharToMultiByte(CP_ACP, 0, pCurItem->szTarget, -1,
(LPSTR)szBuffer, MAX_PATH*2, NULL, NULL);
+ if (i)
+ {
+ WriteFile(hFile, (LPCVOID)szBuffer, i, &dwWritten, NULL);
+ }
+ }
CloseHandle(hFile);
+ if (pCurItem->Type == SHELLNEW_TYPE_FILENAME)
+ {
+ CopyFileW(pCurItem->szTarget, szPath, FALSE);
+ }
break;
}
}