Index: blender/source/blender/blenlib/BLI_winstuff.h =================================================================== --- blender/source/blender/blenlib/BLI_winstuff.h (revisión: 28295) +++ blender/source/blender/blenlib/BLI_winstuff.h (copia de trabajo) @@ -131,6 +131,7 @@ int closedir (DIR *dp); void get_default_root(char *root); int check_file_chars(char *filename); +BOOL check_windows_version (int mayor_version, int minor_version, int mayor_servicepack, int minor_servicepack); char *dirname(char *path); #ifdef WIN32 Index: blender/source/blender/blenlib/intern/storage.c =================================================================== --- blender/source/blender/blenlib/intern/storage.c (revisión: 28295) +++ blender/source/blender/blenlib/intern/storage.c (copia de trabajo) @@ -213,6 +213,27 @@ strcpy(buf,relname); rellen=strlen(relname); +#if WIN32 + + // If on Vista or greater and the requested folder is a reparse point (Win softlink) + // get target as current directory + + if (check_windows_version(6,0,0,0) && (GetFileAttributes(dirname) & FILE_ATTRIBUTE_REPARSE_POINT)){ + HANDLE *hFile = CreateFile(dirname, 0, FILE_SHARE_READ | + FILE_SHARE_WRITE, 0, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, 0); + if (hFile != INVALID_HANDLE_VALUE) + { + GetFinalPathNameByHandle(hFile,dirname,MAX_PATH,FILE_NAME_OPENED); + strcpy(dirname, dirname + 4); + sprintf(dirname, "%s\\",dirname); + } + CloseHandle(hFile); + + } + +#endif + if (rellen){ buf[rellen]='/'; rellen++; Index: blender/source/blender/blenlib/intern/winstuff.c =================================================================== --- blender/source/blender/blenlib/intern/winstuff.c (revisión: 28295) +++ blender/source/blender/blenlib/intern/winstuff.c (copia de trabajo) @@ -213,6 +213,41 @@ return 1; } +/** Checks if the windows system version is the specified or later */ + +BOOL check_windows_version (int mayor_version, int minor_version, int mayor_servicepack, int minor_servicepack) +{ + OSVERSIONINFOEX osvi; + DWORDLONG dwlConditionMask = 0; + int op=VER_GREATER_EQUAL; + + // Initialize the OSVERSIONINFOEX structure. + + ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + osvi.dwMajorVersion = mayor_version; + osvi.dwMinorVersion = minor_version; + osvi.wServicePackMajor = mayor_servicepack; + osvi.wServicePackMinor = minor_servicepack; + + // Initialize the condition mask. + + VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, op ); + VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION, op ); + VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMAJOR, op ); + VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMINOR, op ); + + // Perform the test. + + return VerifyVersionInfo( + &osvi, + VER_MAJORVERSION | VER_MINORVERSION | + VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, + dwlConditionMask); +} + + + /* Copied from http://sourceware.org/ml/newlib/2005/msg00248.html */ /* Copyright 2005 Shaun Jackman * Permission to use, copy, modify, and distribute this software