diff options
author | George Hazan <george.hazan@gmail.com> | 2024-06-10 13:43:58 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-06-10 13:43:58 +0300 |
commit | 4f795835fc380a439649751a6c6710841df135c9 (patch) | |
tree | ed7da65a3cfd18bd072d10d7980469af9ee75dd4 /src | |
parent | a7d5e440c2116f84d9f189a82a5d989ab4b7a5b7 (diff) |
Utils_GenerateUUID - a helper for UUID generation
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/src/Windows/winutil.cpp | 18 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 |
3 files changed, 20 insertions, 0 deletions
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
|