Zebediah Figura : shell32: Implement the DeleteGroup() command for Progman DDE.
Alexandre Julliard
julliard at winehq.org
Thu Nov 30 14:19:34 CST 2017
Module: wine
Branch: master
Commit: 957da4ee07e8e8f163ee8ce0795cedf2b3b3dff7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=957da4ee07e8e8f163ee8ce0795cedf2b3b3dff7
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Wed Nov 29 17:00:47 2017 -0600
shell32: Implement the DeleteGroup() command for Progman DDE.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/dde.c | 26 ++++++++++++++++++++++++++
dlls/shell32/tests/progman_dde.c | 6 ------
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/dlls/shell32/dde.c b/dlls/shell32/dde.c
index 3a18d3a..a1aac15 100644
--- a/dlls/shell32/dde.c
+++ b/dlls/shell32/dde.c
@@ -120,6 +120,7 @@ static WCHAR *get_programs_path(WCHAR *name)
static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
{
static const WCHAR create_groupW[] = {'C','r','e','a','t','e','G','r','o','u','p',0};
+ static const WCHAR delete_groupW[] = {'D','e','l','e','t','e','G','r','o','u','p',0};
if (!strcmpiW(command, create_groupW))
{
@@ -134,6 +135,31 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
HeapFree(GetProcessHeap(), 0, path);
}
+ else if (!strcmpiW(command, delete_groupW))
+ {
+ WCHAR *path, *path2;
+ SHFILEOPSTRUCTW shfos = {0};
+ int ret;
+
+ if (argc < 1) return DDE_FNOTPROCESSED;
+
+ path = get_programs_path(argv[0]);
+
+ path2 = HeapAlloc(GetProcessHeap(), 0, (strlenW(path) + 2) * sizeof(*path));
+ strcpyW(path2, path);
+ path2[strlenW(path) + 1] = 0;
+
+ shfos.wFunc = FO_DELETE;
+ shfos.pFrom = path2;
+ shfos.fFlags = FOF_NOCONFIRMATION;
+
+ ret = SHFileOperationW(&shfos);
+
+ HeapFree(GetProcessHeap(), 0, path2);
+ HeapFree(GetProcessHeap(), 0, path);
+
+ if (ret || shfos.fAnyOperationsAborted) return DDE_FNOTPROCESSED;
+ }
else
{
FIXME("unhandled command %s\n", debugstr_w(command));
diff --git a/dlls/shell32/tests/progman_dde.c b/dlls/shell32/tests/progman_dde.c
index 73a79a8..c5fd262 100644
--- a/dlls/shell32/tests/progman_dde.c
+++ b/dlls/shell32/tests/progman_dde.c
@@ -347,10 +347,8 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
/* DeleteGroup Test */
error = dde_execute(instance, hConv, "[DeleteGroup(Group1)]");
- todo_wine {
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
ok(!check_exists("Group1"), "directory should not exist\n");
- }
/* Compound Execute String Command */
sprintf(comptext, "[CreateGroup(Group3)][AddItem(%s,f1g3Name)][AddItem(%s,f2g3Name)]", f1g3, f2g3);
@@ -365,10 +363,8 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
}
error = dde_execute(instance, hConv, "[DeleteGroup(Group3)]");
- todo_wine {
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
ok(!check_exists("Group3"), "directory should not exist\n");
- }
/* Full Parameters of Add Item */
/* AddItem(CmdLine[,Name[,IconPath[,IconIndex[,xPos,yPos[,DefDir[,HotKey[,fMinimize[fSeparateSpace]]]]]]]) */
@@ -392,10 +388,8 @@ static void test_progman_dde2(DWORD instance, HCONV hConv)
ok(check_window_exists(Group2Title), "window not created\n");
error = dde_execute(instance, hConv, "[DeleteGroup(Group2)]");
- todo_wine {
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
ok(!check_exists("Group2"), "directory should not exist\n");
- }
}
START_TEST(progman_dde)
More information about the wine-cvs
mailing list