Home | History | Annotate | Download | only in win

Lines Matching defs:Handle

35 SharedMemory::Handle::Handle()
41 SharedMemory::Handle::~Handle()
49 bool SharedMemory::Handle::isNull() const
54 void SharedMemory::Handle::encode(CoreIPC::ArgumentEncoder* encoder) const
58 // Hand off ownership of our HANDLE to the receiving process. It will close it for us.
64 // Send along our PID so that the receiving process can duplicate the HANDLE for its own use.
68 static bool getDuplicatedHandle(HANDLE sourceHandle, DWORD sourcePID, HANDLE& duplicatedHandle)
74 HANDLE sourceProcess = ::OpenProcess(PROCESS_DUP_HANDLE, FALSE, sourcePID);
78 // Copy the handle into our process and close the handle that the sending process created for us.
87 bool SharedMemory::Handle::decode(CoreIPC::ArgumentDecoder* decoder, Handle& handle)
89 ASSERT_ARG(handle, !handle.m_handle);
90 ASSERT_ARG(handle, !handle.m_size);
104 HANDLE duplicatedHandle;
105 if (!getDuplicatedHandle(reinterpret_cast<HANDLE>(sourceHandle), sourcePID, duplicatedHandle))
108 handle.m_handle = duplicatedHandle;
109 handle.m_size = size;
115 HANDLE handle = ::CreateFileMappingW(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size, 0);
116 if (!handle)
119 void* baseAddress = ::MapViewOfFile(handle, FILE_MAP_ALL_ACCESS, 0, 0, size);
121 ::CloseHandle(handle);
128 memory->m_handle = handle;
146 PassRefPtr<SharedMemory> SharedMemory::create(const Handle& handle, Protection protection)
148 RefPtr<SharedMemory> memory = adopt(handle.m_handle, handle.m_size, protection);
152 // The SharedMemory object now owns the HANDLE.
153 handle.m_handle = 0;
158 PassRefPtr<SharedMemory> SharedMemory::adopt(HANDLE handle, size_t size, Protection protection)
160 if (!handle)
165 void* baseAddress = ::MapViewOfFile(handle, desiredAccess, 0, 0, size);
173 memory->m_handle = handle;
187 bool SharedMemory::createHandle(Handle& handle, Protection protection)
189 ASSERT_ARG(handle, !handle.m_handle);
190 ASSERT_ARG(handle, !handle.m_size);
192 HANDLE processHandle = ::GetCurrentProcess();
194 HANDLE duplicatedHandle;
198 handle.m_handle = duplicatedHandle;
199 handle.m_size = m_size;