20 #if defined( INC_ALL )
37 #if defined( _MSC_VER ) && ( _MSC_VER == 1200 ) && 0
38 #include "../../../Intel/VTune/tcheck/Include/libittnotify.h"
39 #pragma comment( lib, "C:/Program Files/Intel/VTune/Analyzer/Lib/libittnotify.lib" )
41 #define THREAD_NOTIFY_PREPARE( id ) __itt_notify_sync_prepare( ( void * ) id );
42 #define THREAD_NOTIFY_CANCELLED( id ) __itt_notify_sync_prepare( ( void * ) id );
43 #define THREAD_NOTIFY_ACQUIRED( id ) __itt_notify_sync_acquired( ( void * ) id );
44 #define THREAD_NOTIFY_RELEASED( id ) __itt_notify_sync_releasing( ( void * ) id );
46 #define THREAD_NOTIFY_PREPARE( dummy )
47 #define THREAD_NOTIFY_CANCELLED( dummy )
48 #define THREAD_NOTIFY_ACQUIRED( dummy )
49 #define THREAD_NOTIFY_RELEASED( dummy )
104 static
int checkAccessValid(
IN_HANDLE const int objectHandle,
124 objectInfoPtr = &objectTable[ objectHandle ];
127 switch( objectInfoPtr->type )
203 static
int getObject(
IN_HANDLE const int objectHandle,
215 objectPtr == NULL && refCount > 0 ) || \
218 isWritePtr( objectPtr,
sizeof(
void * ) ) && \
231 objectPtr == NULL && refCount > 0 ) || \
237 if( objectPtr != NULL )
247 status = checkAccessValid( objectHandle, checkType, errorCode );
258 objectPtr != NULL ) || \
259 objectTable[ objectHandle ].type != type )
267 objectInfoPtr = &objectTable[ objectHandle ];
278 status = waitForObject( objectHandle, &objectInfoPtr );
298 REQUIRES( refCount > 0 && refCount < 100 );
305 if( objectPtr != NULL )
319 static int releaseObject(
IN_HANDLE const int objectHandle,
329 refCount == NULL ) || \
338 refCount == NULL ) || \
340 refCount != NULL ) );
355 status = checkAccessValid( objectHandle, checkType,
376 objectInfoPtr = &objectTable[ objectHandle ];
425 krnlData = krnlDataPtr;
444 int krnlAcquireObject(
IN_HANDLE const int objectHandle,
466 int krnlSuspendObject(
IN_HANDLE const int objectHandle,
476 return( getObject( objectHandle,
510 #if defined( INC_ALL )
522 IN_BUFFER( accessKeyLen )
const char *accessKey,
529 assert(
isReadPtr( accessKey, accessKeyLen ) );
536 memset( keyData, 0, keyDataLen );
539 ENSURES( accessKeyLen == 7 && !memcmp( accessKey,
"keydata", 7 ) );
561 switch( contextInfoPtr->
type )
564 if( contextInfoPtr->ctxConv->userKeyLength <
MIN_KEYSIZE || \
565 contextInfoPtr->ctxConv->userKeyLength > keyDataLen )
567 DEBUG_DIAG((
"Key data is too long to export" ));
573 memcpy( keyData, contextInfoPtr->ctxConv->userKey,
574 contextInfoPtr->ctxConv->userKeyLength );
579 if( contextInfoPtr->ctxMAC->userKeyLength <
MIN_KEYSIZE || \
580 contextInfoPtr->ctxMAC->userKeyLength > keyDataLen )
582 DEBUG_DIAG((
"Key data is too long to export" ));
588 memcpy( keyData, contextInfoPtr->ctxMAC->userKey,
589 contextInfoPtr->ctxMAC->userKeyLength );
594 if( contextInfoPtr->ctxGeneric->genericSecretLength <
MIN_KEYSIZE || \
595 contextInfoPtr->ctxGeneric->genericSecretLength > keyDataLen )
597 DEBUG_DIAG((
"Key data is too long to export" ));
603 memcpy( keyData, contextInfoPtr->ctxGeneric->genericSecret,
604 contextInfoPtr->ctxGeneric->genericSecretLength );
619 IN_BUFFER( accessKeyLen )
const char *accessKey,
626 assert(
isReadPtr( accessKey, accessKeyLen ) );
633 ENSURES( accessKeyLen == 11 && !memcmp( accessKey,
"private_key", 11 ) );
653 status = contextInfoPtr->ctxPKC->writePrivateKeyFunction( stream,
654 contextInfoPtr, formatType,
655 accessKey, accessKeyLen );
692 status = contextInfoPtr->ctxPKC->readPrivateKeyFunction( stream,
693 contextInfoPtr, formatType );
698 status = contextInfoPtr->loadKeyFunction( contextInfoPtr, NULL, 0 );
708 status = contextInfoPtr->ctxPKC->calculateKeyIDFunction( contextInfoPtr );
714 CRYPT_IATTRIBUTE_INITIALISED );