summaryrefslogtreecommitdiff
path: root/alf/alf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alf.cpp')
-rw-r--r--alf/alf.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp
index 1bcbce3..c2f99ce 100644
--- a/alf/alf.cpp
+++ b/alf/alf.cpp
@@ -75,6 +75,31 @@ ALF_Free(const void *p)
HeapFree(GetProcessHeap(), 0, (void*)p);
}
+TCHAR *
+ALF_StrDup(const TCHAR *psz)
+{
+ int l = lstrlen(psz);
+ TCHAR *r = ALF_New(TCHAR, (SIZE_T)l + 1);
+ CopyMemory(r, psz, ((SIZE_T)l + 1) * sizeof(TCHAR));
+ return r;
+}
+
+TCHAR *
+ALF_StrOrIntresourceDup(const TCHAR *psz)
+{
+ if (IS_INTRESOURCE(psz))
+ return (TCHAR *)psz;
+ else
+ return ALF_StrDup(psz);
+}
+
+void
+ALF_StrOrIntresourceFree(const TCHAR *psz)
+{
+ if (!IS_INTRESOURCE(psz))
+ ALF_Free(psz);
+}
+
int
ALF_CentipointsToPixels(int cptValue, int dpi)
{