From 4f795835fc380a439649751a6c6710841df135c9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Jun 2024 13:43:58 +0300 Subject: Utils_GenerateUUID - a helper for UUID generation --- src/mir_core/src/Windows/winutil.cpp | 18 ++++++++++++++++++ src/mir_core/src/mir_core.def | 1 + src/mir_core/src/mir_core64.def | 1 + 3 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/mir_core/src/Windows/winutil.cpp b/src/mir_core/src/Windows/winutil.cpp index 6320622ada..cdc0f58251 100644 --- a/src/mir_core/src/Windows/winutil.cpp +++ b/src/mir_core/src/Windows/winutil.cpp @@ -133,3 +133,21 @@ MIR_CORE_DLL(int) Utils_CorrectFontSize(int size) return size * ncm.lfMessageFont.lfHeight / -12; } + +///////////////////////////////////////////////////////////////////////////////////////// + +#pragma comment(lib, "rpcrt4.lib") + +MIR_CORE_DLL(CMStringA) Utils_GenerateUUID() +{ + GUID packetId; + UuidCreate(&packetId); + + RPC_CSTR szId; + UuidToStringA(&packetId, &szId); + + CMStringA ret((char *)szId); + + RpcStringFreeA(&szId); + return ret; +} diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 9ef066901d..5c192dbef0 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1579,3 +1579,4 @@ _newStrW@4 @1789 NONAME ?GetPlainRtf@CCtrlRichEdit@@QAEPAD_N@Z @1804 NONAME ?SetTooltip@CCtrlMButton@@QAEXPBD@Z @1805 NONAME _db_event_delivered@8 @1806 NONAME +?Utils_GenerateUUID@@YG?AV?$CMStringT@DV?$ChTraitsCRT@D@@@@XZ @1807 NONAME diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 4e1ba01b17..ee09358441 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1579,3 +1579,4 @@ newStrW @1789 NONAME ?GetPlainRtf@CCtrlRichEdit@@QEAAPEAD_N@Z @1804 NONAME ?SetTooltip@CCtrlMButton@@QEAAXPEBD@Z @1805 NONAME db_event_delivered @1806 NONAME +?Utils_GenerateUUID@@YA?AV?$CMStringT@DV?$ChTraitsCRT@D@@@@XZ @1807 NONAME -- cgit v1.2.3