Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume Mount Point management functions wrapped nicely for Go #187

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Apr 23, 2021

  1. Implement Volume Mount Point API wrappers

    Fixes: microsoft#176
    
    These provide Go-typed wrappers around the Win32 APIs backing them,
    protecting the user from unsafe pointers and UTF-16 conversions.
    
    utf16ToStringArray adapted from ConvertStringSetToSlice in hcsshim
    
    Signed-off-by: Paul "TBBle" Hampson <[email protected]>
    TBBle committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    f98fb90 View commit details
    Browse the repository at this point in the history
  2. Tests for Volume Mount Point API wrappers

    These are a separate commit, because in order to implement the tests, a
    bunch of new modules were pulled into go.mod.
    
    And the tests only run as Administrator anyway.
    
    On the plus side, the tests exercise a few APIs in the vhd package:
    - CreateVirtualDisk
    - AttachVirtualDisk
    - DetachVirtualDisk
    - GetVirtualDiskPhysicalPath
    
    And in future, these tests could also exercise the DecodeReparsePoint
    API too, since it should be 1:1 with GetVolumeNameForVolumeMountPoint.
    
    Signed-off-by: Paul "TBBle" Hampson <[email protected]>
    TBBle committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    d085a82 View commit details
    Browse the repository at this point in the history
  3. Exercise DecodeReparsePoint while testing mounts APIs

    This trivially demonstrates the difference between DecodeReparsePoint
    and GetVolumeNameForVolumeMountPoint.
    
    Signed-off-by: Paul "TBBle" Hampson <[email protected]>
    TBBle committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    29aa6d0 View commit details
    Browse the repository at this point in the history