ReactOS  0.4.15-dev-499-g1f31905
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) -= (ULONG)sizeof(type), buf += sizeof (type)) { \
(crc) = (uint32_t)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
UINT op
Definition: effect.c:224
GLenum GLsizei len
Definition: glext.h:6722
UINT32 uint32_t
Definition: types.h:75
unsigned int ULONG
Definition: retypes.h:1

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 check_csum().

◆ check_csum()

static bool check_csum ( btrfs_send_command cmd,
uint8_t data 
)
static

Definition at line 1257 of file recv.cpp.

1257  {
1258  uint32_t crc32 = cmd->csum, calc;
1259 
1260  cmd->csum = 0;
1261 
1262  calc = calc_crc32c(0, (uint8_t*)cmd, sizeof(btrfs_send_command));
1263 
1264  if (cmd->length > 0)
1265  calc = calc_crc32c(calc, data, cmd->length);
1266 
1267  return calc == crc32 ? true : false;
1268 }
uint32 __fastcall crc32(IN uint8 *s, IN uint32 len)
Definition: udf_info.cpp:4290
Definition: ftp_var.h:139
static uint32_t calc_crc32c(uint32_t seed, uint8_t *msg, ULONG msglen)
Definition: recv.cpp:134
#define true
Definition: osdep.h:36
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 1227 of file recv.cpp.

1227  {
1228  WIN32_FIND_DATAW fff;
1229 
1230  fff_handle h = FindFirstFileW((dir + L"*").c_str(), &fff);
1231 
1232  if (h == INVALID_HANDLE_VALUE)
1233  return;
1234 
1235  do {
1236  wstring file;
1237 
1238  file = fff.cFileName;
1239 
1240  if (file != L"." && file != L"..") {
1241  if (fff.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
1242  SetFileAttributesW((dir + file).c_str(), fff.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY);
1243 
1244  if (fff.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
1245  if (!(fff.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT))
1246  delete_directory(dir + file + L"\\");
1247  else
1248  RemoveDirectoryW((dir + file).c_str());
1249  } else
1250  DeleteFileW((dir + file).c_str());
1251  }
1252  } while (FindNextFileW(h, &fff));
1253 
1254  RemoveDirectoryW(dir.c_str());
1255 }
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:1227
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
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 1540 of file recv.cpp.

1540  {
1542 
1543  return br->recv_thread();
1544 }
Definition: recv.h:35
DWORD recv_thread()
Definition: recv.cpp:1476
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 1645 of file recv.cpp.

1645  {
1646  try {
1648  WCHAR file[MAX_PATH];
1649  win_handle token;
1651  LUID luid;
1652  ULONG tplen;
1653 
1654  set_dpi_aware();
1655 
1657  throw last_error(GetLastError());
1658 
1659  tplen = offsetof(TOKEN_PRIVILEGES, Privileges[0]) + (3 * sizeof(LUID_AND_ATTRIBUTES));
1660  tp = (TOKEN_PRIVILEGES*)malloc(tplen);
1661  if (!tp)
1663 
1664  tp->PrivilegeCount = 3;
1665 
1666  if (!LookupPrivilegeValueW(nullptr, L"SeManageVolumePrivilege", &luid)) {
1667  free(tp);
1668  throw last_error(GetLastError());
1669  }
1670 
1671  tp->Privileges[0].Luid = luid;
1672  tp->Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
1673 
1674  if (!LookupPrivilegeValueW(nullptr, L"SeSecurityPrivilege", &luid)) {
1675  free(tp);
1676  throw last_error(GetLastError());
1677  }
1678 
1679  tp->Privileges[1].Luid = luid;
1680  tp->Privileges[1].Attributes = SE_PRIVILEGE_ENABLED;
1681 
1682  if (!LookupPrivilegeValueW(nullptr, L"SeRestorePrivilege", &luid)) {
1683  free(tp);
1684  throw last_error(GetLastError());
1685  }
1686 
1687  tp->Privileges[2].Luid = luid;
1688  tp->Privileges[2].Attributes = SE_PRIVILEGE_ENABLED;
1689 
1690  if (!AdjustTokenPrivileges(token, false, tp, tplen, nullptr, nullptr)) {
1691  free(tp);
1692  throw last_error(GetLastError());
1693  }
1694 
1695  file[0] = 0;
1696 
1697  memset(&ofn, 0, sizeof(OPENFILENAMEW));
1698  ofn.lStructSize = sizeof(OPENFILENAMEW);
1699  ofn.hwndOwner = hwnd;
1700  ofn.hInstance = module;
1701  ofn.lpstrFile = file;
1702  ofn.nMaxFile = sizeof(file) / sizeof(WCHAR);
1704 
1705  if (GetOpenFileNameW(&ofn)) {
1706  BtrfsRecv recv;
1707 
1708  recv.Open(hwnd, file, lpszCmdLine, false);
1709  }
1710 
1711  free(tp);
1712  } catch (const exception& e) {
1713  error_message(hwnd, e.what());
1714  }
1715 }
#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:785
#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:4577
#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:2930
#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 1717 of file recv.cpp.

1717  {
1718  try {
1720 
1721  command_line_to_args(lpszCmdLine, args);
1722 
1723  if (args.size() >= 2) {
1724  win_handle token;
1726  ULONG tplen;
1727  LUID luid;
1728 
1730  return;
1731 
1732  tplen = offsetof(TOKEN_PRIVILEGES, Privileges[0]) + (3 * sizeof(LUID_AND_ATTRIBUTES));
1733  tp = (TOKEN_PRIVILEGES*)malloc(tplen);
1734  if (!tp)
1735  return;
1736 
1737  tp->PrivilegeCount = 3;
1738 
1739  if (!LookupPrivilegeValueW(nullptr, L"SeManageVolumePrivilege", &luid)) {
1740  free(tp);
1741  return;
1742  }
1743 
1744  tp->Privileges[0].Luid = luid;
1745  tp->Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
1746 
1747  if (!LookupPrivilegeValueW(nullptr, L"SeSecurityPrivilege", &luid)) {
1748  free(tp);
1749  return;
1750  }
1751 
1752  tp->Privileges[1].Luid = luid;
1753  tp->Privileges[1].Attributes = SE_PRIVILEGE_ENABLED;
1754 
1755  if (!LookupPrivilegeValueW(nullptr, L"SeRestorePrivilege", &luid)) {
1756  free(tp);
1757  return;
1758  }
1759 
1760  tp->Privileges[2].Luid = luid;
1761  tp->Privileges[2].Attributes = SE_PRIVILEGE_ENABLED;
1762 
1763  if (!AdjustTokenPrivileges(token, false, tp, tplen, nullptr, nullptr)) {
1764  free(tp);
1765  return;
1766  }
1767 
1768  free(tp);
1769 
1770  BtrfsRecv br;
1771  br.Open(nullptr, args[0], args[1], true);
1772  }
1773  } catch (const exception& e) {
1774  cerr << "Error: " << e.what() << endl;
1775  }
1776 }
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:2930
#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:1614
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
void command_line_to_args(LPWSTR cmdline, vector< wstring > &args)
Definition: main.cpp:647
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

◆ stub_RecvProgressDlgProc()

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

Definition at line 1598 of file recv.cpp.

1598  {
1599  BtrfsRecv* br;
1600 
1601  if (uMsg == WM_INITDIALOG) {
1603  br = (BtrfsRecv*)lParam;
1604  } else {
1605  br = (BtrfsRecv*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1606  }
1607 
1608  if (br)
1609  return br->RecvProgressDlgProc(hwndDlg, uMsg, wParam, lParam);
1610  else
1611  return false;
1612 }
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:1546
__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

◆ EA_EA

◆ EA_NTACL

const string EA_NTACL = "security.NTACL"

◆ EA_REPARSE

const string EA_REPARSE = "user.reparse"

◆ 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().