Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
83ca4e20
Commit
83ca4e20
authored
Nov 29, 2017
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement the CreateGroup() command for Progman DDE.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
67780239
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
24 deletions
+54
-24
dde.c
dlls/shell32/dde.c
+41
-2
progman_dde.c
dlls/shell32/tests/progman_dde.c
+13
-22
No files found.
dlls/shell32/dde.c
View file @
83ca4e20
...
...
@@ -97,10 +97,49 @@ static inline HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic,
return
NULL
;
}
/* Returned string must be freed by caller */
static
WCHAR
*
get_programs_path
(
WCHAR
*
name
)
{
static
const
WCHAR
slashW
[]
=
{
'/'
,
0
};
WCHAR
*
programs
,
*
path
;
int
len
;
SHGetKnownFolderPath
(
&
FOLDERID_Programs
,
0
,
NULL
,
&
programs
);
len
=
lstrlenW
(
programs
)
+
1
+
lstrlenW
(
name
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
*
path
));
lstrcpyW
(
path
,
programs
);
lstrcatW
(
path
,
slashW
);
lstrcatW
(
path
,
name
);
CoTaskMemFree
(
programs
);
return
path
;
}
static
DWORD
PROGMAN_OnExecute
(
WCHAR
*
command
,
int
argc
,
WCHAR
**
argv
)
{
FIXME
(
"unhandled command %s
\n
"
,
debugstr_w
(
command
));
return
DDE_FNOTPROCESSED
;
static
const
WCHAR
create_groupW
[]
=
{
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'G'
,
'r'
,
'o'
,
'u'
,
'p'
,
0
};
if
(
!
strcmpiW
(
command
,
create_groupW
))
{
WCHAR
*
path
;
if
(
argc
<
1
)
return
DDE_FNOTPROCESSED
;
path
=
get_programs_path
(
argv
[
0
]);
CreateDirectoryW
(
path
,
NULL
);
ShellExecuteW
(
NULL
,
NULL
,
path
,
NULL
,
NULL
,
SW_SHOWNORMAL
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
}
else
{
FIXME
(
"unhandled command %s
\n
"
,
debugstr_w
(
command
));
return
DDE_FNOTPROCESSED
;
}
return
DDE_FACK
;
}
static
DWORD
parse_dde_command
(
HSZ
hszTopic
,
WCHAR
*
command
)
...
...
dlls/shell32/tests/progman_dde.c
View file @
83ca4e20
...
...
@@ -281,12 +281,9 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
/* CreateGroup Tests (including AddItem, DeleteItem) */
error
=
dde_execute
(
instance
,
hConv
,
"[CreateGroup(Group1)]"
);
todo_wine
{
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"Group1"
),
"directory not created
\n
"
);
if
(
error
==
DMLERR_NO_ERROR
)
ok
(
check_window_exists
(
Group1Title
),
"window not created
\n
"
);
}
ok
(
check_window_exists
(
Group1Title
),
"window not created
\n
"
);
sprintf
(
itemtext
,
"[AddItem(%s,f1g1Name)]"
,
f1g1
);
error
=
dde_execute
(
instance
,
hConv
,
itemtext
);
...
...
@@ -315,21 +312,15 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
}
error
=
dde_execute
(
instance
,
hConv
,
"[CreateGroup(Group2)]"
);
todo_wine
{
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"Group2"
),
"directory not created
\n
"
);
if
(
error
==
DMLERR_NO_ERROR
)
ok
(
check_window_exists
(
Group2Title
),
"window not created
\n
"
);
}
ok
(
check_window_exists
(
Group2Title
),
"window not created
\n
"
);
/* Create Group that already exists - same instance */
error
=
dde_execute
(
instance
,
hConv
,
"[CreateGroup(Group1)]"
);
todo_wine
{
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"Group1"
),
"directory not created
\n
"
);
if
(
error
==
DMLERR_NO_ERROR
)
ok
(
check_window_exists
(
Group1Title
),
"window not created
\n
"
);
}
ok
(
check_window_exists
(
Group1Title
),
"window not created
\n
"
);
/* ShowGroup Tests */
error
=
dde_execute
(
instance
,
hConv
,
"[ShowGroup(Group1)]"
);
...
...
@@ -356,26 +347,28 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
/* DeleteGroup Test */
error
=
dde_execute
(
instance
,
hConv
,
"[DeleteGroup(Group1)]"
);
todo_wine
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
);
error
=
dde_execute
(
instance
,
hConv
,
comptext
);
todo_wine
{
todo_wine
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"Group3"
),
"directory not created
\n
"
);
if
(
error
==
DMLERR_NO_ERROR
)
ok
(
check_window_exists
(
Group3Title
),
"window not created
\n
"
);
ok
(
check_window_exists
(
Group3Title
),
"window not created
\n
"
);
todo_wine
{
ok
(
check_exists
(
"Group3/f1g3Name.lnk"
),
"link not created
\n
"
);
ok
(
check_exists
(
"Group3/f2g3Name.lnk"
),
"link not created
\n
"
);
}
error
=
dde_execute
(
instance
,
hConv
,
"[DeleteGroup(Group3)]"
);
todo_wine
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]]]]]]]) */
...
...
@@ -394,17 +387,15 @@ static void test_progman_dde2(DWORD instance, HCONV hConv)
/* Create Group that already exists on a separate connection */
error
=
dde_execute
(
instance
,
hConv
,
"[CreateGroup(Group2)]"
);
todo_wine
{
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"Group2"
),
"directory not created
\n
"
);
if
(
error
==
DMLERR_NO_ERROR
)
ok
(
check_window_exists
(
Group2Title
),
"window not created
\n
"
);
}
ok
(
check_window_exists
(
Group2Title
),
"window not created
\n
"
);
error
=
dde_execute
(
instance
,
hConv
,
"[DeleteGroup(Group2)]"
);
todo_wine
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment