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
895f8006
Commit
895f8006
authored
Dec 06, 2022
by
Robert Wilhelm
Committed by
Alexandre Julliard
Dec 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wshom.ocx: Implement IWshNetwork2_get_UserName().
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53971
parent
090e574a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
network.c
dlls/wshom.ocx/network.c
+18
-2
wshom.c
dlls/wshom.ocx/tests/wshom.c
+21
-0
No files found.
dlls/wshom.ocx/network.c
View file @
895f8006
...
@@ -120,9 +120,25 @@ static HRESULT WINAPI WshNetwork2_get_UserDomain(IWshNetwork2 *iface, BSTR *user
...
@@ -120,9 +120,25 @@ static HRESULT WINAPI WshNetwork2_get_UserDomain(IWshNetwork2 *iface, BSTR *user
static
HRESULT
WINAPI
WshNetwork2_get_UserName
(
IWshNetwork2
*
iface
,
BSTR
*
user_name
)
static
HRESULT
WINAPI
WshNetwork2_get_UserName
(
IWshNetwork2
*
iface
,
BSTR
*
user_name
)
{
{
FIXME
(
"%p stub
\n
"
,
user_name
);
BOOL
ret
;
DWORD
len
=
0
;
TRACE
(
"%p
\n
"
,
user_name
);
GetUserNameW
(
NULL
,
&
len
);
*
user_name
=
SysAllocStringLen
(
NULL
,
len
-
1
);
if
(
!*
user_name
)
return
E_OUTOFMEMORY
;
ret
=
GetUserNameW
(
*
user_name
,
&
len
);
if
(
!
ret
)
{
HRESULT
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
SysFreeString
(
*
user_name
);
*
user_name
=
NULL
;
return
hr
;
}
return
E_NOTIMPL
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
WshNetwork2_get_UserProfile
(
IWshNetwork2
*
iface
,
BSTR
*
user_profile
)
static
HRESULT
WINAPI
WshNetwork2_get_UserProfile
(
IWshNetwork2
*
iface
,
BSTR
*
user_profile
)
...
...
dlls/wshom.ocx/tests/wshom.c
View file @
895f8006
...
@@ -692,7 +692,11 @@ static void test_popup(void)
...
@@ -692,7 +692,11 @@ static void test_popup(void)
static
void
test_wshnetwork
(
void
)
static
void
test_wshnetwork
(
void
)
{
{
IDispatch
*
disp
;
IDispatch
*
disp
;
IWshNetwork2
*
nw2
;
BSTR
str
,
username
;
HRESULT
hr
;
HRESULT
hr
;
DWORD
len
=
0
;
BOOL
ret
;
hr
=
CoCreateInstance
(
&
CLSID_WshNetwork
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
hr
=
CoCreateInstance
(
&
CLSID_WshNetwork
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
&
IID_IDispatch
,
(
void
**
)
&
disp
);
...
@@ -703,6 +707,23 @@ static void test_wshnetwork(void)
...
@@ -703,6 +707,23 @@ static void test_wshnetwork(void)
check_interface
(
disp
,
&
IID_IDispatchEx
,
FALSE
);
check_interface
(
disp
,
&
IID_IDispatchEx
,
FALSE
);
check_interface
(
disp
,
&
IID_IObjectWithSite
,
FALSE
);
check_interface
(
disp
,
&
IID_IObjectWithSite
,
FALSE
);
hr
=
IDispatch_QueryInterface
(
disp
,
&
IID_IWshNetwork2
,
(
void
**
)
&
nw2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
str
=
NULL
;
hr
=
IWshNetwork2_get_UserName
(
nw2
,
&
str
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
str
&&
str
[
0
]
!=
0
,
"got empty string
\n
"
);
CHECK_BSTR_LENGTH
(
str
);
GetUserNameW
(
NULL
,
&
len
);
ok
(
len
>
0
,
"Unexpected len %ld.
\n
"
,
len
);
username
=
SysAllocStringLen
(
NULL
,
len
-
1
);
ret
=
GetUserNameW
(
username
,
&
len
);
ok
(
ret
==
TRUE
,
"GetUserNameW returned %d.
\n
"
,
ret
);
ok
(
!
wcscmp
(
str
,
username
),
"user names do not match %s %s.
\n
"
,
debugstr_w
(
str
),
debugstr_w
(
username
));
SysFreeString
(
username
);
SysFreeString
(
str
);
IDispatch_Release
(
disp
);
IDispatch_Release
(
disp
);
}
}
...
...
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