misc/libphysfs/platform_windows.c
changeset 10017 de822cd3df3a
parent 8524 a65e9bcf0a03
child 12218 bb5522e88ab2
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
   169 
   169 
   170     if (stem)
   170     if (stem)
   171         stem(SEM_FAILCRITICALERRORS, &oldErrorMode);
   171         stem(SEM_FAILCRITICALERRORS, &oldErrorMode);
   172     else
   172     else
   173         oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
   173         oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
   174     
   174 
   175     /* Do detection. This may block if a disc is spinning up. */
   175     /* Do detection. This may block if a disc is spinning up. */
   176     for (i = 'A'; i <= 'Z'; i++)
   176     for (i = 'A'; i <= 'Z'; i++)
   177     {
   177     {
   178         DWORD tmp = 0;
   178         DWORD tmp = 0;
   179         drive[0] = (char) i;
   179         drive[0] = (char) i;
   441         /*
   441         /*
   442          * Should fail. Will write the size of the profile path in
   442          * Should fail. Will write the size of the profile path in
   443          *  psize. Also note that the second parameter can't be
   443          *  psize. Also note that the second parameter can't be
   444          *  NULL or the function fails.
   444          *  NULL or the function fails.
   445          */
   445          */
   446     	rc = pGetDir(accessToken, &dummy, &psize);
   446         rc = pGetDir(accessToken, &dummy, &psize);
   447         assert(!rc);  /* !!! FIXME: handle this gracefully. */
   447         assert(!rc);  /* !!! FIXME: handle this gracefully. */
   448         (void) rc;
   448         (void) rc;
   449 
   449 
   450         /* Allocate memory for the profile directory */
   450         /* Allocate memory for the profile directory */
   451         wstr = (LPWSTR) __PHYSFS_smallAlloc((psize + 1) * sizeof (WCHAR));
   451         wstr = (LPWSTR) __PHYSFS_smallAlloc((psize + 1) * sizeof (WCHAR));
   479 } /* __PHYSFS_platformGetThreadID */
   479 } /* __PHYSFS_platformGetThreadID */
   480 
   480 
   481 
   481 
   482 static int isSymlinkAttrs(const DWORD attr, const DWORD tag)
   482 static int isSymlinkAttrs(const DWORD attr, const DWORD tag)
   483 {
   483 {
   484     return ( (attr & FILE_ATTRIBUTE_REPARSE_POINT) && 
   484     return ( (attr & FILE_ATTRIBUTE_REPARSE_POINT) &&
   485              (tag == PHYSFS_IO_REPARSE_TAG_SYMLINK) );
   485              (tag == PHYSFS_IO_REPARSE_TAG_SYMLINK) );
   486 } /* isSymlinkAttrs */
   486 } /* isSymlinkAttrs */
   487 
   487 
   488 
   488 
   489 void __PHYSFS_platformEnumerateFiles(const char *dirname,
   489 void __PHYSFS_platformEnumerateFiles(const char *dirname,
   718     if ( (rc == PHYSFS_INVALID_SET_FILE_POINTER) &&
   718     if ( (rc == PHYSFS_INVALID_SET_FILE_POINTER) &&
   719          (GetLastError() != NO_ERROR) )
   719          (GetLastError() != NO_ERROR) )
   720     {
   720     {
   721         BAIL_MACRO(errcodeFromWinApi(), 0);
   721         BAIL_MACRO(errcodeFromWinApi(), 0);
   722     } /* if */
   722     } /* if */
   723     
   723 
   724     return 1;  /* No error occured */
   724     return 1;  /* No error occured */
   725 } /* __PHYSFS_platformSeek */
   725 } /* __PHYSFS_platformSeek */
   726 
   726 
   727 
   727 
   728 PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
   728 PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)