- if (lpFileName) {
- strncpy(szFileName, lpFileName, PATH_MAX);
- }
- else {
- char szProcessName[PATH_MAX];
- char szCurrentDir[PATH_MAX];
- OS::GetProcessName(szProcessName, PATH_MAX);
- OS::GetCurrentDir(szCurrentDir, PATH_MAX);
+ if (!lpFileName) {
+ static unsigned dwCounter = 0;
+
+ os::String process = os::getProcessName();
+#ifdef _WIN32
+ process.trimExtension();
+#endif
+ process.trimDirectory();
+
+#ifdef ANDROID
+ os::String prefix = "/data";
+#else
+ os::String prefix = os::getCurrentDir();
+#endif
+ prefix.join(process);