summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/stdafx.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Toaster/src/stdafx.h')
-rw-r--r--plugins/Toaster/src/stdafx.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h
index 2e2e59cd1c..f5c193c328 100644
--- a/plugins/Toaster/src/stdafx.h
+++ b/plugins/Toaster/src/stdafx.h
@@ -50,8 +50,17 @@ int OnPreShutdown(WPARAM, LPARAM);
INT_PTR Service(WPARAM, LPARAM);
HRESULT ShortcutExists();
wchar_t* GetShortcutPath();
-HRESULT TryCreateShortcut();
HRESULT InstallShortcut(_In_z_ wchar_t *shortcutPath);
+__forceinline HRESULT TryCreateShortcut()
+{
+ return (ShortcutExists() ? S_OK : InstallShortcut(ptrW(GetShortcutPath())));
+}
+
+__forceinline HRESULT ShortcutExists()
+{
+ return (!(GetFileAttributes(ptrW(GetShortcutPath())) < 0xFFFFFFF) ? S_OK : S_FALSE);
+}
+
#endif //_COMMON_H_