ReactOS  0.4.14-dev-115-g4576127
recv.cpp File Reference
#include "shellext.h"
#include <windows.h>
#include <strsafe.h>
#include <stddef.h>
#include <sys/stat.h>
#include <iostream>
#include "recv.h"
#include "resource.h"
#include <cpuid.h>
#include <smmintrin.h>
Include dependency graph for recv.cpp:

Go to the source code of this file.

Macros

#define ALIGN_SIZE   0x08UL
 
#define ALIGN_MASK   (ALIGN_SIZE - 1)
 
#define CALC_CRC(op, crc, type, buf, len)
 

Functions

static uint32_t crc32c_hw (const void *input, ULONG len, uint32_t crc)
 
static uint32_t calc_crc32c (uint32_t seed, uint8_t *msg, ULONG msglen)
 
static __inline uint64_t unix_time_to_win (BTRFS_TIME *t)
 
static void delete_directory (const wstring &dir)
 
static bool check_csum (btrfs_send_command *cmd, uint8_t *data)
 
static DWORD WINAPI global_recv_thread (LPVOID lpParameter)
 
static INT_PTR CALLBACK stub_RecvProgressDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void CALLBACK RecvSubvolGUIW (HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
 
void CALLBACK RecvSubvolW (HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
 

Variables

const string EA_NTACL = "security.NTACL"
 
const string EA_DOSATTRIB = "user.DOSATTRIB"
 
const string EA_REPARSE = "user.reparse"
 
const string EA_EA = "user.EA"
 
const string XATTR_USER = "user."
 
bool have_sse42 = false
 
static const uint32_t crctable []
 

Macro Definition Documentation

◆ ALIGN_MASK

#define ALIGN_MASK   (ALIGN_SIZE - 1)

Definition at line 84 of file recv.cpp.

◆ ALIGN_SIZE

#define ALIGN_SIZE   0x08UL

Definition at line 83 of file recv.cpp.

◆ CALC_CRC

#define CALC_CRC (   op,
  crc,
  type,
  buf,
  len 
)
Value:
do { \
for (; (len) >= sizeof (type); (len) -= sizeof(type), buf += sizeof (type)) { \
(crc) = op((crc), *(type *) (buf)); \
} \
} while(0)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
UINT op
Definition: effect.c:223

Definition at line 85 of file recv.cpp.

Function Documentation

◆ calc_crc32c()

static uint32_t calc_crc32c ( uint32_t  seed,
uint8_t msg,
ULONG  msglen 
)
static

Definition at line 134 of file recv.cpp.

134  {
135 #ifndef __REACTOS__
136  if (have_sse42)
137  return crc32c_hw(msg, msglen, seed);
138  else {
139 #endif
140  uint32_t rem;
141  ULONG i;
142 
143  rem = seed;
144 
145  for (i = 0; i < msglen; i++) {
146  rem = crctable[(rem ^ msg[i]) & 0xff] ^ (rem >> 8);
147  }
148 
149  return rem;
150 #ifndef __REACTOS__
151  }
152 #endif
153 }
static uint32_t crc32c_hw(const void *input, ULONG len, uint32_t crc)
Definition: recv.cpp:93
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
Definition: glfuncs.h:248
bool have_sse42
Definition: recv.cpp:44
UINT32 uint32_t
Definition: types.h:75
static const uint32_t crctable[]
Definition: recv.cpp:47
#define msg(x)
Definition: auth_time.c:54
unsigned int ULONG
Definition: retypes.h:1

Referenced by add_delete_inode_extref(), add_dir_child(), calc_csum(), check_csum(), create_stream(), do_calc(), file_create2(), find_file_in_dir(), flush_fcb(), flush_fileref(), get_extent_data_ref_hash2(), get_orphan_name(), handle_batch_collision(), is_device_part_of_mounted_btrfs_raid(), load_dir_children(), load_stored_free_space_cache(), load_tree(), look_for_collision(), mount_vol(), move_across_subvols(), open_fcb(), open_fcb_stream(), query_directory(), read_data_dup(), read_data_raid0(), read_data_raid10(), read_data_raid5(), read_data_raid6(), read_superblock(), scrub_extent_dup(), scrub_extent_raid0(), scrub_extent_raid10(), scrub_raid5_stripe(), scrub_raid6_stripe(), send_command_finish(), set_rename_information(), snapshot_tree_copy(), still_has_superblock(), test_vol(), update_chunk_cache(), verify_device(), write_metadata_items(), write_superblock(), and write_trees().

◆ check_csum()

static bool check_csum ( btrfs_send_command cmd,
uint8_t data 
)
static

Definition at line 1254 of file recv.cpp.

1254  {
1255  uint32_t crc32 = cmd->csum, calc;
1256 
1257  cmd->csum = 0;
1258 
1259  calc = calc_crc32c(0, (uint8_t*)cmd, sizeof(btrfs_send_command));
1260 
1261  if (cmd->length > 0)
1262  calc = calc_crc32c(calc, data, cmd->length);
1263 
1264  return calc == crc32 ? true : false;
1265 }
#define true
Definition: stdbool.h:37
Definition: ftp_var.h:139
uint32_t crc32
Definition: btrfs.c:4163
static uint32_t calc_crc32c(uint32_t seed, uint8_t *msg, ULONG msglen)
Definition: recv.cpp:134
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BYTE uint8_t
Definition: msvideo1.c:66
UINT32 uint32_t
Definition: types.h:75
calc_t calc
Definition: winmain.c:247

Referenced by BtrfsRecv::do_recv(), and scrub_extent_dup().

◆ crc32c_hw()

static uint32_t crc32c_hw ( const void input,
ULONG  len,
uint32_t  crc 
)
static

Definition at line 93 of file recv.cpp.

93  {
94  const char* buf = (const char*)input;
95 
96  // Annoyingly, the CRC32 intrinsics don't work properly in modern versions of MSVC -
97  // it compiles _mm_crc32_u8 as if it was _mm_crc32_u32. And because we're apparently
98  // not allowed to use inline asm on amd64, there's no easy way to fix this!
99 
100  for (; (len > 0) && ((size_t)buf & ALIGN_MASK); len--, buf++) {
101 #ifdef _MSC_VER
102  crc = crctable[(crc ^ *buf) & 0xff] ^ (crc >> 8);
103 #else
104  crc = _mm_crc32_u8(crc, *buf);
105 #endif
106  }
107 
108 #ifdef _AMD64_
109 #ifdef _MSC_VER
110 #pragma warning(push)
111 #pragma warning(disable:4244) // _mm_crc32_u64 wants to return uint64_t(!)
112 #pragma warning(disable:4242)
113 #endif
114  CALC_CRC(_mm_crc32_u64, crc, uint64_t, buf, len);
115 #ifdef _MSC_VER
116 #pragma warning(pop)
117 #endif
118 #endif
119  CALC_CRC(_mm_crc32_u32, crc, uint32_t, buf, len);
120 
121 #ifdef _MSC_VER
122  for (; len > 0; len--, buf++) {
123  crc = crctable[(crc ^ *buf) & 0xff] ^ (crc >> 8);
124  }
125 #else
126  CALC_CRC(_mm_crc32_u16, crc, uint16_t, buf, len);
127  CALC_CRC(_mm_crc32_u8, crc, uint8_t, buf, len);
128 #endif
129 
130  return crc;
131 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define ALIGN_MASK
Definition: recv.cpp:84
unsigned short int uint16_t
Definition: acefiex.h:54
GLenum GLsizei len
Definition: glext.h:6722
BYTE uint8_t
Definition: msvideo1.c:66
UINT64 uint64_t
Definition: types.h:77
GLenum GLenum GLenum input
Definition: glext.h:9031
UINT32 uint32_t
Definition: types.h:75
static const uint32_t crctable[]
Definition: recv.cpp:47
#define CALC_CRC(op, crc, type, buf, len)
Definition: recv.cpp:85

Referenced by calc_crc32c().

◆ delete_directory()

static void delete_directory ( const wstring &  dir)
static

Definition at line 1224 of file recv.cpp.

1224  {
1225  WIN32_FIND_DATAW fff;
1226 
1227  fff_handle h = FindFirstFileW((dir + L"*").c_str(), &fff);
1228 
1229  if (h == INVALID_HANDLE_VALUE)
1230  return;
1231 
1232  do {
1233  wstring file;
1234 
1235  file = fff.cFileName;
1236 
1237  if (file != L"." && file != L"..") {
1238  if (fff.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
1239  SetFileAttributesW((dir + file).c_str(), fff.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY);
1240 
1241  if (fff.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
1242  if (!(fff.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT))
1243  delete_directory(dir + file + L"\\");
1244  else
1245  RemoveDirectoryW((dir + file).c_str());
1246  } else
1247  DeleteFileW((dir + file).c_str());
1248  }
1249  } while (FindNextFileW(h, &fff));
1250 
1251  RemoveDirectoryW(dir.c_str());
1252 }
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:944
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
static void delete_directory(const wstring &dir)
Definition: recv.cpp:1224
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
unsigned int dir
Definition: maze.c:112
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
#define FILE_ATTRIBUTE_REPARSE_POINT
Definition: ntifs_ex.h:381
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
const char file[]
Definition: icontest.c:11
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
static const WCHAR L[]
Definition: oid.c:1250
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
Definition: fci.c:126

Referenced by BtrfsRecv::do_recv().

◆ global_recv_thread()

static DWORD WINAPI global_recv_thread ( LPVOID  lpParameter)
static

Definition at line 1539 of file recv.cpp.

1539  {
1541 
1542  return br->recv_thread();
1543 }
Definition: recv.h:35
DWORD recv_thread()
Definition: recv.cpp:1473
LPVOID lpParameter
Definition: kernel32.h:241

Referenced by BtrfsRecv::RecvProgressDlgProc().

◆ RecvSubvolGUIW()

void CALLBACK RecvSubvolGUIW ( HWND  hwnd,
HINSTANCE  hinst,
LPWSTR  lpszCmdLine,
int  nCmdShow 
)

Definition at line 1646 of file recv.cpp.

1646  {
1647  try {
1649  WCHAR file[MAX_PATH];
1650  win_handle token;
1652  LUID luid;
1653  ULONG tplen;
1654 
1655  set_dpi_aware();
1656 
1658  throw last_error(GetLastError());
1659 
1660  tplen = offsetof(TOKEN_PRIVILEGES, Privileges[0]) + (3 * sizeof(LUID_AND_ATTRIBUTES));
1661  tp = (TOKEN_PRIVILEGES*)malloc(tplen);
1662  if (!tp)
1664 
1665  tp->PrivilegeCount = 3;
1666 
1667  if (!LookupPrivilegeValueW(nullptr, L"SeManageVolumePrivilege", &luid)) {
1668  free(tp);
1669  throw last_error(GetLastError());
1670  }
1671 
1672  tp->Privileges[0].Luid = luid;
1673  tp->Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
1674 
1675  if (!LookupPrivilegeValueW(nullptr, L"SeSecurityPrivilege", &luid)) {
1676  free(tp);
1677  throw last_error(GetLastError());
1678  }
1679 
1680  tp->Privileges[1].Luid = luid;
1681  tp->Privileges[1].Attributes = SE_PRIVILEGE_ENABLED;
1682 
1683  if (!LookupPrivilegeValueW(nullptr, L"SeRestorePrivilege", &luid)) {
1684  free(tp);
1685  throw last_error(GetLastError());
1686  }
1687 
1688  tp->Privileges[2].Luid = luid;
1689  tp->Privileges[2].Attributes = SE_PRIVILEGE_ENABLED;
1690 
1691  if (!AdjustTokenPrivileges(token, false, tp, tplen, nullptr, nullptr)) {
1692  free(tp);
1693  throw last_error(GetLastError());
1694  }
1695 
1696  file[0] = 0;
1697 
1698  memset(&ofn, 0, sizeof(OPENFILENAMEW));
1699  ofn.lStructSize = sizeof(OPENFILENAMEW);
1700  ofn.hwndOwner = hwnd;
1701  ofn.hInstance = module;
1702  ofn.lpstrFile = file;
1703  ofn.nMaxFile = sizeof(file) / sizeof(WCHAR);
1705 
1706  if (GetOpenFileNameW(&ofn)) {
1707  BtrfsRecv recv;
1708 
1709  recv.Open(hwnd, file, lpszCmdLine, false);
1710  }
1711 
1712  free(tp);
1713  } catch (const exception& e) {
1714  error_message(hwnd, e.what());
1715  }
1716 }
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HMODULE module
Definition: main.cpp:47
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
Definition: recv.h:35
HWND hwndOwner
Definition: commdlg.h:330
#define free
Definition: debug_ros.c:5
struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES
OPENFILENAME ofn
Definition: main.cpp:37
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define IDS_OUT_OF_MEMORY
Definition: resource.h:63
DWORD nMaxFile
Definition: commdlg.h:337
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
void error_message(HWND hwnd, const char *msg)
Definition: main.cpp:738
#define e
Definition: ke_i.h:82
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
Definition: glfuncs.h:210
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
Definition: filedlg.c:4564
#define offsetof(TYPE, MEMBER)
HINSTANCE hInstance
Definition: commdlg.h:331
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define TOKEN_QUERY
Definition: setypes.h:874
__wchar_t WCHAR
Definition: xmlstorage.h:180
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
const char file[]
Definition: icontest.c:11
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
Definition: sefuncs.h:13
static const WCHAR L[]
Definition: oid.c:1250
struct tagOFNW OPENFILENAMEW
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:376
LPSTR lpstrFile
Definition: commdlg.h:336
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
unsigned int ULONG
Definition: retypes.h:1
#define malloc
Definition: debug_ros.c:4
#define memset(x, y, z)
Definition: compat.h:39
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:876
void set_dpi_aware()
Definition: main.cpp:50
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
Definition: recv.c:23
DWORD Flags
Definition: commdlg.h:342
Definition: fci.c:126

◆ RecvSubvolW()

void CALLBACK RecvSubvolW ( HWND  hwnd,
HINSTANCE  hinst,
LPWSTR  lpszCmdLine,
int  nCmdShow 
)

Definition at line 1718 of file recv.cpp.

1718  {
1719  try {
1721 
1722  command_line_to_args(lpszCmdLine, args);
1723 
1724  if (args.size() >= 2) {
1725  win_handle token;
1727  ULONG tplen;
1728  LUID luid;
1729 
1731  return;
1732 
1733  tplen = offsetof(TOKEN_PRIVILEGES, Privileges[0]) + (3 * sizeof(LUID_AND_ATTRIBUTES));
1734  tp = (TOKEN_PRIVILEGES*)malloc(tplen);
1735  if (!tp)
1736  return;
1737 
1738  tp->PrivilegeCount = 3;
1739 
1740  if (!LookupPrivilegeValueW(nullptr, L"SeManageVolumePrivilege", &luid)) {
1741  free(tp);
1742  return;
1743  }
1744 
1745  tp->Privileges[0].Luid = luid;
1746  tp->Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
1747 
1748  if (!LookupPrivilegeValueW(nullptr, L"SeSecurityPrivilege", &luid)) {
1749  free(tp);
1750  return;
1751  }
1752 
1753  tp->Privileges[1].Luid = luid;
1754  tp->Privileges[1].Attributes = SE_PRIVILEGE_ENABLED;
1755 
1756  if (!LookupPrivilegeValueW(nullptr, L"SeRestorePrivilege", &luid)) {
1757  free(tp);
1758  return;
1759  }
1760 
1761  tp->Privileges[2].Luid = luid;
1762  tp->Privileges[2].Attributes = SE_PRIVILEGE_ENABLED;
1763 
1764  if (!AdjustTokenPrivileges(token, false, tp, tplen, nullptr, nullptr)) {
1765  free(tp);
1766  return;
1767  }
1768 
1769  free(tp);
1770 
1771  BtrfsRecv br;
1772  br.Open(nullptr, args[0], args[1], true);
1773  }
1774  } catch (const exception& e) {
1775  cerr << "Error: " << e.what() << endl;
1776  }
1777 }
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
Definition: recv.h:35
#define free
Definition: debug_ros.c:5
struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES
Definition: match.c:390
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
Definition: _ostream.h:357
#define e
Definition: ke_i.h:82
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
Definition: glfuncs.h:210
#define offsetof(TYPE, MEMBER)
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
#define TOKEN_QUERY
Definition: setypes.h:874
_STLP_DECLSPEC _Stl_aligned_buffer< ostream > cerr
Definition: iostream.cpp:102
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
Definition: sefuncs.h:13
void Open(HWND hwnd, const wstring &file, const wstring &path, bool quiet)
Definition: recv.cpp:1615
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:376
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
unsigned int ULONG
Definition: retypes.h:1
#define malloc
Definition: debug_ros.c:4
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:876
#define args
Definition: format.c:66
void command_line_to_args(LPWSTR cmdline, vector< wstring > args)
Definition: main.cpp:610

◆ stub_RecvProgressDlgProc()

static INT_PTR CALLBACK stub_RecvProgressDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1599 of file recv.cpp.

1599  {
1600  BtrfsRecv* br;
1601 
1602  if (uMsg == WM_INITDIALOG) {
1604  br = (BtrfsRecv*)lParam;
1605  } else {
1606  br = (BtrfsRecv*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1607  }
1608 
1609  if (br)
1610  return br->RecvProgressDlgProc(hwndDlg, uMsg, wParam, lParam);
1611  else
1612  return false;
1613 }
Definition: recv.h:35
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define GWLP_USERDATA
Definition: treelist.c:63
INT_PTR CALLBACK RecvProgressDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: recv.cpp:1545
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139

Referenced by BtrfsRecv::Open().

◆ unix_time_to_win()

static __inline uint64_t unix_time_to_win ( BTRFS_TIME t)
static

Definition at line 1180 of file recv.cpp.

1180  {
1181  return (t->seconds * 10000000) + (t->nanoseconds / 100) + 116444736000000000;
1182 }
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by _Function_class_(), BtrfsRecv::cmd_utimes(), fill_in_file_basic_information(), fill_in_file_network_open_information(), fill_in_file_stat_information(), fill_in_file_stat_lx_information(), and query_dir_item().

Variable Documentation

◆ crctable

const uint32_t crctable[]
static

Definition at line 47 of file recv.cpp.

Referenced by calc_crc32c(), and crc32c_hw().

◆ EA_DOSATTRIB

const string EA_DOSATTRIB = "user.DOSATTRIB"

◆ EA_EA

◆ EA_NTACL

const string EA_NTACL = "security.NTACL"

◆ EA_REPARSE

const string EA_REPARSE = "user.reparse"

Definition at line 39 of file recv.cpp.

Referenced by BtrfsRecv::cmd_setxattr(), flush_fcb(), fsctl_set_xattr(), and open_fcb().

◆ have_sse42

bool have_sse42 = false

Definition at line 44 of file recv.cpp.

Referenced by calc_crc32c(), and BtrfsRecv::Open().

◆ XATTR_USER

const string XATTR_USER = "user."

Definition at line 41 of file recv.cpp.

Referenced by BtrfsRecv::cmd_removexattr(), and BtrfsRecv::cmd_setxattr().