20 cbThrow(
_T(
"Input exceeds shared memory size (error 0x0000cde0)."));
33 cbThrow(
_T(
"Congrats, you managed to kill process 1 within nanoseconds after launching process 2, which is quite hard to do.\n\nPlease inform the Code::Blocks team of your achievement."));
59 if (cbframe ==
nullptr)
72 #if defined (__WIN32__) 78 sem[
reader] = CreateSemaphore(
nullptr, 0, 1, TEXT(
"CdeBlsemIPCr"));
79 sem[
writer] = CreateSemaphore(
nullptr, 1, 1, TEXT(
"CdeBlsemIPCw"));
81 if (GetLastError() != ERROR_ALREADY_EXISTS)
86 handle = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0,
ipc_buf_size, TEXT(
"CdeBlshmIPC"));
109 return WaitForSingleObject(sem[
reader], INFINITE) == WAIT_OBJECT_0
110 && WaitForSingleObject(sem[
writer], INFINITE) == WAIT_OBJECT_0;
114 return WaitForSingleObject(sem[
writer], INFINITE) == WAIT_OBJECT_0;
124 ReleaseSemaphore(sem[
writer], 1,
nullptr);
128 ReleaseSemaphore(sem[
reader], 1,
nullptr);
129 ReleaseSemaphore(sem[
writer], 1,
nullptr);
150 if (readlink(
"/proc/self/exe", file,
sizeof(file)) < 0)
152 if (readlink(
"/proc/self/file", file,
sizeof(file)) < 0)
154 strcpy(file,
"/tmp/fuckyou");
155 close(open(file, O_CREAT, O_RDONLY|O_WRONLY));
159 key = ftok(file,
'a');
160 semid = semget(key, 2, IPC_CREAT | 0666);
168 key = ftok(file,
'b');
195 unsigned short int v[2] = {0, 1};
196 semctl(semid, 0, SETALL, v);
209 shmctl(
handle, IPC_RMID, 0);
210 semctl(semid, 0, IPC_RMID );
228 return semop(semid, op, 2) == 0;
238 return semop(semid, op, 1) == 0;
const wxString g_failed_sem(_T("Failed creating semaphore/mutex initialising IPC (error 0x007f0002)."))
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
volatile bool is_shutdown
static LogManager * Get()
static const int ipc_buf_size
void Panic(const wxString &msg, const wxString &component=wxEmptyString)
wxUSE_UNICODE_dependent wxChar
const wxString g_failed_shm(_T("Failed creating shared memory initialising IPC (error 0x00000d04)."))
wxFrame * GetAppFrame() const
void * BasePointer() const
wxArrayString wxStringTokenize(const wxString &str, const wxString &delims=wxDEFAULT_DELIMITERS, wxStringTokenizerMode mode=wxTOKEN_DEFAULT)
bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames)
void Send(const wxString &value)