241{
254
255 DPRINT(
"AddDesktopItemW() called\n");
256
258
260 {
261 DPRINT1(
"GetDesktopPath() failed\n");
263 }
264 DPRINT(
"Desktop path: '%S'\n", szLinkPath);
265
266
268 &FindData);
270 {
271 DPRINT(
"'%S' does not exist\n", szLinkPath);
272
273
276 }
277 else
278 {
279 DPRINT(
"'%S' exists\n", szLinkPath);
281 }
282
283
285 wcscat(szLinkPath, lpItemName);
287 DPRINT(
"Link path: '%S'\n", szLinkPath);
288
289
291 DPRINT(
"Ptr %p lpArguments %p\n",
Ptr, lpArguments);
293 {
300 }
301 else
302 {
303 wcscpy(szCommand, lpArguments);
304 szArguments[0] = 0;
305 }
306 DPRINT(
"szCommand: '%S'\n", szCommand);
307 DPRINT(
"szArguments: '%S'\n", szArguments);
308
309
311 {
312 DPRINT1(
"USERENV: Unable to load OLE32.DLL\n");
314 }
315
316 Ole32.
fn.CoInitialize(
NULL);
317
318 hr = Ole32.
fn.CoCreateInstance(&CLSID_ShellLink,
320 CLSCTX_INPROC_SERVER,
321 &IID_IShellLinkW,
324 {
325 Ole32.
fn.CoUninitialize();
328 }
329
334 {
335 psl->lpVtbl->SetDescription(psl,
336 lpItemName);
337
338 psl->lpVtbl->SetPath(psl,
339 szCommand);
340
341 psl->lpVtbl->SetArguments(psl,
342 szArguments);
343
344 psl->lpVtbl->SetIconLocation(psl,
345 lpIconLocation,
346 iIcon);
347
348 if (lpWorkingDirectory !=
NULL)
349 {
350 psl->lpVtbl->SetWorkingDirectory(psl,
351 lpWorkingDirectory);
352 }
353 else
354 {
355 psl->lpVtbl->SetWorkingDirectory(psl,
356 L"%HOMEDRIVE%%HOMEPATH%");
357 }
358
359 psl->lpVtbl->SetHotkey(psl,
360 wHotKey);
361
362 psl->lpVtbl->SetShowCmd(psl,
363 iShowCmd);
364
365 hr = ppf->lpVtbl->Save(ppf,
366 szLinkPath,
370
372 }
373
375
376 Ole32.
fn.CoUninitialize();
377
379
380 DPRINT(
"AddDesktopItemW() done\n");
381
382 return bResult;
383}
#define INVALID_HANDLE_VALUE
static DWORD DWORD * dwLength
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
static BOOL GetDesktopPath(BOOL bCommonPath, LPWSTR lpDesktopPath)
BOOL CreateDirectoryPath(LPCWSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL LoadDynamicImports(PDYN_MODULE Module, PDYN_FUNCS DynFuncs)
VOID UnloadDynamicImports(PDYN_FUNCS DynFuncs)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
nsresult QueryInterface(nsIIDRef riid, void **result)
#define memcpy(s1, s2, n)
const GUID IID_IPersistFile
union _DYN_FUNCS::@573 fn