mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-08 14:36:22 +01:00
2f200d4fa1
POSIX was out of whack with Windows as a result of the changes made around channels. The schedular in posix was very different, and this commit brings it into line. Other than the obvious issues, a non-obvious issue with the changes was that the channel was being freed up on close prior to the thread terminating. This doesn't appear to be an issue on Windows, but was causing crashes on close in POSIX. The changes go quite deep. This changeset requires a lot of testing.
24 lines
839 B
C
24 lines
839 B
C
#ifndef _METERPRETER_LIB_SCHEDULER_H
|
|
#define _METERPRETER_LIB_SCHEDULER_H
|
|
|
|
#include "linkage.h"
|
|
#include "remote.h"
|
|
|
|
typedef enum
|
|
{
|
|
Pause = 1,
|
|
Resume = 2,
|
|
Stop = 3
|
|
} SchedularSignal;
|
|
|
|
typedef DWORD (*WaitableNotifyRoutine)(Remote *remote, LPVOID entryContext, LPVOID threadContext);
|
|
typedef DWORD (*WaitableDestroyRoutine)(HANDLE waitable, LPVOID entryContext, LPVOID threadContext);
|
|
|
|
LINKAGE DWORD scheduler_initialize( Remote * remote );
|
|
LINKAGE DWORD scheduler_destroy( VOID );
|
|
LINKAGE DWORD scheduler_insert_waitable( HANDLE waitable, LPVOID entryContext, LPVOID threadContext, WaitableNotifyRoutine routine, WaitableDestroyRoutine destroy );
|
|
LINKAGE DWORD scheduler_signal_waitable( HANDLE waitable, SchedularSignal signal );
|
|
LINKAGE DWORD THREADCALL scheduler_waitable_thread( THREAD * thread );
|
|
|
|
#endif
|