diff options
Diffstat (limited to 'src/ccapi/lib')
-rw-r--r-- | src/ccapi/lib/win/Makefile.in | 110 | ||||
-rw-r--r-- | src/ccapi/lib/win/ccapi_os_ipc.cxx | 12 | ||||
-rw-r--r-- | src/ccapi/lib/win/ccs_reply_proc.c | 9 |
3 files changed, 120 insertions, 11 deletions
diff --git a/src/ccapi/lib/win/Makefile.in b/src/ccapi/lib/win/Makefile.in new file mode 100644 index 0000000..ab958d7 --- /dev/null +++ b/src/ccapi/lib/win/Makefile.in @@ -0,0 +1,110 @@ +# makefile: Constructs the Kerberos for Windows CCAPI DLL.
+#
+OBJS = $(OUTPRE)ccapi_ccache.obj \
+ $(OUTPRE)ccapi_ccache_iterator.obj \
+ $(OUTPRE)ccapi_context.obj \
+ $(OUTPRE)ccapi_context_change_time.obj \
+ $(OUTPRE)ccapi_credentials.obj \
+ $(OUTPRE)ccapi_credentials_iterator.obj \
+ $(OUTPRE)ccapi_ipc.obj \
+ $(OUTPRE)ccapi_os_ipc.obj \
+ $(OUTPRE)ccapi_string.obj \
+ $(OUTPRE)cci_array_internal.obj \
+ $(OUTPRE)cci_cred_union.obj \
+ $(OUTPRE)cci_debugging.obj \
+ $(OUTPRE)cci_identifier.obj \
+ $(OUTPRE)cci_message.obj \
+ $(OUTPRE)cci_os_debugging.obj \
+ $(OUTPRE)cci_os_identifier.obj \
+ $(OUTPRE)cci_stream.obj \
+ $(OUTPRE)ccs_reply_proc.obj \
+ $(OUTPRE)ccs_reply_s.obj \
+ $(OUTPRE)ccs_request_c.obj \
+ $(OUTPRE)ccutils.obj \
+ $(OUTPRE)client.obj \
+ $(OUTPRE)dllmain.obj \
+ $(OUTPRE)init.obj \
+ $(OUTPRE)rpc.obj \
+ $(OUTPRE)secure.obj \
+ $(OUTPRE)tls.obj \
+ $(OUTPRE)util.obj \
+ $(OUTPRE)win-utils.obj
+
+##### Options
+# Set NODEBUG if building release instead of debug
+
+#BUILDTOP is krb5/src and is relative to krb5/src/ccapi/lib/win, for making Makefile.
+BUILDTOP=..\..\..\
+CCAPI = $(BUILDTOP)\CCAPI
+CO = $(CCAPI)\common
+COWIN = $(CCAPI)\common\win
+CCUTIL = $(CCAPI)\common\win\OldCC
+LIBDIR = $(CCAPI)\lib
+LIBWIN = $(LIBDIR)\win
+POSIX = $(BUILDTOP)\lib\krb5\posix
+OLDCC = $(LIBWIN)\OldCC
+SRCTMP = $(LIBWIN)\srctmp
+
+!if defined(KRB5_KFW_COMPILE)
+KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
+!endif
+
+# Because all the sources are pulled together into the temp directory SRCTMP,
+# the only includes we need are to directories outside of ccapi.
+LOCALINCLUDES = /I..\$(BUILDTOP) /I..\$(BUILDTOP)\include /I..\$(BUILDTOP)\include\krb5 $(KFWINC) \
+ -I..\$(BUILDTOP)\util\et
+MIDLINCLUDES = /I..\$(BUILDTOP)\include
+
+CPPFLAGS = $(CPPFLAGS) /EHsc -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 \
+-D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS $(cvarsdll)
+
+
+##### Linker
+LINK = link
+LIBS = kernel32.lib ws2_32.lib user32.lib advapi32.lib
+LFLAGS = /nologo $(LOPTS)
+
+all:: Makefile copysrc midl $(OUTPRE)ccapi.dll finish
+
+ccs_request.h ccs_request_c.c ccs_request_s.c : ccs_request.idl ccs_request.acf
+ midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
+ ccs_request.idl
+
+ccs_reply.h ccs_reply_c.c ccs_reply_s.c : ccs_reply.idl ccs_reply.acf
+ midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
+ ccs_reply.idl
+
+copysrc :
+ echo "Copying all sources needed to build ccapi.dll to $(SRCTMP)"
+ if NOT exist $(SRCTMP)\nul mkdir $(SRCTMP)
+ xcopy /D/Y $(CO)\*.* $(SRCTMP)
+ xcopy /D/Y $(COWIN)\*.* $(SRCTMP)
+ xcopy /D/Y $(CCUTIL)\*.* $(SRCTMP)
+ xcopy /D/Y $(LIBDIR)\*.* $(SRCTMP)
+ xcopy /D/Y $(LIBWIN)\*.* $(SRCTMP)
+ xcopy /D/Y $(OLDCC)\*.* $(SRCTMP)
+ cd $(SRCTMP)
+ if NOT exist $(OUTPRE)\nul mkdir $(OUTPRE)
+
+midl : ccs_request.h ccs_reply.h
+
+# Main program:
+$(OUTPRE)ccapi.dll: $(OBJS) ccapi.def
+ $(LINK) $(LFLAGS) -entry:_DllMainCRTStartup@12 -dll /map:$*.map /out:$@ /DEF:ccapi.def $(OBJS) \
+ /implib:ccapi.lib $(dllflags) $(LIBS) $(KFWLIB) $(SCLIB) rpcrt4.lib $(conlibsdll) $(conflags)
+
+finish:
+ echo "Finished in ccapi/lib/win."
+ cd ..
+
+install::
+ echo "Doing nothing for make install"
+
+clean::
+ if exist $(OUTPRE)*.exe del $(OUTPRE)*.exe
+ if exist $(OUTPRE)*.obj del $(OUTPRE)*.obj
+ if exist $(OUTPRE)*.res del $(OUTPRE)*.res
+ if exist $(OUTPRE)*.map del $(OUTPRE)*.map
+ if exist $(OUTPRE)*.pdb del $(OUTPRE)*.pdb
+ if exist *.err del *.err
+ if exist $(SRCTMP) rm -rf $(SRCTMP)
\ No newline at end of file diff --git a/src/ccapi/lib/win/ccapi_os_ipc.cxx b/src/ccapi/lib/win/ccapi_os_ipc.cxx index 7fc57b3..617598b 100644 --- a/src/ccapi/lib/win/ccapi_os_ipc.cxx +++ b/src/ccapi/lib/win/ccapi_os_ipc.cxx @@ -95,8 +95,9 @@ extern "C" cc_int32 cci_os_ipc_thread_init (void) { if (!err) { // Save in thread local storage tspdata_setUUID(ptspdata, uuidString); } +#if 0 cci_debug_printf("%s UUID:<%s>", __FUNCTION__, tspdata_getUUID(ptspdata)); - +#endif // Initialize old CCAPI if necessary: if (!err) if (!Init:: Initialized()) err = Init:: Initialize( ); if (!err) if (!Client::Initialized()) err = Client::Initialize(0); @@ -191,9 +192,10 @@ extern "C" cc_int32 cci_os_ipc_msg( cc_int32 in_launch_server, if (!GetTspData(GetTlsIndex(), &ptspdata)) {return ccErrBadParam;} uuid = tspdata_getUUID(ptspdata); lenUUID = 1 + strlen(uuid); /* 1+ includes terminating \0. */ +#if 0 cci_debug_printf("%s calling remote ccs_rpc_request tsp*:0x%X", __FUNCTION__, ptspdata); cci_debug_printf(" rpcmsg:%d; UUID[%d]:<%s> SST:%ld", in_msg, lenUUID, uuid, sst); - +#endif ccs_rpc_request( /* make call with user message: */ in_msg, /* Message type */ (unsigned char*)&ptspdata, /* Our tspdata* will be sent back to the reply proc. */ @@ -217,9 +219,7 @@ extern "C" cc_int32 cci_os_ipc_msg( cc_int32 in_launch_server, // Wait for reply handler to set event: if (!err) { -// cci_debug_printf(" Waiting for request reply."); err = cci_check_error(WaitForSingleObject(replyEvent, INFINITE));//(SECONDS_TO_WAIT)*1000)); -// cci_debug_printf(" Request reply received!"); } if (!err) { @@ -357,7 +357,9 @@ cc_int32 ccapi_connect(const struct tspdata* tsp) { ReleaseMutex(hCCAPIv2Mutex); if (!status) { +#if 0 cci_debug_printf("%s Waiting for replyEvent.", __FUNCTION__); +#endif status = WaitForSingleObject(replyEvent, INFINITE);//(SECONDS_TO_WAIT)*1000); status = cci_check_error(RpcMgmtIsServerListening(CLIENT_REQUEST_RPC_HANDLE)); cci_debug_printf(" Server %sFOUND!", (status) ? "NOT " : ""); @@ -366,7 +368,5 @@ cc_int32 ccapi_connect(const struct tspdata* tsp) { cci_debug_printf(" unexpected error while looking for server... (%u)", status); } - cci_debug_printf("%s TODO: check connect reply result.", __FUNCTION__); - cci_debug_printf("%s TODO: merge this connect code with that request code.", __FUNCTION__); return status; }
\ No newline at end of file diff --git a/src/ccapi/lib/win/ccs_reply_proc.c b/src/ccapi/lib/win/ccs_reply_proc.c index 8d17bfc..79f45e4 100644 --- a/src/ccapi/lib/win/ccs_reply_proc.c +++ b/src/ccapi/lib/win/ccs_reply_proc.c @@ -49,10 +49,9 @@ void ccs_rpc_request_reply( struct tspdata* tsp = (struct tspdata*)*p; cci_stream_t stream; long status = 0; - +#if 0 cci_debug_printf("%s! msg#:%d SST:%ld uuid:%s", __FUNCTION__, rpcmsg, srvStartTime, uuid); -// cci_debug_printf(" uuid from handle:<%s>", tspdata_getUUID(tsp)); - +#endif if (!status) { status = cci_stream_new (&stream); /* Create a stream for the request data */ } @@ -79,9 +78,9 @@ void ccs_rpc_connect_reply( HANDLE hEvent = openThreadEvent(uuid, REPLY_SUFFIX); DWORD* p = (DWORD*)(tspHandle); - +#if 0 cci_debug_printf("%s! msg#:%d SST:%ld uuid:%s", __FUNCTION__, rpcmsg, srvStartTime, uuid); - +#endif SetEvent(hEvent); CloseHandle(hEvent); } |