unsigned long cipherEnableFlags) { SECMODModule *module; SECStatus result = SECFailure; int s,i; PK11SlotInfo* slot;  PR_SetErrorText(0, NULL);  module = SECMOD_CreateModule(dllPath,moduleName,NULL, NULL);  if (module->dllName != NULL) { if (module->dllName[0] != 0) { result = SECMOD_AddModule(module); if (result == SECSuccess) {  module->ssl[0] = cipherEnableFlags;   for (s = 0; s < module->slotCount; s++) { slot = (module->slots)[s];  for (i=0; i < num_pk11_default_mechanisms; i++) {  if (PK11_DefaultArray[i].flag & defaultMechanismFlags) {  result = PK11_UpdateSlotAttribute(slot, &(PK11_DefaultArray[i]), PR_TRUE); } else {  result = PK11_UpdateSlotAttribute(slot, &(PK11_DefaultArray[i]), PR_FALSE); } }   if (defaultMechanismFlags & PK11_DISABLE_FLAG) { PK11_UserDisableSlot(slot); } }    result = SECMOD_UpdateModule(module); } } } SECMOD_DestroyModule(module); return result;
unsigned long cipherEnableFlags) { return SECMOD_AddNewModuleEx(moduleName, dllPath, defaultMechanismFlags, cipherEnableFlags, NULL, NULL);
SECStatus SECMOD_AddNewModule(char* moduleName, char* dllPath,                              unsigned long defaultMechanismFlags,                              unsigned long cipherEnableFlags) {    SECMODModule *module;    SECStatus result = SECFailure;    int s,i;    PK11SlotInfo* slot;    PR_SetErrorText(0, NULL);    module = SECMOD_CreateModule(dllPath,moduleName,NULL, NULL);    if (module->dllName != NULL) {        if (module->dllName[0] != 0) {            result = SECMOD_AddModule(module);            if (result == SECSuccess) {                /* turn on SSL cipher enable flags */                module->ssl[0] = cipherEnableFlags;                /* check each slot to turn on appropriate mechanisms */                for (s = 0; s < module->slotCount; s++) {                    slot = (module->slots)[s];                    /* for each possible mechanism */                    for (i=0; i < num_pk11_default_mechanisms; i++) {                        /* we are told to turn it on by default ? */                        if (PK11_DefaultArray[i].flag & defaultMechanismFlags) {                                                        /* it ignores if slot attribute update failes */                            result = PK11_UpdateSlotAttribute(slot, &(PK11_DefaultArray[i]), PR_TRUE);                        } else { /* turn this mechanism of the slot off by default */                            result = PK11_UpdateSlotAttribute(slot, &(PK11_DefaultArray[i]), PR_FALSE);                        }                    } /* for each mechanism */                    /* disable each slot if the defaultFlags say so */                    if (defaultMechanismFlags & PK11_DISABLE_FLAG) {                        PK11_UserDisableSlot(slot);                    }                } /* for each slot of this module */                /* delete and re-add module in order to save changes to the module */		result = SECMOD_UpdateModule(module);            }        }    }    SECMOD_DestroyModule(module);    return result;}