aboutsummaryrefslogtreecommitdiffstats
path: root/code/win32/win_shared.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-08-01 11:41:49 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-08-01 11:41:49 +0000
commit1f0b1821b64cd755c1d6ec93d42849f928f21c73 (patch)
tree846f7cfea89c805e834a8b65dbeba44f44f4c3f1 /code/win32/win_shared.c
parentead6ad4e27610d53977d11955569fcf348fac5dd (diff)
downloadioquake3-aero-1f0b1821b64cd755c1d6ec93d42849f928f21c73.tar.gz
ioquake3-aero-1f0b1821b64cd755c1d6ec93d42849f928f21c73.zip
* Windows home directory support (tjw)
git-svn-id: svn://svn.icculus.org/quake3/trunk@827 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/win32/win_shared.c')
-rw-r--r--code/win32/win_shared.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/code/win32/win_shared.c b/code/win32/win_shared.c
index fe75e3a..36a35c5 100644
--- a/code/win32/win_shared.c
+++ b/code/win32/win_shared.c
@@ -285,7 +285,26 @@ char *Sys_GetCurrentUser( void )
}
char *Sys_DefaultHomePath(void) {
- return NULL;
+ TCHAR szPath[MAX_PATH];
+ static char path[MAX_OSPATH];
+
+ if( !SUCCEEDED( SHGetFolderPath( NULL, CSIDL_LOCAL_APPDATA,
+ NULL, 0, szPath ) ) )
+ {
+
+ return NULL;
+ }
+ Q_strncpyz( path, szPath, sizeof(path) );
+ Q_strcat( path, sizeof(path), "\\Quake3" );
+ if( CreateDirectory( path, NULL ) )
+ {
+ if( GetLastError() != ERROR_ALREADY_EXISTS )
+ {
+ Com_Printf("Unable to create directory \"%s\"\n", path);
+ return NULL;
+ }
+ }
+ return path;
}
char *Sys_DefaultInstallPath(void)