39 mcpi->SymbolicLinkNameLength = (
USHORT)(symlink.length() *
sizeof(
WCHAR));
40 mcpi->DeviceNameOffset = (
USHORT)(mcpi->SymbolicLinkNameOffset + mcpi->SymbolicLinkNameLength);
43 memcpy((
uint8_t*)mcpi + mcpi->SymbolicLinkNameOffset, symlink.data(), symlink.length() *
sizeof(
WCHAR));
62 if (symlink.length() > 0) {
64 mmp->SymbolicLinkNameLength = (
USHORT)(symlink.length() *
sizeof(
WCHAR));
65 memcpy((
uint8_t*)mmp + mmp->SymbolicLinkNameOffset, symlink.data(), symlink.length() *
sizeof(
WCHAR));
68 if (unique_id.length() > 0) {
69 if (mmp->SymbolicLinkNameLength == 0)
72 mmp->UniqueIdOffset = mmp->SymbolicLinkNameOffset + mmp->SymbolicLinkNameLength;
74 mmp->UniqueIdLength = (
USHORT)(unique_id.length() *
sizeof(
WCHAR));
75 memcpy((
uint8_t*)mmp + mmp->UniqueIdOffset, unique_id.data(), unique_id.length() *
sizeof(
WCHAR));
79 if (mmp->SymbolicLinkNameLength == 0 && mmp->UniqueIdOffset == 0)
81 else if (mmp->SymbolicLinkNameLength != 0)
82 mmp->DeviceNameOffset = mmp->SymbolicLinkNameOffset + mmp->SymbolicLinkNameLength;
84 mmp->DeviceNameOffset = mmp->UniqueIdOffset + mmp->UniqueIdLength;
97 buf2.resize(mmps->Size);
110 vector<mountmgr_point>
v;
117 if (symlink.length() > 0) {
119 mmp->SymbolicLinkNameLength = (
USHORT)(symlink.length() *
sizeof(
WCHAR));
120 memcpy((
uint8_t*)mmp + mmp->SymbolicLinkNameOffset, symlink.data(), symlink.length() *
sizeof(
WCHAR));
123 if (unique_id.length() > 0) {
124 if (mmp->SymbolicLinkNameLength == 0)
127 mmp->UniqueIdOffset = mmp->SymbolicLinkNameOffset + mmp->SymbolicLinkNameLength;
129 mmp->UniqueIdLength = (
USHORT)(unique_id.length() *
sizeof(
WCHAR));
130 memcpy((
uint8_t*)mmp + mmp->UniqueIdOffset, unique_id.data(), unique_id.length() *
sizeof(
WCHAR));
134 if (mmp->SymbolicLinkNameLength == 0 && mmp->UniqueIdOffset == 0)
136 else if (mmp->SymbolicLinkNameLength != 0)
137 mmp->DeviceNameOffset = mmp->SymbolicLinkNameOffset + mmp->SymbolicLinkNameLength;
139 mmp->DeviceNameOffset = mmp->UniqueIdOffset + mmp->UniqueIdLength;
154 buf2.resize(mmps->Size);
163 for (
ULONG i = 0;
i < mmps->NumberOfMountPoints;
i++) {
164 wstring_view mpsl, mpdn;
167 if (mmps->MountPoints[
i].SymbolicLinkNameLength)
168 mpsl = wstring_view((
WCHAR*)((
uint8_t*)mmps + mmps->MountPoints[
i].SymbolicLinkNameOffset), mmps->MountPoints[
i].SymbolicLinkNameLength /
sizeof(
WCHAR));
170 if (mmps->MountPoints[
i].UniqueIdLength)
171 mpuid = string_view((
char*)((
uint8_t*)mmps + mmps->MountPoints[
i].UniqueIdOffset), mmps->MountPoints[
i].UniqueIdLength);
173 if (mmps->MountPoints[
i].DeviceNameLength)
174 mpdn = wstring_view((
WCHAR*)((
uint8_t*)mmps + mmps->MountPoints[
i].DeviceNameOffset), mmps->MountPoints[
i].DeviceNameLength /
sizeof(
WCHAR));
177 v.emplace_back(mpsl, mpuid, mpdn);
void create_point(const std::wstring_view &symlink, const std::wstring_view &device) const
void delete_points(const std::wstring_view &symlink, const std::wstring_view &unique_id=L"", const std::wstring_view &device_name=L"") const
std::vector< mountmgr_point > query_points(const std::wstring_view &symlink=L"", const std::wstring_view &unique_id=L"", const std::wstring_view &device_name=L"") const
#define NT_SUCCESS(StatCode)
static const WCHAR device_name[]
#define FILE_SYNCHRONOUS_IO_ALERT
GLenum GLuint GLenum GLsizei const GLchar * buf
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define IOCTL_MOUNTMGR_DELETE_POINTS
struct _MOUNTMGR_CREATE_POINT_INPUT MOUNTMGR_CREATE_POINT_INPUT
#define MOUNTMGR_DEVICE_NAME
struct _MOUNTMGR_MOUNT_POINT MOUNTMGR_MOUNT_POINT
#define IOCTL_MOUNTMGR_CREATE_POINT
static PIO_STATUS_BLOCK iosb
#define InitializeObjectAttributes(p, n, a, r, s)
#define IOCTL_MOUNTMGR_QUERY_POINTS
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define FILE_GENERIC_READ
#define FILE_GENERIC_WRITE
#define STATUS_BUFFER_OVERFLOW