Skip to content

Conversation

@WayneKoorts
Copy link
Owner

  • Add missing Windows file attribute constants (RECALL_ON_OPEN, SPARSE_FILE, REPARSE_POINT)
  • Fix verbose output bug that displayed wrong attribute name (showed RECALL_ON_DATA_ACCESS as "Pinned")
  • Rewrite hydration status detection logic:
    • DEHYDRATED: File has RECALL_ON_DATA_ACCESS or RECALL_ON_OPEN (placeholder needing data)
    • HYDRATING: File has recall attribute AND PINNED (actively downloading)
    • HYDRATED: File has no recall attributes (data locally available)
  • Fix operator precedence bug in original hydrating detection
  • Improve cloud file detection to use RECALL_ON_OPEN attribute
  • Add internal methods for testability (DetermineHydrationStatusFromAttributes, DeterminePinStatusFromAttributes)
  • Add unit test project with comprehensive tests for hydration and pin status detection

- Add missing Windows file attribute constants (RECALL_ON_OPEN, SPARSE_FILE, REPARSE_POINT)
- Fix verbose output bug that displayed wrong attribute name (showed RECALL_ON_DATA_ACCESS as "Pinned")
- Rewrite hydration status detection logic:
  - DEHYDRATED: File has RECALL_ON_DATA_ACCESS or RECALL_ON_OPEN (placeholder needing data)
  - HYDRATING: File has recall attribute AND PINNED (actively downloading)
  - HYDRATED: File has no recall attributes (data locally available)
- Fix operator precedence bug in original hydrating detection
- Improve cloud file detection to use RECALL_ON_OPEN attribute
- Add internal methods for testability (DetermineHydrationStatusFromAttributes, DeterminePinStatusFromAttributes)
- Add unit test project with comprehensive tests for hydration and pin status detection
- Add Cloud Filter API P/Invoke declarations (cldapi.dll)
- Add CF_PLACEHOLDER_STATE enum with all placeholder state flags
- Add GetAttributesAndReparseTag method to get file attributes and reparse tag
- Add GetPlaceholderState method to query Cloud Filter API
- Add IsCloudPlaceholder and IsFullyHydrated helper methods
- Update GetHydrationStatus to use CF API as primary detection method
  with automatic fallback to attribute-based detection
- Add DetermineHydrationStatusFromPlaceholderState for CF API-based detection
- Improve verbose output to show placeholder state flags
- Add comprehensive unit tests for placeholder state detection

The Cloud Filter API provides more authoritative detection:
- PARTIAL and PARTIALLY_ON_DISK flags directly indicate hydrating state
- No longer need to infer hydration from PINNED + RECALL combination
- Graceful fallback when cldapi.dll is not available (older Windows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants