From e024a13a4d7b35e9065bdf0cde5c3770bbe43ee0 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 28 Oct 2015 21:31:28 +0000 Subject: MirLua: removed own guid parser git-svn-id: http://svn.miranda-ng.org/main/trunk@15642 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_core.cpp | 3 +-- plugins/MirLua/src/m_genmenu.cpp | 11 ++--------- plugins/MirLua/src/mlua_options.cpp | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) (limited to 'plugins') diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 228a0d6f38..a9a6bcf280 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -182,8 +182,7 @@ static int lua_IsPluginLoaded(lua_State *L) const char *value = lua_tostring(L, 1); MUUID uuid = { 0 }; - int res = sscanf_s(value, "{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}", - &uuid.a, &uuid.b, &uuid.c, &uuid.d[0], &uuid.d[1], &uuid.d[2], &uuid.d[3], &uuid.d[4], &uuid.d[5], &uuid.d[6], &uuid.d[7]) == 11; + int res = CLSIDFromString((LPCOLESTR)ptrT(mir_utf8decodeT(value)), (LPCLSID)&uuid) == NOERROR; if (res == TRUE) res = ::IsPluginLoaded(uuid); lua_pushboolean(L, res); diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index 09b64bbc65..1c729c43c9 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -15,15 +15,8 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) lua_pushliteral(L, "Uid"); lua_gettable(L, -2); const char* uuid = (char*)lua_tostring(L, -1); - if (uuid) - { - unsigned long a; - unsigned short b, c; - unsigned char d[8]; - if (sscanf_s(uuid, "{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}", - &a, &b, &c, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]) == 11) - SET_UID(mi, a, b, c, d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7]); - } + if (CLSIDFromString((LPCOLESTR)ptrT(mir_utf8decodeT(uuid)), (LPCLSID)&mi.uid) != NOERROR) + UNSET_UID(mi); lua_pop(L, 1); lua_pushliteral(L, "Name"); diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp index 3aad7345cd..61b3cd7166 100644 --- a/plugins/MirLua/src/mlua_options.cpp +++ b/plugins/MirLua/src/mlua_options.cpp @@ -59,9 +59,9 @@ void CLuaOptions::LoadScripts() if (db_get_b(NULL, MODULE, _T2A(fileName), 1)) m_scripts.SetCheckState(iItem, TRUE); m_scripts.SetItem(iItem, 1, _T(""), 0); -#ifdef DEBUG +//#ifdef DEBUG m_scripts.SetItem(iItem, 2, _T(""), 1); -#endif +//#endif } } -- cgit v1.2.3