47 DPRINT(
"GetDesktopPath() called\n");
50 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",
56 DPRINT1(
"RegOpenKeyExW() failed\n");
63 bCommonPath ?
L"Common Desktop" :
L"Desktop",
70 DPRINT1(
"RegQueryValueExW() failed\n");
89 DPRINT(
"GetDesktopPath() done\n");
106 DPRINT(
"GetProgramsPath() called\n");
109 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",
115 DPRINT1(
"RegOpenKeyExW() failed\n");
122 bCommonPath ?
L"Common Programs" :
L"Programs",
129 DPRINT1(
"RegQueryValueExW() failed\n");
149 DPRINT(
"GetProgramsPath() done\n");
162 LPCSTR lpWorkingDirectory,
188 (
LPSTR)lpIconLocation))
196 if (lpWorkingDirectory !=
NULL)
199 (
LPSTR)lpWorkingDirectory))
218 if (lpWorkingDirectory !=
NULL)
255 DPRINT(
"AddDesktopItemW() called\n");
261 DPRINT1(
"GetDesktopPath() failed\n");
264 DPRINT(
"Desktop path: '%S'\n", szLinkPath);
271 DPRINT(
"'%S' does not exist\n", szLinkPath);
279 DPRINT(
"'%S' exists\n", szLinkPath);
285 wcscat(szLinkPath, lpItemName);
287 DPRINT(
"Link path: '%S'\n", szLinkPath);
291 DPRINT(
"Ptr %p lpArguments %p\n",
Ptr, lpArguments);
303 wcscpy(szCommand, lpArguments);
306 DPRINT(
"szCommand: '%S'\n", szCommand);
307 DPRINT(
"szArguments: '%S'\n", szArguments);
312 DPRINT1(
"USERENV: Unable to load OLE32.DLL\n");
316 Ole32.
fn.CoInitialize(
NULL);
318 hr = Ole32.
fn.CoCreateInstance(&CLSID_ShellLink,
320 CLSCTX_INPROC_SERVER,
325 Ole32.
fn.CoUninitialize();
348 if (lpWorkingDirectory !=
NULL)
356 L"%HOMEDRIVE%%HOMEPATH%");
365 hr = ppf->lpVtbl->
Save(ppf,
376 Ole32.
fn.CoUninitialize();
380 DPRINT(
"AddDesktopItemW() done\n");
417 DPRINT(
"DeleteDesktopItemW() called\n");
421 DPRINT1(
"GetDesktopPath() failed\n");
426 wcscat(szLinkPath, lpItemName);
428 DPRINT(
"Link path: '%S'\n", szLinkPath);
464 DPRINT1(
"CreateGroupW() called\n");
466 if (lpGroupName ==
NULL || *lpGroupName == 0)
471 DPRINT1(
"GetProgramsPath() failed\n");
474 DPRINT1(
"Programs path: '%S'\n", szGroupPath);
477 wcscat(szGroupPath, lpGroupName);
478 DPRINT1(
"Group path: '%S'\n", szGroupPath);
486 DPRINT1(
"CreateGroupW() done\n");
522 DPRINT(
"DeleteGroupW() called\n");
524 if (lpGroupName ==
NULL || *lpGroupName == 0)
529 DPRINT1(
"GetProgramsPath() failed\n");
532 DPRINT(
"Programs path: '%S'\n", szGroupPath);
535 wcscat(szGroupPath, lpGroupName);
536 DPRINT(
"Group path: '%S'\n", szGroupPath);
544 DPRINT(
"DeleteGroupW() done\n");
558 LPCSTR lpWorkingDirectory,
585 (
LPSTR)lpIconLocation))
593 if (lpGroupName !=
NULL)
606 if (lpWorkingDirectory !=
NULL)
609 (
LPSTR)lpWorkingDirectory))
611 if (lpGroupName !=
NULL)
633 if (lpGroupName !=
NULL)
638 if (lpWorkingDirectory !=
NULL)
676 DPRINT(
"AddItemW() called\n");
682 DPRINT1(
"GetProgramsPath() failed\n");
686 DPRINT(
"Programs path: '%S'\n", szLinkPath);
688 if (lpGroupName !=
NULL && *lpGroupName != 0)
691 wcscat(szLinkPath, lpGroupName);
698 DPRINT(
"'%S' does not exist\n", szLinkPath);
705 DPRINT(
"'%S' exists\n", szLinkPath);
711 wcscat(szLinkPath, lpItemName);
713 DPRINT(
"Link path: '%S'\n", szLinkPath);
717 DPRINT(
"Ptr %p lpArguments %p\n",
Ptr, lpArguments);
729 wcscpy(szCommand, lpArguments);
732 DPRINT(
"szCommand: '%S'\n", szCommand);
733 DPRINT(
"szArguments: '%S'\n", szArguments);
738 DPRINT1(
"USERENV: Unable to load OLE32.DLL\n");
742 Ole32.
fn.CoInitialize(
NULL);
744 hr = Ole32.
fn.CoCreateInstance(&CLSID_ShellLink,
746 CLSCTX_INPROC_SERVER,
751 Ole32.
fn.CoUninitialize();
774 if (lpWorkingDirectory !=
NULL)
782 L"%HOMEDRIVE%%HOMEPATH%");
791 hr = ppf->lpVtbl->
Save(ppf,
802 Ole32.
fn.CoUninitialize();
805 DPRINT(
"AddItemW() done\n");
822 if (lpGroupName !=
NULL)
835 if (lpGroupName !=
NULL)
850 if (lpGroupName !=
NULL)
869 DPRINT(
"DeleteItemW() called\n");
873 DPRINT1(
"GetProgramsPath() failed\n");
876 DPRINT(
"Programs path: '%S'\n", szItemPath);
878 if (lpGroupName !=
NULL && *lpGroupName != 0)
881 wcscat(szItemPath, lpGroupName);
885 wcscat(szItemPath, lpItemName);
887 DPRINT(
"Item path: '%S'\n", szItemPath);
901 DPRINT(
"Item path: '%S'\n", szItemPath);
908 DPRINT(
"DeleteItemW() done\n");
#define RegCloseKey(hKey)
#define ERROR_NOT_ENOUGH_MEMORY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define INVALID_HANDLE_VALUE
static DWORD DWORD * dwLength
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI CreateGroupA(LPCSTR lpGroupName, BOOL bCommonGroup)
BOOL WINAPI AddDesktopItemA(BOOL bCommonItem, LPCSTR lpItemName, LPCSTR lpArguments, LPCSTR lpIconLocation, INT iIcon, LPCSTR lpWorkingDirectory, WORD wHotKey, INT iShowCmd)
BOOL WINAPI CreateGroupW(LPCWSTR lpGroupName, BOOL bCommonGroup)
BOOL WINAPI AddItemA(LPCSTR lpGroupName, BOOL bCommonGroup, LPCSTR lpItemName, LPCSTR lpArguments, LPCSTR lpIconLocation, INT iIcon, LPCSTR lpWorkingDirectory, WORD wHotKey, INT iShowCmd)
BOOL WINAPI DeleteGroupA(LPCSTR lpGroupName, BOOL bCommonGroup)
BOOL WINAPI DeleteGroupW(LPCWSTR lpGroupName, BOOL bCommonGroup)
static BOOL GetDesktopPath(BOOL bCommonPath, LPWSTR lpDesktopPath)
BOOL WINAPI DeleteDesktopItemW(BOOL bCommonItem, LPCWSTR lpItemName)
BOOL WINAPI AddDesktopItemW(BOOL bCommonDesktop, LPCWSTR lpItemName, LPCWSTR lpArguments, LPCWSTR lpIconLocation, INT iIcon, LPCWSTR lpWorkingDirectory, WORD wHotKey, INT iShowCmd)
BOOL WINAPI DeleteItemW(LPCWSTR lpGroupName, BOOL bCommonGroup, LPCWSTR lpItemName, BOOL bDeleteGroup)
BOOL WINAPI AddItemW(LPCWSTR lpGroupName, BOOL bCommonGroup, LPCWSTR lpItemName, LPCWSTR lpArguments, LPCWSTR lpIconLocation, INT iIcon, LPCWSTR lpWorkingDirectory, WORD wHotKey, INT iShowCmd)
BOOL WINAPI DeleteItemA(LPCSTR lpGroupName, BOOL bCommonGroup, LPCSTR lpItemName, BOOL bDeleteGroup)
BOOL WINAPI DeleteDesktopItemA(BOOL bCommonItem, LPCSTR lpItemName)
static BOOL GetProgramsPath(BOOL bCommonPath, LPWSTR lpProgramsPath)
BOOL RemoveDirectoryPath(LPCWSTR lpPathName)
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
HRESULT Save([in, unique] LPCOLESTR pszFileName, [in] BOOL fRemember)
HRESULT SetArguments([in] LPCWSTR pszArgs)
HRESULT SetPath([in] LPCWSTR pszFile)
HRESULT SetIconLocation([in] LPCWSTR pszIconPath, [in] int iIcon)
HRESULT SetShowCmd([in] int iShowCmd)
HRESULT SetHotkey([in] WORD wHotkey)
HRESULT SetDescription([in] LPCWSTR pszName)
HRESULT SetWorkingDirectory([in] LPCWSTR pszDir)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define memcpy(s1, s2, n)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
const GUID IID_IPersistFile
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
union _DYN_FUNCS::@573 fn
#define HKEY_CURRENT_USER