47 #ifndef QT_NO_SHAREDMEMORY 56 systemSemaphore(
QString()), lockedByMe(false),
64 DWORD windowsError = GetLastError();
65 if (windowsError == 0)
68 switch (windowsError) {
69 case ERROR_ALREADY_EXISTS:
73 case ERROR_FILE_NOT_FOUND:
77 case ERROR_INVALID_PARAMETER:
82 case ERROR_COMMITMENT_LIMIT:
86 case ERROR_NO_SYSTEM_RESOURCES:
87 case ERROR_NOT_ENOUGH_MEMORY:
91 case ERROR_ACCESS_DENIED:
98 #ifdef QSHAREDMEMORY_DEBUG 119 hand = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, 0, (
wchar_t*)
nativeKey.
utf16());
130 if (hand != 0 && !CloseHandle(hand))
144 hand = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size, (
wchar_t*)
nativeKey.
utf16());
155 memory = (
void *)MapViewOfFile(
handle(), permissions, 0, 0, 0);
163 MEMORY_BASIC_INFORMATION
info;
164 if (!VirtualQuery(
memory, &info,
sizeof(info))) {
171 size = info.RegionSize;
179 if (!UnmapViewOfFile(
memory)) {
194 #endif // QT_NO_SHAREDMEMORY
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
QSharedMemory::SharedMemoryError error
void setErrorString(const QString &function)
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Q_CORE_EXPORT void qDebug(const char *,...)
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
HANDLE handle()
If not already made create the handle used for accessing the shared memory.
bool attach(QSharedMemory::AccessMode mode)
#define QT_NO_SYSTEMSEMAPHORE
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
The QSharedMemory class provides access to a shared memory segment.
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.