projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged silc_1_0_branch to trunk.
[silc.git]
/
lib
/
silcutil
/
win32
/
silcwin32util.c
diff --git
a/lib/silcutil/win32/silcwin32util.c
b/lib/silcutil/win32/silcwin32util.c
index d7051c384abcd5424d3d77e54fa9300c7b5e7a4e..fef2f8fb687c895124ff0c77a23d840db727be8d 100644
(file)
--- a/
lib/silcutil/win32/silcwin32util.c
+++ b/
lib/silcutil/win32/silcwin32util.c
@@
-51,13
+51,26
@@
const BYTE DWLEN = sizeof(DWORD) * 8;
int silc_gettimeofday(struct timeval *tv)
{
FILETIME ft;
int silc_gettimeofday(struct timeval *tv)
{
FILETIME ft;
- __
SilcI
nt64 msec;
+ __
i
nt64 msec;
GetSystemTimeAsFileTime(&ft);
GetSystemTimeAsFileTime(&ft);
- msec = (__
SilcI
nt64) ft.dwHighDateTime << DWLEN | ft.dwLowDateTime;
+ msec = (__
i
nt64) ft.dwHighDateTime << DWLEN | ft.dwLowDateTime;
msec = (msec - FILETIME_1970) / 10;
tv->tv_sec = (long) (msec / 1000000);
tv->tv_usec = (long) (msec % 1000000);
return 0;
}
msec = (msec - FILETIME_1970) / 10;
tv->tv_sec = (long) (msec / 1000000);
tv->tv_usec = (long) (msec % 1000000);
return 0;
}
+
+char *silc_get_username(void)
+{
+ DWORD maxlen = 128;
+ char username[maxlen];
+ GetUserName(username, &maxlen);
+ return strdup(username);
+}
+
+char *silc_get_real_name(void)
+{
+ return silc_get_username();
+}