The function
gpgme_newcreates a newgpgme_ctx_tobject and returns a handle for it in ctx.The function returns the error code
GPG_ERR_NO_ERRORif the context was successfully created,GPG_ERR_INV_VALUEif ctx is not a valid pointer, andGPG_ERR_ENOMEMif not enough memory is available. Also, it returnsGPG_ERR_NOT_OPERATIONALifgpgme_check_versionwas not called to initialize GPGME, andGPG_ERR_SELFTEST_FAILEDif a selftest failed. Currently, the only selftest is for Windows MingW32 targets to see if-mms-bitfieldswas used (as required).