summaryrefslogtreecommitdiffstats
path: root/src/lib/ccapi/windows/client.c
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>2006-10-21 20:20:30 +0000
committerSam Hartman <hartmans@mit.edu>2006-10-21 20:20:30 +0000
commitfaa68ad5ae7d1504b8be9e8a7bedb0b6e533d3cd (patch)
tree314105a642beca7c1117bd24b069719e37ac3b35 /src/lib/ccapi/windows/client.c
parentc1c08a16cde35a876a8c7fd36470cc7a1f2536c3 (diff)
downloadkrb5-faa68ad5ae7d1504b8be9e8a7bedb0b6e533d3cd.tar.gz
krb5-faa68ad5ae7d1504b8be9e8a7bedb0b6e533d3cd.tar.xz
krb5-faa68ad5ae7d1504b8be9e8a7bedb0b6e533d3cd.zip
Delete src/lib/ccapi.
The ccapi shipped in 1.6 will not be based off this code and will live in src/ccapi. It will be copied onto the trunk and branch when ready, but this code is being removed before the branch cut. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18731 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/ccapi/windows/client.c')
-rw-r--r--src/lib/ccapi/windows/client.c141
1 files changed, 0 insertions, 141 deletions
diff --git a/src/lib/ccapi/windows/client.c b/src/lib/ccapi/windows/client.c
deleted file mode 100644
index e30801dab..000000000
--- a/src/lib/ccapi/windows/client.c
+++ /dev/null
@@ -1,141 +0,0 @@
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <tchar.h>
-#include "ntccrpc.h"
-#include <strsafe.h>
-#include "CredentialsCache.h"
-#include "msg.h"
-
-static RPC_BINDING_HANDLE hRpcBinding;
-
-void * __RPC_USER MIDL_user_allocate(size_t s) {
- return malloc(s);
-}
-
-void __RPC_USER MIDL_user_free(void * p) {
- free(p);
-}
-
-int cc_rpc_init(void) {
- RPC_STATUS status;
- TCHAR * bindstring = NULL;
- RPC_SECURITY_QOS sqos;
-
- status = RpcStringBindingCompose(NULL,
- _T("ncalrpc"),
- NULL,
- NULL,
- NULL,
- &bindstring);
-
- if (status != RPC_S_OK) {
- fprintf(stderr, "RpcStringBindingCompose failed: %d\n",
- status);
- return 1;
- }
-
- status = RpcBindingFromStringBinding(bindstring,
- &hRpcBinding);
-
- if (status != RPC_S_OK) {
- fprintf(stderr, "RpcBindingFromStringBinding failed: %d\n",
- status);
- return 1;
- }
-
- status = RpcStringFree(&bindstring);
-
- ZeroMemory(&sqos, sizeof(sqos));
-
- sqos.Version = 1;
- sqos.Capabilities = RPC_C_QOS_CAPABILITIES_DEFAULT;
- sqos.IdentityTracking = RPC_C_QOS_IDENTITY_STATIC;
- sqos.ImpersonationType = RPC_C_IMP_LEVEL_IMPERSONATE;
-
- status = RpcBindingSetAuthInfoEx(hRpcBinding,
- NULL,
- RPC_C_AUTHN_LEVEL_CALL,
- RPC_C_AUTHN_WINNT,
- NULL,
- 0,
- &sqos);
- if (status != RPC_S_OK) {
- fprintf(stderr, "RpcBindingSetAuthInfoEx failed: %d\n",
- status);
- return 1;
- }
-
- return 0;
-}
-
-int cc_rpc_cleanup(void) {
- RPC_STATUS status;
-
- status = RpcBindingFree(&hRpcBinding);
-
- return 0;
-}
-
-cc_int32 cci_set_thread_session_id(unsigned char * client_name, LUID luid) {
- return 0;
-}
-
-void cci_get_thread_session_id(unsigned char * client_name, int len, LUID *pluid) {
- client_name[0] = '\0';
- pluid->HighPart = 0;
- pluid->LowPart = 0;
-}
-
-
-/* __int32 ccapi_Message(
- * [in] handle_t h,
- * [string][in] unsigned char *client_name,
- * [in] struct _LUID luid,
- * [in] __int32 cb_buffer,
- * [out] __int32 *cb_len,
- * [size_is][string][out] unsigned char buffer[ ]);
- */
-
-cc_int32 cci_perform_rpc(cc_msg_t *request, cc_msg_t **response)
-{
- cc_int32 code;
- unsigned char client_name[256];
- LUID luid;
- struct __LUID __luid;
- unsigned char out_buf[MAXMSGLEN];
- __int32 out_len = MAXMSGLEN;
-
- if (cc_rpc_init())
- return -1;
-
- cci_get_thread_session_id(client_name, sizeof(client_name), &luid);
-
- __luid.HighPart = luid.HighPart;
- __luid.LowPart = luid.LowPart;
-
- /* flatten response */
- code = cci_msg_flatten(request, NULL);
- if (code)
- goto cleanup;
-
- RpcTryExcept {
- code = ccapi_Message(hRpcBinding, client_name, __luid,
- request->flat, request->flat_len,
- out_buf, &out_len);
- }
- RpcExcept(1) {
- code = RpcExceptionCode();
- }
- RpcEndExcept;
- if (code)
- goto cleanup;
-
- /* unflatten message */
- code = cci_msg_unflatten(out_buf, out_len, response);
- if (code)
- goto cleanup;
-
- cleanup:
- return code;
-}