28#define SEND_BUFFER_LEN 1048576
77 for (
j = 0;
j <
i;
j++) {
154 end.csum = 0x9dc96c50;
161 FILE_DISPOSITION_INFO fdi;
163 fdi.DeleteFile =
true;
274 if (num_clones !=
LB_ERR) {
275 for (
unsigned int i = 0;
i < (
unsigned int)num_clones;
i++) {
354 if (bgfi.
inode != 0x100 || bgfi.
top)
400 if (bgfi.
inode != 0x100 || bgfi.
top)
425 this->
hwnd = hwndDlg;
444 FILE_DISPOSITION_INFO fdi;
447 fdi.DeleteFile =
true;
549 tp.PrivilegeCount = 1;
550 tp.Privileges[0].Luid = luid;
558 bs.Open(
hwnd, lpszCmdLine);
611 for (
j = 0;
j <
i;
j++) {
652 end.csum = 0x9dc96c50;
659 FILE_DISPOSITION_INFO fdi;
661 fdi.DeleteFile =
true;
684 if (
args.size() >= 2) {
697 tp.PrivilegeCount = 1;
698 tp.Privileges[0].Luid = luid;
705 for (
unsigned int i = 0;
i <
args.size();
i++) {
706 if (
args[
i][0] ==
'-') {
708 if (
args[
i][1] ==
'p') {
711 }
else if (
args[
i][1] ==
'c') {
719 else if (
file ==
L"")
724 if (subvol !=
L"" &&
file !=
L"") {
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
EXTERN_C LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
#define FSCTL_BTRFS_SEND_SUBVOL
#define FSCTL_BTRFS_GET_FILE_IDS
#define FSCTL_BTRFS_READ_SEND_BUFFER
void StartSend(HWND hwnd)
void Open(HWND hwnd, WCHAR *path)
void RemoveClone(HWND hwnd)
INT_PTR SendDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
void BrowseParent(HWND hwnd)
struct tagOFNW OPENFILENAMEW
#define NT_SUCCESS(StatCode)
void error_message(HWND hwnd, const char *msg)
wstring format_ntstatus(NTSTATUS Status)
void command_line_to_args(LPWSTR cmdline, vector< wstring > &args)
wstring utf8_to_utf16(const string_view &utf8)
#define IDS_SEND_NOT_READONLY
#define IDS_SEND_FSCTL_BTRFS_SEND_SUBVOL_FAILED
#define IDC_PARENT_BROWSE
#define IDS_RECV_GETVOLUMEPATHNAME_FAILED
#define IDS_SEND_CANT_OPEN_DIR
#define IDC_PARENT_SUBVOL
#define IDS_SEND_FSCTL_BTRFS_READ_SEND_BUFFER_FAILED
#define IDS_SEND_WRITEFILE_FAILED
#define IDS_SHPARSEDISPLAYNAME_FAILED
#define IDS_SEND_GET_FILE_INFO_FAILED
#define IDS_SEND_CANT_OPEN_FILE
#define IDS_GET_FILE_IDS_FAILED
#define IDS_SEND_PARENT_NOT_READONLY
#define IDS_SHGETPATHFROMIDLIST_FAILED
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
#define INVALID_HANDLE_VALUE
#define GetCurrentProcess()
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
BOOL WINAPI SetEndOfFile(HANDLE hFile)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
BOOL WINAPI GetVolumePathNameW(IN LPCWSTR lpszFileName, IN LPWSTR lpszVolumePathName, IN DWORD cchBufferLength)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
#define BTRFS_SEND_CMD_END
@ FileDispositionInformation
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
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 token
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 GLint GLint j
format_message(j_common_ptr cinfo, char *buffer)
static struct msdos_boot_sector bs
#define memcpy(s1, s2, n)
#define FILE_FLAG_BACKUP_SEMANTICS
static PIO_STATUS_BLOCK iosb
static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars)
#define FILE_ATTRIBUTE_READONLY
#define FILE_READ_ATTRIBUTES
NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
#define FILE_SHARE_DELETE
NTSYSAPI NTSTATUS NTAPI NtFsControlFile(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)
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
#define offsetof(TYPE, MEMBER)
static INT_PTR CALLBACK stub_SendDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
void CALLBACK SendSubvolW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
static DWORD WINAPI send_thread(LPVOID lpParameter)
static void send_subvol(const wstring &subvol, const wstring &file, const wstring &parent, const vector< wstring > &clones)
void CALLBACK SendSubvolGUIW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
#define STATUS_END_OF_FILE
#define BIF_RETURNONLYFSDIRS
#define BIF_NONEWFOLDERBUTTON
PCIDLIST_ABSOLUTE pidlRoot
void push_back(const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
#define STATUS_INVALID_PARAMETER
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
#define success(from, fromstr, to, tostr)
DWORD WINAPI GetLastError(void)
#define GetWindowLongPtrW
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
#define SetWindowLongPtrW
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define TOKEN_ADJUST_PRIVILEGES
#define SE_PRIVILEGE_ENABLED