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
4d6ff854
Commit
4d6ff854
authored
May 09, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
May 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Add a stub implementation of RpcServerInqDefaultPrincNameA/W.
parent
1157cccc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
2 deletions
+103
-2
rpc_server.c
dlls/rpcrt4/rpc_server.c
+40
-0
rpcrt4.spec
dlls/rpcrt4/rpcrt4.spec
+2
-2
rpc.c
dlls/rpcrt4/tests/rpc.c
+55
-0
rpcdce.h
include/rpcdce.h
+6
-0
No files found.
dlls/rpcrt4/rpc_server.c
View file @
4d6ff854
...
...
@@ -44,6 +44,7 @@
#include "rpc_message.h"
#include "rpc_defs.h"
#include "ncastatus.h"
#include "secext.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
rpc
);
...
...
@@ -1457,6 +1458,45 @@ RPC_STATUS WINAPI RpcServerRegisterAuthInfoW( RPC_WSTR ServerPrincName, ULONG Au
return
RPC_S_OK
;
}
/******************************************************************************
* RpcServerInqDefaultPrincNameA (rpcrt4.@)
*/
RPC_STATUS
RPC_ENTRY
RpcServerInqDefaultPrincNameA
(
ULONG
AuthnSvc
,
RPC_CSTR
*
PrincName
)
{
RPC_STATUS
ret
;
RPC_WSTR
principalW
;
TRACE
(
"%u, %p
\n
"
,
AuthnSvc
,
PrincName
);
if
((
ret
=
RpcServerInqDefaultPrincNameW
(
AuthnSvc
,
&
principalW
))
==
RPC_S_OK
)
{
if
(
!
(
*
PrincName
=
(
RPC_CSTR
)
RPCRT4_strdupWtoA
(
principalW
)))
return
RPC_S_OUT_OF_MEMORY
;
RpcStringFreeW
(
&
principalW
);
}
return
ret
;
}
/******************************************************************************
* RpcServerInqDefaultPrincNameW (rpcrt4.@)
*/
RPC_STATUS
RPC_ENTRY
RpcServerInqDefaultPrincNameW
(
ULONG
AuthnSvc
,
RPC_WSTR
*
PrincName
)
{
ULONG
len
=
0
;
FIXME
(
"%u, %p
\n
"
,
AuthnSvc
,
PrincName
);
if
(
AuthnSvc
!=
RPC_C_AUTHN_WINNT
)
return
RPC_S_UNKNOWN_AUTHN_SERVICE
;
GetUserNameExW
(
NameSamCompatible
,
NULL
,
&
len
);
if
(
GetLastError
()
!=
ERROR_MORE_DATA
)
return
RPC_S_INTERNAL_ERROR
;
if
(
!
(
*
PrincName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
RPC_S_OUT_OF_MEMORY
;
GetUserNameExW
(
NameSamCompatible
,
*
PrincName
,
&
len
);
return
RPC_S_OK
;
}
/***********************************************************************
* RpcServerListen (RPCRT4.@)
*/
...
...
dlls/rpcrt4/rpcrt4.spec
View file @
4d6ff854
...
...
@@ -427,8 +427,8 @@
@ stdcall RpcServerInqBindings(ptr)
@ stub RpcServerInqCallAttributesA # wxp
@ stub RpcServerInqCallAttributesW # wxp
@ st
ub RpcServerInqDefaultPrincNameA
@ st
ub RpcServerInqDefaultPrincNameW
@ st
dcall RpcServerInqDefaultPrincNameA(long ptr)
@ st
dcall RpcServerInqDefaultPrincNameW(long ptr)
@ stub RpcServerInqIf
@ stdcall RpcServerListen(long long long)
@ stdcall RpcServerRegisterAuthInfoA(str long ptr ptr)
...
...
dlls/rpcrt4/tests/rpc.c
View file @
4d6ff854
...
...
@@ -31,6 +31,7 @@
#include "rpc.h"
#include "rpcdce.h"
#include "secext.h"
typedef
unsigned
int
unsigned32
;
typedef
struct
twr_t
...
...
@@ -854,6 +855,59 @@ static void test_RpcBindingFree(void)
status
);
}
static
void
test_RpcServerInqDefaultPrincName
(
void
)
{
RPC_STATUS
ret
;
RPC_CSTR
principal
,
saved_principal
;
BOOLEAN
(
WINAPI
*
pGetUserNameExA
)(
EXTENDED_NAME_FORMAT
,
LPSTR
,
PULONG
);
char
*
username
;
ULONG
len
=
0
;
pGetUserNameExA
=
(
void
*
)
GetProcAddress
(
LoadLibraryA
(
"secur32.dll"
),
"GetUserNameExA"
);
if
(
!
pGetUserNameExA
)
{
win_skip
(
"GetUserNameExA not exported
\n
"
);
return
;
}
pGetUserNameExA
(
NameSamCompatible
,
NULL
,
&
len
);
username
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
pGetUserNameExA
(
NameSamCompatible
,
username
,
&
len
);
ret
=
RpcServerInqDefaultPrincNameA
(
0
,
NULL
);
ok
(
ret
==
RPC_S_UNKNOWN_AUTHN_SERVICE
,
"got %u
\n
"
,
ret
);
ret
=
RpcServerInqDefaultPrincNameA
(
RPC_C_AUTHN_DEFAULT
,
NULL
);
ok
(
ret
==
RPC_S_UNKNOWN_AUTHN_SERVICE
,
"got %u
\n
"
,
ret
);
principal
=
(
RPC_CSTR
)
0xdeadbeef
;
ret
=
RpcServerInqDefaultPrincNameA
(
RPC_C_AUTHN_DEFAULT
,
&
principal
);
ok
(
ret
==
RPC_S_UNKNOWN_AUTHN_SERVICE
,
"got %u
\n
"
,
ret
);
ok
(
principal
==
(
RPC_CSTR
)
0xdeadbeef
,
"got unexpected principal
\n
"
);
saved_principal
=
(
RPC_CSTR
)
0xdeadbeef
;
ret
=
RpcServerInqDefaultPrincNameA
(
RPC_C_AUTHN_WINNT
,
&
saved_principal
);
ok
(
ret
==
RPC_S_OK
,
"got %u
\n
"
,
ret
);
ok
(
saved_principal
!=
(
RPC_CSTR
)
0xdeadbeef
,
"expected valid principal
\n
"
);
ok
(
!
strcmp
(
(
const
char
*
)
saved_principal
,
username
),
"got
\'
%s
\'\n
"
,
saved_principal
);
trace
(
"%s
\n
"
,
saved_principal
);
ret
=
RpcServerRegisterAuthInfoA
(
(
RPC_CSTR
)
"wine
\\
test"
,
RPC_C_AUTHN_WINNT
,
NULL
,
NULL
);
ok
(
ret
==
RPC_S_OK
,
"got %u
\n
"
,
ret
);
principal
=
(
RPC_CSTR
)
0xdeadbeef
;
ret
=
RpcServerInqDefaultPrincNameA
(
RPC_C_AUTHN_WINNT
,
&
principal
);
ok
(
ret
==
RPC_S_OK
,
"got %u
\n
"
,
ret
);
ok
(
principal
!=
(
RPC_CSTR
)
0xdeadbeef
,
"expected valid principal
\n
"
);
ok
(
!
strcmp
(
(
const
char
*
)
principal
,
username
),
"got
\'
%s
\'\n
"
,
principal
);
RpcStringFree
(
&
principal
);
ret
=
RpcServerRegisterAuthInfoA
(
saved_principal
,
RPC_C_AUTHN_WINNT
,
NULL
,
NULL
);
ok
(
ret
==
RPC_S_OK
,
"got %u
\n
"
,
ret
);
RpcStringFree
(
&
saved_principal
);
HeapFree
(
GetProcessHeap
(),
0
,
username
);
}
START_TEST
(
rpc
)
{
UuidConversionAndComparison
();
...
...
@@ -867,4 +921,5 @@ START_TEST( rpc )
test_UuidCreate
();
test_UuidCreateSequential
();
test_RpcBindingFree
();
test_RpcServerInqDefaultPrincName
();
}
include/rpcdce.h
View file @
4d6ff854
...
...
@@ -611,6 +611,12 @@ RPCRTAPI unsigned short RPC_ENTRY
RPCRTAPI
int
RPC_ENTRY
UuidIsNil
(
UUID
*
Uuid
,
RPC_STATUS
*
Status_
);
RPCRTAPI
RPC_STATUS
RPC_ENTRY
RpcServerInqDefaultPrincNameA
(
ULONG
AuthnSvc
,
RPC_CSTR
*
PrincName
);
RPCRTAPI
RPC_STATUS
RPC_ENTRY
RpcServerInqDefaultPrincNameW
(
ULONG
AuthnSvc
,
RPC_WSTR
*
PrincName
);
#define RpcServerInqDefaultPrincName WINELIB_NAME_AW(RpcServerInqDefaultPrincName)
#ifdef __cplusplus
}
#endif
...
...
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