VirtualBox

Ignore:
Timestamp:
Jul 8, 2020 7:33:26 PM (5 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h: Refactored the typedef use of DECLCALLBACK as well as DECLCALLBACKMEMBER to wrap the whole expression, similar to the DECLR?CALLBACKMEMBER macros. This allows adding a throw() at the end when compiling with the VC++ compiler to indicate that the callbacks won't throw anything, so we can stop supressing the C5039 warning about passing functions that can potential throw C++ exceptions to extern C code that can't necessarily cope with such (unwind,++). Introduced a few _EX variations that allows specifying different/no calling convention too, as that's handy when dynamically resolving host APIs. Fixed numerous places missing DECLCALLBACK and such. Left two angry @todos regarding use of CreateThread. bugref:9794

Location:
trunk/src/VBox/Runtime/common/crypto
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/RTCrPkcs5Pbkdf2Hmac-openssl.cpp

    r82968 r85121  
    3838
    3939# include "internal/iprt-openssl.h"
    40 # include "openssl/evp.h"
     40# include "internal/openssl-pre.h"
     41# include <openssl/evp.h>
     42# include "internal/openssl-post.h"
    4143
    4244
  • trunk/src/VBox/Runtime/common/crypto/RTCrRandBytes-openssl.cpp

    r82968 r85121  
    3838
    3939# include "internal/iprt-openssl.h"
    40 # include "openssl/rand.h"
     40# include "internal/openssl-pre.h"
     41# include <openssl/rand.h>
     42# include "internal/openssl-post.h"
    4143
    4244
  • trunk/src/VBox/Runtime/common/crypto/cipher-openssl.cpp

    r82968 r85121  
    4040
    4141# include "internal/iprt-openssl.h"
    42 # include "openssl/evp.h"
     42# include "internal/openssl-pre.h"
     43# include <openssl/evp.h>
     44# include "internal/openssl-post.h"
    4345
    4446# include "internal/magics.h"
  • trunk/src/VBox/Runtime/common/crypto/digest-builtin.cpp

    r84251 r85121  
    4343#ifdef IPRT_WITH_OPENSSL
    4444# include "internal/iprt-openssl.h"
     45# include "internal/openssl-pre.h"
    4546# include <openssl/evp.h>
     47# include "internal/openssl-post.h"
    4648#endif
    4749
  • trunk/src/VBox/Runtime/common/crypto/iprt-openssl.cpp

    r84310 r85121  
    3939
    4040# include "internal/iprt-openssl.h"
     41# include "internal/openssl-pre.h"
    4142# include <openssl/x509.h>
    4243# include <openssl/err.h>
     44# include "internal/openssl-post.h"
    4345
    4446
  • trunk/src/VBox/Runtime/common/crypto/key-create-rsa-openssl.cpp

    r82968 r85121  
    3737
    3838# include "internal/iprt-openssl.h"
     39# include "internal/openssl-pre.h"
    3940# include <openssl/rsa.h>
    4041# include <openssl/err.h>
     42# include "internal/openssl-post.h"
    4143
    4244# include "key-internal.h"
  • trunk/src/VBox/Runtime/common/crypto/key-file.cpp

    r82968 r85121  
    5050#ifdef IPRT_WITH_OPENSSL
    5151# include "internal/iprt-openssl.h"
    52 # include "openssl/evp.h"
     52# include "internal/openssl-pre.h"
     53# include <openssl/evp.h>
     54# include "internal/openssl-post.h"
    5355# ifndef OPENSSL_VERSION_NUMBER
    5456#  error "Missing OPENSSL_VERSION_NUMBER!"
  • trunk/src/VBox/Runtime/common/crypto/key-openssl.cpp

    r84230 r85121  
    4040# include "internal/iprt-openssl.h"
    4141# include "internal/magics.h"
    42 # include "openssl/evp.h"
     42# include "internal/openssl-pre.h"
     43# include <openssl/evp.h>
     44# include "internal/openssl-post.h"
    4345# ifndef OPENSSL_VERSION_NUMBER
    4446#  error "Missing OPENSSL_VERSION_NUMBER!"
  • trunk/src/VBox/Runtime/common/crypto/pkcs7-sign.cpp

    r84256 r85121  
    4242#ifdef IPRT_WITH_OPENSSL
    4343# include "internal/iprt-openssl.h"
     44# include "internal/openssl-pre.h"
    4445# include <openssl/pkcs7.h>
    4546# include <openssl/cms.h>
    4647# include <openssl/x509.h>
    4748# include <openssl/err.h>
     49# include "internal/openssl-post.h"
    4850#endif
    4951
  • trunk/src/VBox/Runtime/common/crypto/pkcs7-verify.cpp

    r84380 r85121  
    4343#ifdef IPRT_WITH_OPENSSL
    4444# include "internal/iprt-openssl.h"
     45# include "internal/openssl-pre.h"
    4546# include <openssl/pkcs7.h>
    4647# include <openssl/x509.h>
    4748# include <openssl/err.h>
     49# include "internal/openssl-post.h"
    4850#endif
    4951
  • trunk/src/VBox/Runtime/common/crypto/pkix-sign.cpp

    r84230 r85121  
    4141#ifdef IPRT_WITH_OPENSSL
    4242# include "internal/iprt-openssl.h"
    43 # include "openssl/evp.h"
    44 # include "openssl/rsa.h"
     43# include "internal/openssl-pre.h"
     44# include <openssl/evp.h>
     45# include <openssl/rsa.h>
     46# include "internal/openssl-post.h"
    4547# ifndef OPENSSL_VERSION_NUMBER
    4648#  error "Missing OPENSSL_VERSION_NUMBER!"
  • trunk/src/VBox/Runtime/common/crypto/pkix-signature-builtin.cpp

    r82968 r85121  
    3737#ifdef IPRT_WITH_OPENSSL
    3838# include "internal/iprt-openssl.h"
     39# include "internal/openssl-pre.h"
    3940# include <openssl/evp.h>
     41# include "internal/openssl-post.h"
    4042#endif
    4143
  • trunk/src/VBox/Runtime/common/crypto/pkix-util.cpp

    r84248 r85121  
    4040#ifdef IPRT_WITH_OPENSSL
    4141# include "internal/iprt-openssl.h"
    42 # include "openssl/evp.h"
     42# include "internal/openssl-pre.h"
     43# include <openssl/evp.h>
     44# include "internal/openssl-post.h"
    4345#endif
    4446
  • trunk/src/VBox/Runtime/common/crypto/pkix-verify.cpp

    r84230 r85121  
    3939#ifdef IPRT_WITH_OPENSSL
    4040# include "internal/iprt-openssl.h"
    41 # include "openssl/evp.h"
     41# include "internal/openssl-pre.h"
     42# include <openssl/evp.h>
     43# include "internal/openssl-post.h"
    4244# ifndef OPENSSL_VERSION_NUMBER
    4345#  error "Missing OPENSSL_VERSION_NUMBER!"
  • trunk/src/VBox/Runtime/common/crypto/rc4-openssl.cpp

    r82968 r85121  
    3232# include "internal/iprt.h"
    3333# include "internal/iprt-openssl.h"
    34 # include "openssl/rc4.h"
     34# include "internal/openssl-pre.h"
     35# include <openssl/rc4.h>
     36# include "internal/openssl-post.h"
    3537# include <iprt/crypto/rc4.h>
    3638
  • trunk/src/VBox/Runtime/common/crypto/ssl-openssl.cpp

    r82968 r85121  
    4242
    4343# include "internal/iprt-openssl.h"
     44# include "internal/openssl-pre.h"
    4445# include <openssl/ssl.h>
    4546# include <openssl/tls1.h>
     47# include "internal/openssl-post.h"
    4648
    4749
  • trunk/src/VBox/Runtime/common/crypto/store-internal.h

    r84329 r85121  
    4949     * @param   pCertCtx        The internal certificate context.
    5050     */
    51     DECLCALLBACKMEMBER(void, pfnDtor)(struct RTCRCERTCTXINT *pCertCtx);
     51    DECLCALLBACKMEMBER(void, pfnDtor,(struct RTCRCERTCTXINT *pCertCtx));
    5252    /** The public store context. */
    5353    RTCRCERTCTX             Public;
     
    7777     * @param   pvProvider      The provider specific data.
    7878     */
    79     DECLCALLBACKMEMBER(void, pfnDestroyStore)(void *pvProvider);
     79    DECLCALLBACKMEMBER(void, pfnDestroyStore,(void *pvProvider));
    8080
    8181    /**
     
    9393     * @param   pcbKeyRet       Where to return the size of the returned key.
    9494     */
    95     DECLCALLBACKMEMBER(int, pfnCertCtxQueryPrivateKey)(void *pvProvider, PRTCRCERTCTXINT pCertCtx,
    96                                                        uint8_t *pbKey, size_t cbKey, size_t *pcbKeyRet);
     95    DECLCALLBACKMEMBER(int, pfnCertCtxQueryPrivateKey,(void *pvProvider, PRTCRCERTCTXINT pCertCtx,
     96                                                       uint8_t *pbKey, size_t cbKey, size_t *pcbKeyRet));
    9797
    9898    /**
     
    104104     *                          provider should initalize this on success.
    105105     */
    106     DECLCALLBACKMEMBER(int, pfnCertFindAll)(void *pvProvider, PRTCRSTORECERTSEARCH pSearch);
     106    DECLCALLBACKMEMBER(int, pfnCertFindAll,(void *pvProvider, PRTCRSTORECERTSEARCH pSearch));
    107107
    108108    /**
     
    114114     * @param   pSearch         Pointer to opaque search state structure.
    115115     */
    116     DECLCALLBACKMEMBER(PCRTCRCERTCTX, pfnCertSearchNext)(void *pvProvider, PRTCRSTORECERTSEARCH pSearch);
     116    DECLCALLBACKMEMBER(PCRTCRCERTCTX, pfnCertSearchNext,(void *pvProvider, PRTCRSTORECERTSEARCH pSearch));
    117117
    118118    /**
     
    122122     * @param   pSearch         Pointer to opaque search state structure to destroy.
    123123     */
    124     DECLCALLBACKMEMBER(void, pfnCertSearchDestroy)(void *pvProvider, PRTCRSTORECERTSEARCH pSearch);
     124    DECLCALLBACKMEMBER(void, pfnCertSearchDestroy,(void *pvProvider, PRTCRSTORECERTSEARCH pSearch));
    125125
    126126    /**
     
    136136     * @param   pErrInfo        Where to store extended error info. Optional.
    137137     */
    138     DECLCALLBACKMEMBER(int, pfnCertAddEncoded)(void *pvProvider, uint32_t fFlags, uint8_t const *pbEncoded, uint32_t cbEncoded,
    139                                                PRTERRINFO pErrInfo);
     138    DECLCALLBACKMEMBER(int, pfnCertAddEncoded,(void *pvProvider, uint32_t fFlags, uint8_t const *pbEncoded, uint32_t cbEncoded,
     139                                               PRTERRINFO pErrInfo));
    140140
    141141
     
    151151     * @param   phSearch        Pointer to a provider specific search handle.
    152152     */
    153     DECLCALLBACKMEMBER(int, pfnCertFindByIssuerAndSerialNo)(void *pvProvider, PCRTCRX509NAME pIssuer, PCRTASN1INTEGER pSerialNo,
    154                                                             PRTCRSTORECERTSEARCH phSearch);
     153    DECLCALLBACKMEMBER(int, pfnCertFindByIssuerAndSerialNo,(void *pvProvider, PCRTCRX509NAME pIssuer, PCRTASN1INTEGER pSerialNo,
     154                                                            PRTCRSTORECERTSEARCH phSearch));
    155155    /** Non-zero end marker. */
    156156    uintptr_t               uEndMarker;
  • trunk/src/VBox/Runtime/common/crypto/store.cpp

    r84329 r85121  
    4141
    4242#ifdef IPRT_WITH_OPENSSL
     43# include "internal/openssl-pre.h"
    4344# include <openssl/x509.h>
     45# include "internal/openssl-post.h"
    4446#endif
    4547
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette