X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot-ui.git;a=blobdiff_plain;f=libmoonshot%2Flibmoonshot-msrpc.c;h=6a2010d89241ff4917167c4e3df7e300aed7500f;hp=8e59c1a6ea2d602e4c2c0d094239ebd6049071c2;hb=cc8495fdeae73745d095525e843c750e7c277dce;hpb=a9a03c418e8bbf0042652489277563b3b35ba36a diff --git a/libmoonshot/libmoonshot-msrpc.c b/libmoonshot/libmoonshot-msrpc.c index 8e59c1a..6a2010d 100644 --- a/libmoonshot/libmoonshot-msrpc.c +++ b/libmoonshot/libmoonshot-msrpc.c @@ -142,7 +142,7 @@ static void launch_server (MoonshotError **error) { } length = 1023; - status = RegQueryValueEx (key, NULL, NULL, &value_type, exe_path, &length); + status = RegQueryValueEx (key, NULL, NULL, &value_type, (LPBYTE )exe_path, &length); if (value_type != REG_SZ) { *error = moonshot_error_new_with_status @@ -165,7 +165,6 @@ static void launch_server (MoonshotError **error) { } startup_info.cb = sizeof (startup_info); - success = CreateProcess (exe_path, NULL, NULL, @@ -231,7 +230,6 @@ static void bind_rpc (MoonshotError **error) static void init_rpc (MoonshotError **error) { static volatile LONG binding_init_flag = 2; - int status; /* Hack to avoid requiring a moonshot_init() function. Windows does not * provide any synchronisation primitives that can be statically init'ed, @@ -274,7 +272,7 @@ int moonshot_get_identity (const char *nai, char **subject_alt_name_constraint_out, MoonshotError **error) { - int success; + int success = FALSE; RpcAsyncCall call; init_rpc (error); @@ -337,7 +335,7 @@ int moonshot_get_default_identity (char **nai_out, char **subject_alt_name_constraint_out, MoonshotError **error) { - int success; + int success = FALSE; RpcAsyncCall call; init_rpc (error); @@ -404,6 +402,8 @@ int moonshot_install_id_card (const char *display_name, int success = FALSE; init_rpc (error); + if (*error != NULL) + return FALSE; if (user_name == NULL) user_name = ""; if (password == NULL) password = ""; @@ -435,7 +435,6 @@ int moonshot_install_id_card (const char *display_name, RPC_GET_EXCEPTION_CODE ()); } RPC_END_EXCEPT - return success; }