-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add go wrappers over cimfs writer functions exported by cimfs.dll. Signed-off-by: Amit Barve <ambarve@microsoft.com>
- Loading branch information
Showing
11 changed files
with
1,051 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* HCS API | ||
* | ||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) | ||
* | ||
* API version: 2.5 | ||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) | ||
*/ | ||
|
||
package hcsschema | ||
|
||
const ( | ||
CimMountFlagNone uint32 = 0x0 | ||
CimMountFlagChildOnly uint32 = 0x1 | ||
CimMountFlagEnableDax uint32 = 0x2 | ||
CimMountFlagCacheFiles uint32 = 0x4 | ||
CimMountFlagCacheRegions uint32 = 0x8 | ||
) | ||
|
||
type CimMount struct { | ||
ImagePath string `json:"ImagePath,omitempty"` | ||
FileSystemName string `json:"FileSystemName,omitempty"` | ||
VolumeGuid string `json:"VolumeGuid,omitempty"` | ||
MountFlags uint32 `json:"MountFlags,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package winapi | ||
|
||
import ( | ||
"unsafe" | ||
|
||
"github.com/Microsoft/go-winio/pkg/guid" | ||
"golang.org/x/sys/windows" | ||
) | ||
|
||
type g = guid.GUID | ||
type FsHandle uintptr | ||
type StreamHandle uintptr | ||
|
||
type CimFsFileMetadata struct { | ||
Attributes uint32 | ||
FileSize int64 | ||
|
||
CreationTime windows.Filetime | ||
LastWriteTime windows.Filetime | ||
ChangeTime windows.Filetime | ||
LastAccessTime windows.Filetime | ||
|
||
SecurityDescriptorBuffer unsafe.Pointer | ||
SecurityDescriptorSize uint32 | ||
|
||
ReparseDataBuffer unsafe.Pointer | ||
ReparseDataSize uint32 | ||
|
||
ExtendedAttributes unsafe.Pointer | ||
EACount uint32 | ||
} | ||
|
||
//sys CimMountImage(imagePath string, fsName string, flags uint32, volumeID *g) (hr error) = cimfs.CimMountImage? | ||
//sys CimDismountImage(volumeID *g) (hr error) = cimfs.CimDismountImage? | ||
|
||
//sys CimCreateImage(imagePath string, oldFSName *uint16, newFSName *uint16, cimFSHandle *FsHandle) (hr error) = cimfs.CimCreateImage? | ||
//sys CimCloseImage(cimFSHandle FsHandle) (hr error) = cimfs.CimCloseImage? | ||
//sys CimCommitImage(cimFSHandle FsHandle) (hr error) = cimfs.CimCommitImage? | ||
|
||
//sys CimCreateFile(cimFSHandle FsHandle, path string, file *CimFsFileMetadata, cimStreamHandle *StreamHandle) (hr error) = cimfs.CimCreateFile? | ||
//sys CimCloseStream(cimStreamHandle StreamHandle) (hr error) = cimfs.CimCloseStream? | ||
//sys CimWriteStream(cimStreamHandle StreamHandle, buffer uintptr, bufferSize uint32) (hr error) = cimfs.CimWriteStream? | ||
//sys CimDeletePath(cimFSHandle FsHandle, path string) (hr error) = cimfs.CimDeletePath? | ||
//sys CimCreateHardLink(cimFSHandle FsHandle, newPath string, oldPath string) (hr error) = cimfs.CimCreateHardLink? | ||
//sys CimCreateAlternateStream(cimFSHandle FsHandle, path string, size uint64, cimStreamHandle *StreamHandle) (hr error) = cimfs.CimCreateAlternateStream? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.