6#include <private/qv4compileddata_p.h>
8#include <QtCore/qdatetime.h>
9#include <QtCore/qfileinfo.h>
10#include <QtCore/qscopeguard.h>
25 CreateFile(
reinterpret_cast<const wchar_t*
>(cacheFileName.
constData()),
26 GENERIC_READ | GENERIC_EXECUTE, FILE_SHARE_READ,
27 nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
29 if (
handle == INVALID_HANDLE_VALUE) {
40 if (!ReadFile(
handle,
reinterpret_cast<char *
>(&
header),
sizeof(
header), &bytesRead,
nullptr)) {
45 if (bytesRead !=
sizeof(
header)) {
50 if (!
header.verifyHeader(sourceTimeStamp, errorString))
61 LARGE_INTEGER fileSize;
62 if (!GetFileSizeEx(
handle, &fileSize)) {
66 if (
header.unitSize != fileSize.QuadPart) {
72 HANDLE fileMappingHandle = CreateFileMapping(
handle, 0, PAGE_READONLY, 0, 0, 0);
73 if (!fileMappingHandle) {
78 auto mappingCleanup =
qScopeGuard([fileMappingHandle]{
79 CloseHandle(fileMappingHandle);
82 dataPtr = MapViewOfFile(fileMappingHandle, FILE_MAP_READ, 0, 0, 0);
91void CompilationUnitMapper::close()
93 if (dataPtr !=
nullptr) {
100 UnmapViewOfFile(dataPtr);
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
const QChar * constData() const
Returns a pointer to the data stored in the QString.
Combined button and popup list for selecting options.
static QString header(const QString &name)
Q_DECL_COLD_FUNCTION Q_CORE_EXPORT QString qt_error_string(int errorCode=-1)
GLuint64 GLenum void * handle
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
#define QStringLiteral(str)