File tree Expand file tree Collapse file tree 6 files changed +16
-14
lines changed
Expand file tree Collapse file tree 6 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -511,15 +511,17 @@ PDHCP_ADAPTER AdapterFindIndex( unsigned int indx ) {
511511 return NULL ;
512512}
513513
514- PDHCP_ADAPTER AdapterFindName ( const CHAR * name ) {
514+ PDHCP_ADAPTER AdapterFindName ( const WCHAR * name ) {
515515 PDHCP_ADAPTER Adapter ;
516516 PLIST_ENTRY ListEntry ;
517+ WCHAR UnicodeName [45 ];
517518
518519 for ( ListEntry = AdapterList .Flink ;
519520 ListEntry != & AdapterList ;
520521 ListEntry = ListEntry -> Flink ) {
521522 Adapter = CONTAINING_RECORD ( ListEntry , DHCP_ADAPTER , ListEntry );
522- if ( !stricmp ((const CHAR * )Adapter -> IfMib .bDescr , name ) ) return Adapter ;
523+ mbstowcs (UnicodeName , (const CHAR * )Adapter -> IfMib .bDescr , strlen ((const CHAR * )Adapter -> IfMib .bDescr ) + 1 );
524+ if ( !wcsicmp (UnicodeName , name ) ) return Adapter ;
523525 }
524526
525527 return NULL ;
Original file line number Diff line number Diff line change @@ -79,19 +79,19 @@ DhcpCApiCleanup(VOID)
7979DWORD
8080APIENTRY
8181DhcpAcquireParameters (
82- _In_ PSTR AdapterName )
82+ _In_ PWSTR AdapterName )
8383{
8484 COMM_DHCP_REQ Req ;
8585 COMM_DHCP_REPLY Reply ;
8686 DWORD BytesRead ;
8787 BOOL Result ;
8888
89- DPRINT1 ("DhcpAcquireParameters(%s )\n" , AdapterName );
89+ DPRINT1 ("DhcpAcquireParameters(%S )\n" , AdapterName );
9090
9191 ASSERT (PipeHandle != INVALID_HANDLE_VALUE );
9292
9393 Req .Type = DhcpReqAcquireParams ;
94- strcpy (Req .Body .AcquireParams .AdapterName , AdapterName );
94+ wcscpy (Req .Body .AcquireParams .AdapterName , AdapterName );
9595
9696 Result = TransactNamedPipe (PipeHandle ,
9797 & Req , sizeof (Req ),
@@ -110,19 +110,19 @@ DhcpAcquireParameters(
110110DWORD
111111APIENTRY
112112DhcpReleaseParameters (
113- _In_ PSTR AdapterName )
113+ _In_ PWSTR AdapterName )
114114{
115115 COMM_DHCP_REQ Req ;
116116 COMM_DHCP_REPLY Reply ;
117117 DWORD BytesRead ;
118118 BOOL Result ;
119119
120- DPRINT1 ("DhcpReleaseParameters(%s )\n" , AdapterName );
120+ DPRINT1 ("DhcpReleaseParameters(%S )\n" , AdapterName );
121121
122122 ASSERT (PipeHandle != INVALID_HANDLE_VALUE );
123123
124124 Req .Type = DhcpReqReleaseParams ;
125- strcpy (Req .Body .AcquireParams .AdapterName , AdapterName );
125+ wcscpy (Req .Body .AcquireParams .AdapterName , AdapterName );
126126
127127 Result = TransactNamedPipe (PipeHandle ,
128128 & Req , sizeof (Req ),
Original file line number Diff line number Diff line change 55# PURPOSE: dhcpcsvc exports
66# COPYRIGHT: Copyright 2006 Ge van Geldorp <[email protected] > 77#
8- @ stdcall DhcpAcquireParameters ( str )
8+ @ stdcall DhcpAcquireParameters ( wstr )
99@ stub DhcpAcquireParametersByBroadcast
1010@ stdcall DhcpCApiCleanup ( )
1111@ stdcall DhcpCApiInitialize ( ptr )
2727@ stub DhcpRegisterParamChange
2828@ stdcall DhcpReleaseIpAddressLease ( long )
2929@ stub DhcpReleaseIpAddressLeaseEx
30- @ stdcall DhcpReleaseParameters ( str )
30+ @ stdcall DhcpReleaseParameters ( wstr )
3131@ stub DhcpRemoveDNSRegistrations
3232@ stdcall DhcpRenewIpAddressLease ( long )
3333@ stub DhcpRenewIpAddressLeaseEx
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ void AdapterStop(VOID);
9090extern PDHCP_ADAPTER AdapterGetFirst (VOID );
9191extern PDHCP_ADAPTER AdapterGetNext (PDHCP_ADAPTER );
9292extern PDHCP_ADAPTER AdapterFindIndex ( unsigned int AdapterIndex );
93- extern PDHCP_ADAPTER AdapterFindName (const CHAR * name );
93+ extern PDHCP_ADAPTER AdapterFindName (const WCHAR * name );
9494extern PDHCP_ADAPTER AdapterFindInfo ( struct interface_info * info );
9595extern PDHCP_ADAPTER AdapterFindByHardwareAddress ( u_int8_t haddr [16 ], u_int8_t hlen );
9696extern HANDLE PipeInit (HANDLE hStopEvent );
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ typedef struct _COMM_DHCP_REQ {
1818 {
1919 struct
2020 {
21- CHAR AdapterName [64 ];
21+ WCHAR AdapterName [45 ];
2222 } AcquireParams ;
2323 struct {
2424 BOOL Inserted ;
Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ extern "C" {
88DWORD
99APIENTRY
1010DhcpAcquireParameters (
11- _In_ PSTR AdapterName );
11+ _In_ PWSTR AdapterName );
1212
1313DWORD
1414APIENTRY
1515DhcpReleaseParameters (
16- _In_ PSTR AdapterName );
16+ _In_ PWSTR AdapterName );
1717
1818DWORD APIENTRY DhcpLeaseIpAddress ( DWORD AdapterIndex );
1919DWORD APIENTRY DhcpQueryHWInfo ( DWORD AdapterIndex ,
You can’t perform that action at this time.
0 commit comments