/*\r
* Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2006 Secure Endpoints Inc.\r
*\r
* Permission is hereby granted, free of charge, to any person\r
* obtaining a copy of this software and associated documentation\r
size_t scb = 0;\r
\r
rv = khc_read_multi_string(csp_module, L"PluginList", NULL, &cb);\r
- if(rv != KHM_ERROR_TOO_LONG)\r
- goto _exit;\r
+ if(rv != KHM_ERROR_TOO_LONG) {\r
+ if (rv == KHM_ERROR_NOT_FOUND) {\r
+\r
+ scb = cb = cch * sizeof(wchar_t);\r
+ pl = PMALLOC(cb);\r
+ multi_string_init(pl, cb);\r
+ rv = KHM_ERROR_SUCCESS;\r
+\r
+ goto add_plugin_to_list;\r
+\r
+ } else {\r
+ goto _exit;\r
+ }\r
+ }\r
\r
cb += cch * sizeof(wchar_t);\r
scb = cb;\r
goto _exit;\r
}\r
\r
+ add_plugin_to_list:\r
+\r
if(!multi_string_find(pl, plugin->name, 0)) {\r
multi_string_append(pl, &scb, plugin->name);\r
rv = khc_write_multi_string(csp_module, L"PluginList", pl);\r