Exemple #1
0
	void ImplNodeEx::update() const
	{
		auto hndl = CheckHandleErr(::CreateFileW(get_full_path().c_str(), FILE_READ_ATTRIBUTES, FILE_SHARE_DELETE | FILE_SHARE_READ, nullptr, OPEN_EXISTING,
		                                         FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS,
		                                         nullptr));
		::GetFileInformationByHandle(hndl, &data_);
	}
Exemple #2
0
		void create(const wchar_t* path, const void* content, ssize_t size, LPSECURITY_ATTRIBUTES sa)
		{
			memory::auto_close<HANDLE> file(CheckHandleErr(::CreateFileW(path, GENERIC_WRITE, 0, sa, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr)));

			DWORD bytesWritten = 0;
			DWORD bytesToWrite = size;
			CheckApi(::WriteFile(file, content, bytesToWrite, &bytesWritten, nullptr) && bytesToWrite == bytesWritten);
		}
Exemple #3
0
		void create(const wchar_t* path, LPSECURITY_ATTRIBUTES sa)
		{
			LogTrace2(L"('%s')", path);
			memory::auto_close<HANDLE> file(CheckHandleErr(::CreateFileW(path, 0, 0, sa, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr)));
		}
Exemple #4
0
		HANDLE Facade::Open(const ustring& path, ACCESS_MASK access, DWORD share, PSECURITY_ATTRIBUTES sa, DWORD creat, DWORD flags)
		{
//			LogTrace(L"'%s', 0x%08X, 0x%08X, %p\n", path.c_str(), access, share, sa);
			return CheckHandleErr(::CreateFileW(path.c_str(), access, share, sa, creat, flags, nullptr));
		}