diff --git a/ykcs11/pkcs11.h b/ykcs11/pkcs11.h index 3d7e166..53b8df4 100644 --- a/ykcs11/pkcs11.h +++ b/ykcs11/pkcs11.h @@ -239,6 +239,9 @@ extern "C" { #define __PASTE(x,y) x##y +#if defined _WIN32 || _WIN64 +#pragma pack(push, cryptoki, 1) +#endif /* packing defines */ //#include "pkcs11p.h" // TODO: msc specific? @@ -309,6 +312,11 @@ struct CK_FUNCTION_LIST { /* unpack */ //#include "pkcs11u.h" // TODO: msc specific? +#if defined _WIN32 || _WIN64 +#pragma pack(pop, cryptoki) +#endif + + #ifdef __cplusplus } #endif diff --git a/ykcs11/pkcs11t.h b/ykcs11/pkcs11t.h index 4e0569c..e24b372 100644 --- a/ykcs11/pkcs11t.h +++ b/ykcs11/pkcs11t.h @@ -108,7 +108,9 @@ typedef CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR; /* pack */ -//#include "pkcs11p.h" // TODO: msc specific? +#if defined _WIN32 || _WIN64 +#pragma pack(push, cryptoki, 1) +#endif typedef struct CK_VERSION { CK_BYTE major; /* integer portion of version number */ @@ -1182,9 +1184,6 @@ typedef CK_EXTRACT_PARAMS CK_PTR CK_EXTRACT_PARAMS_PTR; #define CKA_NETSCAPE_DB 0xD5A0DB00UL #define CKA_NETSCAPE_TRUST 0x80000001UL -/* undo packing */ -//#include "pkcs11u.h" // TODO: msc specific? - // YUBICO specific attributes #define CKA_TOUCH_PIN_DEFAULT 0x00000000U #define CKA_TOUCH_ALWAYS 0x00000001U @@ -1193,4 +1192,9 @@ typedef CK_EXTRACT_PARAMS CK_PTR CK_EXTRACT_PARAMS_PTR; #define CKA_PIN_NEVER 0x00000008U #define CKA_TOUCH_NEVER 0x00000016U +/* undo packing */ +#if defined _WIN32 || _WIN64 +#pragma pack(pop, cryptoki) +#endif + #endif