[SHELL32] -Expand the name of the cpl file because CreateActCtx needs a full path.
authorgadamopoulos <gadamopoulos@97493ccd-5924-5043-b1f5-66cb403b36ce>
Fri, 17 Feb 2017 17:23:17 +0000 (17:23 +0000)
committergadamopoulos <gadamopoulos@97493ccd-5924-5043-b1f5-66cb403b36ce>
Fri, 17 Feb 2017 17:23:17 +0000 (17:23 +0000)
git-svn-id: file:///srv/svn/reactos/trunk@73818 97493ccd-5924-5043-b1f5-66cb403b36ce

reactos/dll/win32/shell32/wine/control.c

index f568b92..f317b30 100644 (file)
@@ -30,6 +30,8 @@
 #include <shellapi.h>
 #include <wine/debug.h>
 
+#include <strsafe.h>
+
 #include "cpanel.h"
 #include "wine/unicode.h"
 
@@ -57,6 +59,7 @@ CPlApplet*    Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
     ACTCTXW ActCtx = {sizeof(ACTCTX), ACTCTX_FLAG_RESOURCE_NAME_VALID};
     ULONG_PTR cookie;
     BOOL bActivated;
+    WCHAR fileBuffer[MAX_PATH];
 #endif
     CPlApplet* applet;
     DWORD len;
@@ -86,7 +89,9 @@ CPlApplet*    Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
     applet->hWnd = hWnd;
 
 #ifdef __REACTOS__
-    ActCtx.lpSource = applet->cmd;
+    StringCchCopy(fileBuffer, MAX_PATH, applet->cmd);
+    SearchPath(NULL, fileBuffer, NULL, MAX_PATH, fileBuffer, NULL);
+    ActCtx.lpSource = fileBuffer;
     ActCtx.lpResourceName = (LPCWSTR)123;
     applet->hActCtx = CreateActCtx(&ActCtx);
     bActivated = (applet->hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(applet->hActCtx, &cookie) : FALSE);