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
51e4839f
Commit
51e4839f
authored
Feb 14, 2003
by
Uwe Bonnes
Committed by
Alexandre Julliard
Feb 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate "Enumerate Hardware Addresses" as function, as other netapi32
function need it. Implemented level 0 of NetWkstaTransportEnum.
parent
909ffb79
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
13 deletions
+119
-13
netapi32.c
dlls/netapi32/netapi32.c
+40
-12
netapi32.spec
dlls/netapi32/netapi32.spec
+1
-1
wksta.c
dlls/netapi32/wksta.c
+70
-0
lmwksta.h
include/lmwksta.h
+8
-0
No files found.
dlls/netapi32/netapi32.c
View file @
51e4839f
...
...
@@ -99,22 +99,15 @@ int get_hw_address(int sd, struct ifreq *ifr, unsigned char *address)
# endif
/* SIOCGENADDR */
# endif
/* SIOCGIFHWADDR */
static
UCHAR
NETBIOS_Enum
(
PNCB
ncb
)
int
enum_hw
(
void
)
{
int
ret
=
0
;
#ifdef HAVE_NET_IF_H
int
sd
;
struct
ifreq
ifr
,
*
ifrp
;
struct
ifconf
ifc
;
unsigned
char
buf
[
1024
];
int
i
,
ofs
;
#endif
LANA_ENUM
*
lanas
=
(
PLANA_ENUM
)
ncb
->
ncb_buffer
;
TRACE
(
"NCBENUM
\n
"
);
lanas
->
length
=
0
;
#ifdef HAVE_NET_IF_H
/* BSD 4.4 defines the size of an ifreq to be
* max(sizeof(ifreq), sizeof(ifreq.ifr_name)+ifreq.ifr_addr.sa_len
* However, under earlier systems, sa_len isn't present, so
...
...
@@ -156,13 +149,49 @@ static UCHAR NETBIOS_Enum(PNCB ncb)
a
[
0
],
a
[
1
],
a
[
2
],
a
[
3
],
a
[
4
],
a
[
5
]);
NETBIOS_Adapter
[
i
].
valid
=
TRUE
;
lanas
->
lana
[
lanas
->
length
]
=
i
;
lanas
->
length
++
;
ret
++
;
}
ofs
+=
ifreq_size
(
ifr
);
}
close
(
sd
);
TRACE
(
"found %d adapters
\n
"
,
ret
);
#endif
/* HAVE_NET_IF_H */
return
ret
;
}
void
wprint_mac
(
WCHAR
*
buffer
,
int
index
)
{
int
i
;
unsigned
char
val
;
for
(
i
=
0
;
i
<
6
;
i
++
)
{
val
=
NETBIOS_Adapter
[
index
].
address
[
i
];
if
((
val
>>
4
)
>
9
)
buffer
[
2
*
i
]
=
(
WCHAR
)((
val
>>
4
)
+
'A'
-
10
);
else
buffer
[
2
*
i
]
=
(
WCHAR
)((
val
>>
4
)
+
'0'
);
if
((
val
&
0xf
)
>
9
)
buffer
[
2
*
i
+
1
]
=
(
WCHAR
)((
val
&
0xf
)
+
'A'
-
10
);
else
buffer
[
2
*
i
+
1
]
=
(
WCHAR
)((
val
&
0xf
)
+
'0'
);
}
buffer
[
12
]
=
(
WCHAR
)
0
;
}
static
UCHAR
NETBIOS_Enum
(
PNCB
ncb
)
{
int
i
;
LANA_ENUM
*
lanas
=
(
PLANA_ENUM
)
ncb
->
ncb_buffer
;
TRACE
(
"NCBENUM
\n
"
);
lanas
->
length
=
0
;
for
(
i
=
0
;
i
<
enum_hw
();
i
++
)
{
lanas
->
lana
[
lanas
->
length
]
=
i
;
lanas
->
length
++
;
}
return
NRC_GOODRET
;
}
...
...
@@ -266,4 +295,3 @@ BOOL WINAPI Netbios(PNCB pncb)
pncb
->
ncb_retcode
=
ret
;
return
ret
;
}
dlls/netapi32/netapi32.spec
View file @
51e4839f
...
...
@@ -198,7 +198,7 @@
@ stub NetWkstaSetInfo
@ stub NetWkstaTransportAdd
@ stub NetWkstaTransportDel
@ st
ub
NetWkstaTransportEnum
@ st
dcall NetWkstaTransportEnum (wstr long ptr long ptr ptr ptr)
NetWkstaTransportEnum
@ stub NetWkstaUserEnum
@ stdcall NetWkstaUserGetInfo(wstr long ptr) NetWkstaUserGetInfo
@ stub NetWkstaUserSetInfo
...
...
dlls/netapi32/wksta.c
View file @
51e4839f
...
...
@@ -59,6 +59,76 @@ BOOL NETAPI_IsLocalComputer(LPCWSTR ServerName)
}
}
int
enum_hw
(
void
);
void
wprint_mac
(
WCHAR
*
buffer
,
int
index
);
NET_API_STATUS
WINAPI
NetWkstaTransportEnum
(
LPCWSTR
ServerName
,
DWORD
level
,
LPBYTE
*
pbuf
,
DWORD
prefmaxlen
,
LPDWORD
read_entries
,
LPDWORD
total_entries
,
LPDWORD
hresume
)
{
FIXME
(
":%s, 0x%08lx, %p, 0x%08lx, %p, %p, %p
\n
"
,
debugstr_w
(
ServerName
),
level
,
pbuf
,
prefmaxlen
,
read_entries
,
total_entries
,
hresume
);
if
(
!
NETAPI_IsLocalComputer
(
ServerName
))
{
FIXME
(
":not implemented for non-local computers
\n
"
);
return
ERROR_INVALID_LEVEL
;
}
else
{
if
(
hresume
&&
*
hresume
)
{
FIXME
(
":resume handle not implemented
\n
"
);
return
ERROR_INVALID_LEVEL
;
}
switch
(
level
)
{
case
0
:
/* transport info */
{
PWKSTA_TRANSPORT_INFO_0
ti
;
int
i
,
size_needed
,
n_adapt
=
enum_hw
();
size_needed
=
n_adapt
*
(
sizeof
(
WKSTA_TRANSPORT_INFO_0
)
*
13
*
sizeof
(
WCHAR
));
if
(
prefmaxlen
==
MAX_PREFERRED_LENGTH
)
NetApiBufferAllocate
(
size_needed
,
(
LPVOID
*
)
pbuf
);
else
{
if
(
size_needed
>
prefmaxlen
)
return
ERROR_MORE_DATA
;
NetApiBufferAllocate
(
prefmaxlen
,
(
LPVOID
*
)
pbuf
);
}
for
(
i
=
0
;
i
<
n_adapt
;
i
++
)
{
ti
=
(
PWKSTA_TRANSPORT_INFO_0
)
((
PBYTE
)
*
pbuf
+
i
*
sizeof
(
WKSTA_TRANSPORT_INFO_0
));
ti
->
wkti0_quality_of_service
=
0
;
ti
->
wkti0_number_of_vcs
=
0
;
ti
->
wkti0_transport_name
=
NULL
;
ti
->
wkti0_transport_address
=
(
LPWSTR
)
((
PBYTE
)
*
pbuf
+
n_adapt
*
sizeof
(
WKSTA_TRANSPORT_INFO_0
)
+
i
*
13
*
sizeof
(
WCHAR
));
ti
->
wkti0_wan_ish
=
TRUE
;
/*TCPIP/NETBIOS Protocoll*/
wprint_mac
(
ti
->
wkti0_transport_address
,
i
);
TRACE
(
"%d of %d:ti at %p transport_address at %p %s
\n
"
,
i
,
n_adapt
,
ti
,
ti
->
wkti0_transport_address
,
debugstr_w
(
ti
->
wkti0_transport_address
));
}
if
(
read_entries
)
*
read_entries
=
n_adapt
;
if
(
total_entries
)
*
total_entries
=
n_adapt
;
if
(
hresume
)
*
hresume
=
0
;
break
;
}
default:
ERR
(
"Invalid level %ld is specified
\n
"
,
level
);
return
ERROR_INVALID_LEVEL
;
}
return
NERR_Success
;
}
}
/************************************************************
* NetWkstaUserGetInfo (NETAPI32.@)
*/
...
...
include/lmwksta.h
View file @
51e4839f
...
...
@@ -28,6 +28,14 @@ extern "C" {
/* NetBIOS */
UCHAR
WINAPI
Netbios
(
PNCB
pncb
);
typedef
struct
_WKSTA_TRANSPORT_INFO_0
{
DWORD
wkti0_quality_of_service
;
DWORD
wkti0_number_of_vcs
;
LPWSTR
wkti0_transport_name
;
LPWSTR
wkti0_transport_address
;
BOOL
wkti0_wan_ish
;
}
WKSTA_TRANSPORT_INFO_0
,
*
PWKSTA_TRANSPORT_INFO_0
,
*
LPWKSTA_TRANSPORT_INFO_0
;
typedef
struct
_WKSTA_USER_INFO_0
{
LPWSTR
wkui0_username
;
}
WKSTA_USER_INFO_0
,
*
PWKSTA_USER_INFO_0
,
*
LPWKSTA_USER_INFO_0
;
...
...
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