Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions | Variables
_winnt.h File Reference
#include <windows.h>
#include <winsock.h>
#include <errno.h>
#include "prio.h"
#include "prclist.h"

Go to the source code of this file.

Classes

struct  addrinfo
struct  _md_in6_addr
struct  _md_sockaddr_in6
struct  _MDCPU
struct  _MDOverlapped
struct  _MDThread
struct  _MDThreadStack
struct  _MDSegment
struct  _MDLock
struct  _MDDir
struct  _MDCVar
struct  _MDSemaphore
struct  _MDFileDesc
struct  _MDProcess
struct  _MDFileMap
union  _md_in6_addr._S6_un
union  _MDOverlapped.data
struct  _MDOverlapped.data.mw

Defines

#define _WIN32_WINNT   0x0400
#define PR_LINKER_ARCH   "win32"
#define _PR_SI_SYSNAME   "WINNT"
#define _PR_SI_ARCHITECTURE   "x86" /* XXXMB hardcode for now */
#define HAVE_DLL
#define HAVE_CUSTOM_USER_THREADS
#define HAVE_THREAD_AFFINITY
#define _PR_HAVE_GETADDRINFO
#define _PR_INET6_PROBE
#define AF_INET6   23
#define AI_CANONNAME   0x2
#define _PR_HAVE_MD_SOCKADDR_IN6
#define _PR_HAVE_THREADSAFE_GETHOST
#define _PR_HAVE_ATOMIC_OPS
#define _PR_HAVE_ATOMIC_CAS
#define PR_HAVE_WIN32_NAMED_SHARED_MEMORY
#define _PR_HAVE_PEEK_BUFFER
#define _PR_PEEK_BUFFER_MAX   (32 * 1024)
#define _PR_FD_NEED_EMULATE_MSG_PEEK(fd)   (!(fd)->secret->nonblocking && (fd)->secret->inheritable != _PR_TRI_TRUE)
#define _PR_NEED_SECRET_AF
#define PR_NUM_GCREGS   8
#define GC_VMBASE   0x40000000
#define GC_VMLIMIT   0x00FFFFFF
#define _MD_MAGIC_THREAD   0x22222222
#define _MD_MAGIC_THREADSTACK   0x33333333
#define _MD_MAGIC_SEGMENT   0x44444444
#define _MD_MAGIC_DIR   0x55555555
#define _MD_GET_SP(thread)   (thread)->md.gcContext[6]
#define _MD_OPEN   _PR_MD_OPEN
#define _MD_OPEN_FILE   _PR_MD_OPEN_FILE
#define _MD_READ   _PR_MD_READ
#define _MD_WRITE   _PR_MD_WRITE
#define _MD_WRITEV   _PR_MD_WRITEV
#define _MD_LSEEK   _PR_MD_LSEEK
#define _MD_LSEEK64   _PR_MD_LSEEK64
#define _MD_CLOSE_FILE(f)   _PR_MD_CLOSE(f, PR_FALSE)
#define _MD_GETFILEINFO   _PR_MD_GETFILEINFO
#define _MD_GETFILEINFO64   _PR_MD_GETFILEINFO64
#define _MD_GETOPENFILEINFO   _PR_MD_GETOPENFILEINFO
#define _MD_GETOPENFILEINFO64   _PR_MD_GETOPENFILEINFO64
#define _MD_STAT   _PR_MD_STAT
#define _MD_RENAME   _PR_MD_RENAME
#define _MD_ACCESS   _PR_MD_ACCESS
#define _MD_DELETE   _PR_MD_DELETE
#define _MD_MKDIR   _PR_MD_MKDIR
#define _MD_MAKE_DIR   _PR_MD_MAKE_DIR
#define _MD_RMDIR   _PR_MD_RMDIR
#define _MD_LOCKFILE   _PR_MD_LOCKFILE
#define _MD_TLOCKFILE   _PR_MD_TLOCKFILE
#define _MD_UNLOCKFILE   _PR_MD_UNLOCKFILE
#define _MD_GET_SOCKET_ERROR()   WSAGetLastError()
#define _MD_SET_SOCKET_ERROR(_err)   WSASetLastError(_err)
#define _MD_INIT_FILEDESC(fd)
#define _MD_MAKE_NONBLOCK   _PR_MD_MAKE_NONBLOCK
#define _MD_INIT_FD_INHERITABLE   _PR_MD_INIT_FD_INHERITABLE
#define _MD_QUERY_FD_INHERITABLE   _PR_MD_QUERY_FD_INHERITABLE
#define _MD_SHUTDOWN   _PR_MD_SHUTDOWN
#define _MD_LISTEN   _PR_MD_LISTEN
#define _MD_CLOSE_SOCKET(s)   _PR_MD_CLOSE(s, PR_TRUE)
#define _MD_SENDTO   _PR_MD_SENDTO
#define _MD_RECVFROM   _PR_MD_RECVFROM
#define _MD_SOCKETPAIR(s, type, proto, sv)   -1
#define _MD_GETSOCKNAME   _PR_MD_GETSOCKNAME
#define _MD_GETPEERNAME   _PR_MD_GETPEERNAME
#define _MD_GETSOCKOPT   _PR_MD_GETSOCKOPT
#define _MD_SETSOCKOPT   _PR_MD_SETSOCKOPT
#define _MD_SELECT   select
#define _MD_FSYNC   _PR_MD_FSYNC
#define _MD_SOCKETAVAILABLE   _PR_MD_SOCKETAVAILABLE
#define _MD_PIPEAVAILABLE   _PR_MD_PIPEAVAILABLE
#define _MD_SET_FD_INHERITABLE   _PR_MD_SET_FD_INHERITABLE
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(x)   InterlockedIncrement((PLONG)x)
#define _MD_ATOMIC_ADD(ptr, val)   (InterlockedExchangeAdd((PLONG)ptr, (LONG)val) + val)
#define _MD_ATOMIC_DECREMENT(x)   InterlockedDecrement((PLONG)x)
#define _MD_ATOMIC_SET(x, y)   InterlockedExchange((PLONG)x, (LONG)y)
#define _MD_INIT_IO   _PR_MD_INIT_IO
#define _MD_SOCKET   _PR_MD_SOCKET
#define _MD_CONNECT   _PR_MD_CONNECT
#define _MD_ACCEPT(s, a, l, to)   _MD_FAST_ACCEPT(s, a, l, to, PR_FALSE, NULL, NULL)
#define _MD_FAST_ACCEPT(s, a, l, to, fast, cb, cba)   _PR_MD_FAST_ACCEPT(s, a, l, to, fast, cb, cba)
#define _MD_ACCEPT_READ(s, ns, ra, buf, l, t)   _MD_FAST_ACCEPT_READ(s, ns, ra, buf, l, t, PR_FALSE, NULL, NULL)
#define _MD_FAST_ACCEPT_READ(s, ns, ra, buf, l, t, fast, cb, cba)   _PR_MD_FAST_ACCEPT_READ(s, ns, ra, buf, l, t, fast, cb, cba)
#define _MD_UPDATE_ACCEPT_CONTEXT   _PR_MD_UPDATE_ACCEPT_CONTEXT
#define _MD_BIND   _PR_MD_BIND
#define _MD_RECV   _PR_MD_RECV
#define _MD_SEND   _PR_MD_SEND
#define _MD_SENDFILE   _PR_MD_SENDFILE
#define _MD_PR_POLL   _PR_MD_PR_POLL
#define _MD_PAUSE_CPU   _PR_MD_PAUSE_CPU
#define PR_DIRECTORY_SEPARATOR   '\\'
#define PR_DIRECTORY_SEPARATOR_STR   "\\"
#define PR_PATH_SEPARATOR   ';'
#define PR_PATH_SEPARATOR_STR   ";"
#define _MD_ERRNO()   GetLastError()
#define _MD_OPEN_DIR   _PR_MD_OPEN_DIR
#define _MD_CLOSE_DIR   _PR_MD_CLOSE_DIR
#define _MD_READ_DIR   _PR_MD_READ_DIR
#define _MD_INIT_SEGS()
#define _MD_ALLOC_SEGMENT(seg, size, vaddr)   0
#define _MD_FREE_SEGMENT(seg)
#define _MD_GET_ENV   _PR_MD_GET_ENV
#define _MD_PUT_ENV   _PR_MD_PUT_ENV
#define _MD_DEFAULT_STACK_SIZE   0
#define _MD_INIT_THREAD   _PR_MD_INIT_THREAD
#define _MD_INIT_ATTACHED_THREAD   _PR_MD_INIT_THREAD
#define _MD_CREATE_THREAD   _PR_MD_CREATE_THREAD
#define _MD_JOIN_THREAD   _PR_MD_JOIN_THREAD
#define _MD_END_THREAD   _PR_MD_END_THREAD
#define _MD_YIELD   _PR_MD_YIELD
#define _MD_SET_PRIORITY   _PR_MD_SET_PRIORITY
#define _MD_CLEAN_THREAD   _PR_MD_CLEAN_THREAD
#define _MD_SETTHREADAFFINITYMASK   _PR_MD_SETTHREADAFFINITYMASK
#define _MD_GETTHREADAFFINITYMASK   _PR_MD_GETTHREADAFFINITYMASK
#define _MD_EXIT_THREAD   _PR_MD_EXIT_THREAD
#define _MD_SUSPEND_THREAD   _PR_MD_SUSPEND_THREAD
#define _MD_RESUME_THREAD   _PR_MD_RESUME_THREAD
#define _MD_SUSPEND_CPU   _PR_MD_SUSPEND_CPU
#define _MD_RESUME_CPU   _PR_MD_RESUME_CPU
#define _MD_BEGIN_SUSPEND_ALL()
#define _MD_BEGIN_RESUME_ALL()
#define _MD_END_SUSPEND_ALL()
#define _MD_END_RESUME_ALL()
#define _MD_NEW_LOCK(lock)   (InitializeCriticalSection(&((lock)->mutex)),PR_SUCCESS)
#define _MD_FREE_LOCK(lock)   DeleteCriticalSection(&((lock)->mutex))
#define _MD_LOCK(lock)   EnterCriticalSection(&((lock)->mutex))
#define _MD_TEST_AND_LOCK(lock)   (TryEnterCriticalSection(&((lock)->mutex))== FALSE)
#define _MD_UNLOCK(lock)   LeaveCriticalSection(&((lock)->mutex))
#define _PR_LOCK   _MD_LOCK
#define _PR_UNLOCK   _MD_UNLOCK
#define _MD_WAIT   _PR_MD_WAIT
#define _MD_WAKEUP_WAITER   _PR_MD_WAKEUP_WAITER
#define _MD_IOQ_LOCK()   _MD_LOCK(&_pr_ioq_lock)
#define _MD_IOQ_UNLOCK()   _MD_UNLOCK(&_pr_ioq_lock)
#define _MD_START_INTERRUPTS()
#define _MD_STOP_INTERRUPTS()
#define _MD_DISABLE_CLOCK_INTERRUPTS()
#define _MD_ENABLE_CLOCK_INTERRUPTS()
#define _MD_BLOCK_CLOCK_INTERRUPTS()
#define _MD_UNBLOCK_CLOCK_INTERRUPTS()
#define _MD_EARLY_INIT   _PR_MD_EARLY_INIT
#define _MD_FINAL_INIT()
#define _MD_INIT_CPUS()
#define _MD_INIT_RUNNING_CPU(cpu)
#define _MD_CREATE_PROCESS   _PR_CreateWindowsProcess
#define _MD_DETACH_PROCESS   _PR_DetachWindowsProcess
#define _MD_WAIT_PROCESS   _PR_WaitWindowsProcess
#define _MD_KILL_PROCESS   _PR_KillWindowsProcess
#define HAVE_FIBERS
#define _MD_CREATE_USER_THREAD   _PR_MD_CREATE_USER_THREAD
#define _MD_CREATE_PRIMORDIAL_USER_THREAD   _PR_MD_CREATE_PRIMORDIAL_USER_THREAD
#define _MD_CLEANUP_BEFORE_EXIT   _PR_MD_CLEANUP_BEFORE_EXIT
#define _MD_EXIT   _PR_MD_EXIT
#define _MD_INIT_CONTEXT   _PR_MD_INIT_CONTEXT
#define _MD_SWITCH_CONTEXT   _PR_MD_SWITCH_CONTEXT
#define _MD_RESTORE_CONTEXT   _PR_MD_RESTORE_CONTEXT
#define _MD_INTERVAL_INIT   _PR_MD_INTERVAL_INIT
#define _MD_GET_INTERVAL   _PR_MD_GET_INTERVAL
#define _MD_INTERVAL_PER_SEC   _PR_MD_INTERVAL_PER_SEC
#define _MD_INTERVAL_PER_MILLISEC()   (_PR_MD_INTERVAL_PER_SEC() / 1000)
#define _MD_INTERVAL_PER_MICROSEC()   (_PR_MD_INTERVAL_PER_SEC() / 1000000)
#define _MD_GET_ATTACHED_THREAD()
#define _MD_SET_CURRENT_THREAD(_thread)
#define _MD_LAST_THREAD()
#define _MD_SET_LAST_THREAD(_thread)
#define _MD_CURRENT_CPU()
#define _MD_SET_CURRENT_CPU(_cpu)
#define _MD_GET_INTSOFF()
#define _MD_SET_INTSOFF(_val)
#define _MD_INIT_LOCKS()
#define _MD_INIT_STACK(stack, redzone)
#define _MD_CLEAR_STACK(stack)
#define _MD_CREATE_FILE_MAP   _MD_CreateFileMap
#define _MD_GET_MEM_MAP_ALIGNMENT   _MD_GetMemMapAlignment
#define _MD_MEM_MAP   _MD_MemMap
#define _MD_MEM_UNMAP   _MD_MemUnmap
#define _MD_CLOSE_FILE_MAP   _MD_CloseFileMap
#define _PR_HAVE_NAMED_SEMAPHORES
#define _MD_OPEN_SEMAPHORE   _PR_MD_OPEN_SEMAPHORE
#define _MD_WAIT_SEMAPHORE   _PR_MD_WAIT_SEMAPHORE
#define _MD_POST_SEMAPHORE   _PR_MD_POST_SEMAPHORE
#define _MD_CLOSE_SEMAPHORE   _PR_MD_CLOSE_SEMAPHORE
#define _MD_DELETE_SEMAPHORE(name)   PR_SUCCESS /* no op */

Typedefs

typedef void(* FiberFunc )(void *)
typedef PRInt32 PR_CONTEXT_TYPE [PR_NUM_GCREGS]
typedef struct _MDOverlapped _MDOverlapped

Enumerations

enum  _MDIOModel { _MD_BlockingIO = 0x38, _MD_MultiWaitIO = 0x49 }

Functions

void _PR_NT_InitSids (void)
void _PR_NT_FreeSids (void)
PRStatus _PR_NT_MakeSecurityDescriptorACL (PRIntn mode, DWORD accessTable[], PSECURITY_DESCRIPTOR *resultSD, PACL *resultACL)
void _PR_NT_FreeSecurityDescriptorACL (PSECURITY_DESCRIPTOR pSD, PACL pACL)
PRInt32 _md_Associate (HANDLE)
PRInt32 _PR_MD_CLOSE (PRInt32 osfd, PRBool socket)
int _PR_NTFiberSafeSelect (int, fd_set *, fd_set *, fd_set *, const struct timeval *)
void _PR_Unblock_IO_Wait (PRThread *thr)
struct PRProcess_PR_CreateWindowsProcess (const char *path, char *const *argv, char *const *envp, const struct PRProcessAttr *attr)
PRStatus _PR_DetachWindowsProcess (struct PRProcess *process)
PRStatus _PR_WaitWindowsProcess (struct PRProcess *process, PRInt32 *exitCode)
PRStatus _PR_KillWindowsProcess (struct PRProcess *process)
void _PR_FileTimeToPRTime (const FILETIME *filetime, PRTime *prtm)
 __declspec (thread) struct PRThread *_pr_current_fiber
struct PRThread_MD_CURRENT_THREAD (void)
PRStatus _MD_CreateFileMap (struct PRFileMap *fmap, PRInt64 size)
PRInt32 _MD_GetMemMapAlignment (void)
void_MD_MemMap (struct PRFileMap *fmap, PRInt64 offset, PRUint32 len)
PRStatus _MD_MemUnmap (void *addr, PRUint32 size)
PRStatus _MD_CloseFileMap (struct PRFileMap *fmap)

Variables

struct PRLock_pr_schedLock
BOOL _pr_use_static_tls
DWORD _pr_currentFiberIndex
DWORD _pr_lastFiberIndex
DWORD _pr_currentCPUIndex
DWORD _pr_intsOffIndex

Class Documentation

struct addrinfo

Definition at line 120 of file _openvms.h.

Collaboration diagram for addrinfo:
Class Members
struct sockaddr * ai_addr
size_t ai_addrlen
char * ai_canonname
int ai_family
int ai_flags
struct addrinfo * ai_next
int ai_protocol
int ai_socktype
struct _md_in6_addr

Definition at line 115 of file _hpux.h.

Class Members
union _md_in6_addr _S6_un
union _md_in6_addr _S6_un
union _md_in6_addr _s6_un
union _md_in6_addr _S6_un
union _md_in6_addr _S6_un
struct _md_sockaddr_in6

Definition at line 124 of file _hpux.h.

Class Members
PRUint32 __sin6_src_id
PRInt16 sin6_family
PRUint16 sin6_family
PRUint32 sin6_flowinfo
PRUint16 sin6_port
PRUint32 sin6_scope_id
struct _MDCPU

Definition at line 221 of file _aix.h.

Collaboration diagram for _MDCPU:
Class Members
PRInt16 fd_exception_cnt
fd_set fd_exception_set
PRInt16 fd_read_cnt
fd_set fd_read_set
PRInt16 fd_write_cnt
fd_set fd_write_set
PRInt32 id
PRCList ioQ
PRInt32 ioq_max_osfd
PRUint32 ioq_timeout
AbsoluteTime lastThreadSwitch
AbsoluteTime lastWakeUpProcess
PRInt32 suspending_id
PRBool trackScheduling
int unused
int8 unused
struct _MDOverlapped

Definition at line 144 of file _winnt.h.

Class Members
enum _MDIOModel union _MDOverlapped data
OVERLAPPED overlapped
struct _MDThreadStack

Definition at line 165 of file _aix.h.

Class Members
PRIntn cxByteCount
PRUint32 magic
PRInt8 notused
char * stackTop
struct _MDSegment

Definition at line 181 of file _aix.h.

Class Members
PRUint32 magic
PRInt8 notused
struct _MDLock

Definition at line 169 of file _aix.h.

Class Members
usptr_t * arena
int32 benaphoreCount
ulock_t lock
PRUint32 magic
PRUint32 mutex
CRITICAL_SECTION mutex
HMTX mutex
PRInt8 notused
sem_id semaphoreID
struct _MDDir

Definition at line 170 of file _beos.h.

Collaboration diagram for _MDDir:
Class Members
char * currentEntryName
DIR * d
WIN32_FIND_DATA d_entry
union _MDDir d_entry
HANDLE d_hdl
HDIR d_hdl
struct dirent * dir
PRBool firstEntry
long ioDirID
short ioFDirIndex
short ioVRefNum
PRUint32 magic
struct _MDCVar

Definition at line 177 of file _aix.h.

Collaboration diagram for _MDCVar:
Class Members
int16 count
PRUint32 magic
ulock_t mdcvar_lock
PRInt8 notused
PRIntn nwait
sem_id sem1
sem_id sem2
PRUint32 unused
struct PRThread * waitHead
struct PRThread * waitTail
struct _MDSemaphore

Definition at line 173 of file _aix.h.

Class Members
PRInt8 notused
HEV sem
HANDLE sem
usema_t * sem
sem_id sid
PRInt32 unused
struct _MDFileDesc

Definition at line 158 of file _beos.h.

Collaboration diagram for _MDFileDesc:
Class Members
PRBool accepted_socket
int connectReturnError
int connectReturnValue
PRBool connectValueValid
OTReason disconnectError
PRBool doListen
PRPackedBool exceptReady
PRBool io_model_committed
_MDSocketCallerInfo misc
PRLock * miscLock
PRPackedBool orderlyDisconnect
int osfd
PRInt32 osfd
PRNetAddr peer_addr
_MDSocketCallerInfo read
PRPackedBool readReady
PRInt32 sock_state
PRBool sync_file_io
_MDSocketCallerInfo write
PRPackedBool writeReady
struct _MDProcess

Definition at line 141 of file _beos.h.

Class Members
HANDLE handle
DWORD id
PRInt8 notused
pid_t pid
PID pid
struct _MDFileMap

Definition at line 183 of file _beos.h.

Class Members
DWORD dwAccess
PRIntn flags
HANDLE hFileMap
PRBool isAnonFM
PRIntn prot
PRInt8 unused
union _md_in6_addr._S6_un

Definition at line 93 of file _winnt.h.

Class Members
PRUint16 _S6_u16
PRUint8 _S6_u8
union _MDOverlapped.data

Definition at line 150 of file _winnt.h.

Class Members
struct _MDThread * mdThread
data mw
struct _MDOverlapped.data.mw

Definition at line 155 of file _winnt.h.

Class Members
struct PRRecvWait * desc
DWORD error
struct PRWaitGroup * group
PRCList links
struct TimerEvent * timer

Define Documentation

#define _MD_ACCEPT (   s,
  a,
  l,
  to 
)    _MD_FAST_ACCEPT(s, a, l, to, PR_FALSE, NULL, NULL)

Definition at line 352 of file _winnt.h.

#define _MD_ACCEPT_READ (   s,
  ns,
  ra,
  buf,
  l,
  t 
)    _MD_FAST_ACCEPT_READ(s, ns, ra, buf, l, t, PR_FALSE, NULL, NULL)

Definition at line 356 of file _winnt.h.

Definition at line 301 of file _winnt.h.

#define _MD_ALLOC_SEGMENT (   seg,
  size,
  vaddr 
)    0

Definition at line 383 of file _winnt.h.

#define _MD_ATOMIC_ADD (   ptr,
  val 
)    (InterlockedExchangeAdd((PLONG)ptr, (LONG)val) + val)

Definition at line 343 of file _winnt.h.

#define _MD_ATOMIC_DECREMENT (   x)    InterlockedDecrement((PLONG)x)

Definition at line 344 of file _winnt.h.

#define _MD_ATOMIC_INCREMENT (   x)    InterlockedIncrement((PLONG)x)

Definition at line 342 of file _winnt.h.

#define _MD_ATOMIC_SET (   x,
  y 
)    InterlockedExchange((PLONG)x, (LONG)y)

Definition at line 346 of file _winnt.h.

Definition at line 408 of file _winnt.h.

Definition at line 407 of file _winnt.h.

Definition at line 362 of file _winnt.h.

Definition at line 453 of file _winnt.h.

Definition at line 399 of file _winnt.h.

Definition at line 487 of file _winnt.h.

Definition at line 578 of file _winnt.h.

Definition at line 378 of file _winnt.h.

Definition at line 294 of file _winnt.h.

Definition at line 601 of file _winnt.h.

Definition at line 608 of file _winnt.h.

Definition at line 320 of file _winnt.h.

Definition at line 350 of file _winnt.h.

Definition at line 588 of file _winnt.h.

#define _MD_CREATE_PRIMORDIAL_USER_THREAD   _PR_MD_CREATE_PRIMORDIAL_USER_THREAD

Definition at line 486 of file _winnt.h.

Definition at line 464 of file _winnt.h.

Definition at line 394 of file _winnt.h.

#define _MD_CREATE_USER_THREAD   _PR_MD_CREATE_USER_THREAD

Definition at line 485 of file _winnt.h.

Value:
(_pr_use_static_tls ? _pr_current_cpu \
    : (struct _PRCPU *) TlsGetValue(_pr_currentCPUIndex))

Definition at line 544 of file _winnt.h.

Definition at line 391 of file _winnt.h.

Definition at line 302 of file _winnt.h.

#define _MD_DELETE_SEMAPHORE (   name)    PR_SUCCESS /* no op */

Definition at line 609 of file _winnt.h.

Definition at line 472 of file _winnt.h.

Definition at line 451 of file _winnt.h.

Definition at line 455 of file _winnt.h.

Definition at line 452 of file _winnt.h.

Definition at line 410 of file _winnt.h.

Definition at line 409 of file _winnt.h.

Definition at line 396 of file _winnt.h.

Definition at line 376 of file _winnt.h.

Definition at line 488 of file _winnt.h.

Definition at line 402 of file _winnt.h.

#define _MD_FAST_ACCEPT (   s,
  a,
  l,
  to,
  fast,
  cb,
  cba 
)    _PR_MD_FAST_ACCEPT(s, a, l, to, fast, cb, cba)

Definition at line 354 of file _winnt.h.

#define _MD_FAST_ACCEPT_READ (   s,
  ns,
  ra,
  buf,
  l,
  t,
  fast,
  cb,
  cba 
)    _PR_MD_FAST_ACCEPT_READ(s, ns, ra, buf, l, t, fast, cb, cba)

Definition at line 358 of file _winnt.h.

Definition at line 456 of file _winnt.h.

#define _MD_FREE_LOCK (   lock)    DeleteCriticalSection(&((lock)->mutex))

Definition at line 416 of file _winnt.h.

Definition at line 384 of file _winnt.h.

Definition at line 331 of file _winnt.h.

Value:
(_pr_use_static_tls ? _pr_current_fiber \
    : (PRThread *) TlsGetValue(_pr_currentFiberIndex))

Definition at line 510 of file _winnt.h.

Definition at line 387 of file _winnt.h.

Definition at line 495 of file _winnt.h.

Value:
(_pr_use_static_tls ? _pr_ints_off \
    : (PRUintn) TlsGetValue(_pr_intsOffIndex))

Definition at line 560 of file _winnt.h.

Definition at line 591 of file _winnt.h.

Definition at line 311 of file _winnt.h.

#define _MD_GET_SP (   thread)    (thread)->md.gcContext[6]

Definition at line 267 of file _winnt.h.

Definition at line 295 of file _winnt.h.

Definition at line 296 of file _winnt.h.

Definition at line 297 of file _winnt.h.

Definition at line 298 of file _winnt.h.

Definition at line 325 of file _winnt.h.

Definition at line 324 of file _winnt.h.

Definition at line 326 of file _winnt.h.

Definition at line 401 of file _winnt.h.

Definition at line 336 of file _winnt.h.

Definition at line 393 of file _winnt.h.

Definition at line 489 of file _winnt.h.

Definition at line 457 of file _winnt.h.

Definition at line 316 of file _winnt.h.

Definition at line 314 of file _winnt.h.

Definition at line 348 of file _winnt.h.

Definition at line 574 of file _winnt.h.

Definition at line 458 of file _winnt.h.

Definition at line 382 of file _winnt.h.

Definition at line 577 of file _winnt.h.

Definition at line 392 of file _winnt.h.

Definition at line 494 of file _winnt.h.

Definition at line 498 of file _winnt.h.

Definition at line 497 of file _winnt.h.

Definition at line 496 of file _winnt.h.

#define _MD_IOQ_LOCK ( )    _MD_LOCK(&_pr_ioq_lock)

Definition at line 444 of file _winnt.h.

#define _MD_IOQ_UNLOCK ( )    _MD_UNLOCK(&_pr_ioq_lock)

Definition at line 445 of file _winnt.h.

Definition at line 395 of file _winnt.h.

Definition at line 480 of file _winnt.h.

Value:
(_pr_use_static_tls ? _pr_fiber_last_run \
    : (PRThread *) TlsGetValue(_pr_lastFiberIndex))

Definition at line 528 of file _winnt.h.

Definition at line 319 of file _winnt.h.

#define _MD_LOCK (   lock)    EnterCriticalSection(&((lock)->mutex))

Definition at line 418 of file _winnt.h.

Definition at line 306 of file _winnt.h.

Definition at line 292 of file _winnt.h.

Definition at line 293 of file _winnt.h.

#define _MD_MAGIC_DIR   0x55555555

Definition at line 133 of file _winnt.h.

#define _MD_MAGIC_SEGMENT   0x44444444

Definition at line 132 of file _winnt.h.

#define _MD_MAGIC_THREAD   0x22222222

Definition at line 130 of file _winnt.h.

#define _MD_MAGIC_THREADSTACK   0x33333333

Definition at line 131 of file _winnt.h.

Definition at line 304 of file _winnt.h.

Definition at line 315 of file _winnt.h.

Definition at line 595 of file _winnt.h.

Definition at line 598 of file _winnt.h.

Definition at line 303 of file _winnt.h.

#define _MD_NEW_LOCK (   lock)    (InitializeCriticalSection(&((lock)->mutex)),PR_SUCCESS)

Definition at line 415 of file _winnt.h.

Definition at line 287 of file _winnt.h.

Definition at line 377 of file _winnt.h.

Definition at line 288 of file _winnt.h.

Definition at line 605 of file _winnt.h.

Definition at line 369 of file _winnt.h.

Definition at line 333 of file _winnt.h.

Definition at line 607 of file _winnt.h.

Definition at line 366 of file _winnt.h.

Definition at line 388 of file _winnt.h.

Definition at line 317 of file _winnt.h.

Definition at line 289 of file _winnt.h.

Definition at line 379 of file _winnt.h.

Definition at line 363 of file _winnt.h.

Definition at line 322 of file _winnt.h.

Definition at line 300 of file _winnt.h.

Definition at line 491 of file _winnt.h.

Definition at line 406 of file _winnt.h.

Definition at line 404 of file _winnt.h.

Definition at line 305 of file _winnt.h.

Definition at line 328 of file _winnt.h.

Definition at line 364 of file _winnt.h.

Definition at line 365 of file _winnt.h.

Definition at line 321 of file _winnt.h.

Value:
PR_BEGIN_MACRO \
        if (_pr_use_static_tls) { \
            _pr_current_cpu = (_cpu); \
        } else { \
            TlsSetValue(_pr_currentCPUIndex, (_cpu)); \
        } \
    PR_END_MACRO

Definition at line 548 of file _winnt.h.

Value:
PR_BEGIN_MACRO \
        if (_pr_use_static_tls) { \
            _pr_current_fiber = (_thread); \
        } else { \
            TlsSetValue(_pr_currentFiberIndex, (_thread)); \
        } \
    PR_END_MACRO

Definition at line 516 of file _winnt.h.

Definition at line 334 of file _winnt.h.

#define _MD_SET_INTSOFF (   _val)
Value:
PR_BEGIN_MACRO \
        if (_pr_use_static_tls) { \
            _pr_ints_off = (_val); \
        } else { \
            TlsSetValue(_pr_intsOffIndex, (LPVOID) (_val)); \
        } \
    PR_END_MACRO

Definition at line 564 of file _winnt.h.

#define _MD_SET_LAST_THREAD (   _thread)
Value:
PR_BEGIN_MACRO \
        if (_pr_use_static_tls) { \
            _pr_fiber_last_run = (_thread); \
        } else { \
            TlsSetValue(_pr_lastFiberIndex, (_thread)); \
        } \
    PR_END_MACRO

Definition at line 532 of file _winnt.h.

Definition at line 398 of file _winnt.h.

#define _MD_SET_SOCKET_ERROR (   _err)    WSASetLastError(_err)

Definition at line 312 of file _winnt.h.

Definition at line 327 of file _winnt.h.

Definition at line 400 of file _winnt.h.

Definition at line 318 of file _winnt.h.

Definition at line 349 of file _winnt.h.

Definition at line 332 of file _winnt.h.

#define _MD_SOCKETPAIR (   s,
  type,
  proto,
  sv 
)    -1

Definition at line 323 of file _winnt.h.

Definition at line 449 of file _winnt.h.

Definition at line 299 of file _winnt.h.

Definition at line 450 of file _winnt.h.

Definition at line 405 of file _winnt.h.

Definition at line 403 of file _winnt.h.

Definition at line 490 of file _winnt.h.

#define _MD_TEST_AND_LOCK (   lock)    (TryEnterCriticalSection(&((lock)->mutex))== FALSE)

Definition at line 419 of file _winnt.h.

Definition at line 307 of file _winnt.h.

Definition at line 454 of file _winnt.h.

#define _MD_UNLOCK (   lock)    LeaveCriticalSection(&((lock)->mutex))

Definition at line 420 of file _winnt.h.

Definition at line 308 of file _winnt.h.

Definition at line 360 of file _winnt.h.

Definition at line 439 of file _winnt.h.

Definition at line 476 of file _winnt.h.

Definition at line 606 of file _winnt.h.

Definition at line 440 of file _winnt.h.

Definition at line 290 of file _winnt.h.

Definition at line 291 of file _winnt.h.

Definition at line 397 of file _winnt.h.

#define _PR_FD_NEED_EMULATE_MSG_PEEK (   fd)    (!(fd)->secret->nonblocking && (fd)->secret->inheritable != _PR_TRI_TRUE)

Definition at line 113 of file _winnt.h.

Definition at line 109 of file _winnt.h.

Definition at line 108 of file _winnt.h.

Definition at line 72 of file _winnt.h.

Definition at line 90 of file _winnt.h.

Definition at line 604 of file _winnt.h.

Definition at line 111 of file _winnt.h.

Definition at line 107 of file _winnt.h.

Definition at line 73 of file _winnt.h.

Definition at line 435 of file _winnt.h.

Definition at line 115 of file _winnt.h.

#define _PR_PEEK_BUFFER_MAX   (32 * 1024)

Definition at line 112 of file _winnt.h.

#define _PR_SI_ARCHITECTURE   "x86" /* XXXMB hardcode for now */

Definition at line 67 of file _winnt.h.

#define _PR_SI_SYSNAME   "WINNT"

Definition at line 66 of file _winnt.h.

Definition at line 436 of file _winnt.h.

#define _WIN32_WINNT   0x0400

Definition at line 45 of file _winnt.h.

#define AF_INET6   23

Definition at line 75 of file _winnt.h.

#define AI_CANONNAME   0x2

Definition at line 78 of file _winnt.h.

#define GC_VMBASE   0x40000000

Definition at line 127 of file _winnt.h.

#define GC_VMLIMIT   0x00FFFFFF

Definition at line 128 of file _winnt.h.

Definition at line 70 of file _winnt.h.

Definition at line 69 of file _winnt.h.

Definition at line 484 of file _winnt.h.

Definition at line 71 of file _winnt.h.

Definition at line 372 of file _winnt.h.

Definition at line 373 of file _winnt.h.

Definition at line 110 of file _winnt.h.

#define PR_LINKER_ARCH   "win32"

Definition at line 65 of file _winnt.h.

Definition at line 125 of file _winnt.h.

Definition at line 374 of file _winnt.h.

Definition at line 375 of file _winnt.h.


Typedef Documentation

typedef struct _MDOverlapped _MDOverlapped
typedef void(* FiberFunc)(void *)

Definition at line 123 of file _winnt.h.

Definition at line 126 of file _winnt.h.


Enumeration Type Documentation

enum _MDIOModel
Enumerator:
_MD_BlockingIO 
_MD_MultiWaitIO 

Definition at line 139 of file _winnt.h.

                {
    _MD_BlockingIO = 0x38,
    _MD_MultiWaitIO = 0x49
};

Function Documentation

__declspec ( thread  )

Definition at line 72 of file ntio.c.

                                 {
    FILE_GENERIC_READ,
    FILE_GENERIC_WRITE,
    FILE_GENERIC_EXECUTE
};

Definition at line 1026 of file ntio.c.

{
    HANDLE port;

       if (!_native_threads_only) {
              port = CreateIoCompletionPort((HANDLE)file, 
                                                                      _pr_completion_port, 
                                                                      KEY_IO,
                                                                      0);

              /* XXX should map error codes on failures */
              return (port == _pr_completion_port);
       } else {
              return 1;
       }
}

Here is the caller graph for this function:

PRStatus _MD_CloseFileMap ( struct PRFileMap fmap)

Definition at line 1943 of file macio.c.

{
#pragma unused (fmap)

    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}
PRStatus _MD_CreateFileMap ( struct PRFileMap fmap,
PRInt64  size 
)

Definition at line 1910 of file macio.c.

{
#pragma unused (fmap, size)

    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}
struct PRThread* _MD_CURRENT_THREAD ( void  ) [read]

Definition at line 392 of file os2thred.c.

{
    PRThread *thread;

    thread = _MD_GET_ATTACHED_THREAD();

    if (NULL == thread) {
        thread = _PRI_AttachThread(PR_USER_THREAD, PR_PRIORITY_NORMAL, NULL, 0);
    }

    PR_ASSERT(thread != NULL);
    return thread;
}

Here is the call graph for this function:

Definition at line 1918 of file macio.c.

{
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return -1;
}
void* _MD_MemMap ( struct PRFileMap fmap,
PRInt64  offset,
PRUint32  len 
)

Definition at line 1924 of file macio.c.

{
#pragma unused (fmap, offset, len)

    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return NULL;
}

Here is the call graph for this function:

PRStatus _MD_MemUnmap ( void addr,
PRUint32  size 
)

Definition at line 1935 of file macio.c.

{
#pragma unused (addr, len)

    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}

Here is the call graph for this function:

struct PRProcess* _PR_CreateWindowsProcess ( const char *  path,
char *const argv,
char *const envp,
const struct PRProcessAttr attr 
) [read]

Definition at line 444 of file ntmisc.c.

{
    CloseHandle(process->md.handle);
    PR_DELETE(process);
    return PR_SUCCESS;
}
void _PR_FileTimeToPRTime ( const FILETIME *  filetime,
PRTime prtm 
)

Definition at line 2854 of file ntio.c.

{
    PR_ASSERT(sizeof(FILETIME) == sizeof(PRTime));
    CopyMemory(prtm, filetime, sizeof(PRTime));
#ifdef __GNUC__
    *prtm = (*prtm - _pr_filetime_offset) / 10LL;
#else
    *prtm = (*prtm - _pr_filetime_offset) / 10i64;
#endif

#ifdef DEBUG
    /* Doublecheck our calculation. */
    {
        SYSTEMTIME systime;
        PRExplodedTime etm;
        PRTime cmp; /* for comparison */
        BOOL rv;

        rv = FileTimeToSystemTime(filetime, &systime);
        PR_ASSERT(0 != rv);

        /*
         * PR_ImplodeTime ignores wday and yday.
         */
        etm.tm_usec = systime.wMilliseconds * PR_USEC_PER_MSEC;
        etm.tm_sec = systime.wSecond;
        etm.tm_min = systime.wMinute;
        etm.tm_hour = systime.wHour;
        etm.tm_mday = systime.wDay;
        etm.tm_month = systime.wMonth - 1;
        etm.tm_year = systime.wYear;
        /*
         * It is not well-documented what time zone the FILETIME's
         * are in.  WIN32_FIND_DATA is documented to be in UTC (GMT).
         * But BY_HANDLE_FILE_INFORMATION is unclear about this.
         * By our best judgement, we assume that FILETIME is in UTC.
         */
        etm.tm_params.tp_gmt_offset = 0;
        etm.tm_params.tp_dst_offset = 0;
        cmp = PR_ImplodeTime(&etm);

        /*
         * SYSTEMTIME is in milliseconds precision, so we convert PRTime's
         * microseconds to milliseconds before doing the comparison.
         */
        PR_ASSERT((cmp / PR_USEC_PER_MSEC) == (*prtm / PR_USEC_PER_MSEC));
    }
#endif /* DEBUG */
}

Here is the call graph for this function:

PRStatus _PR_KillWindowsProcess ( struct PRProcess process)

Definition at line 476 of file ntmisc.c.

{
    /*
     * On Unix, if a process terminates normally, its exit code is
     * between 0 and 255.  So here on Windows, we use the exit code
     * 256 to indicate that the process is killed.
     */
    if (TerminateProcess(process->md.handle, 256)) {
       return PR_SUCCESS;
    }
    PR_SetError(PR_UNKNOWN_ERROR, GetLastError());
    return PR_FAILURE;
}
PRInt32 _PR_MD_CLOSE ( PRInt32  osfd,
PRBool  socket 
)

Definition at line 2631 of file ntio.c.

{
    PRInt32 rv;
    PRThread *me = _PR_MD_CURRENT_THREAD();

    if (socket)  {
        rv = closesocket((SOCKET)osfd);
        if (rv < 0)
            _PR_MD_MAP_CLOSE_ERROR(WSAGetLastError());
    } else {
        rv = CloseHandle((HANDLE)osfd)?0:-1;
        if (rv < 0)
            _PR_MD_MAP_CLOSE_ERROR(GetLastError());
    }

    if (rv == 0 && me->io_suspended) {
        if (me->io_fd == osfd) {
            PRBool fWait;

            _PR_THREAD_LOCK(me);
            me->state = _PR_IO_WAIT;
            /* The IO could have completed on another thread just after
             * calling closesocket while the io_suspended flag was true.  
             * So we now grab the lock to do a safe check on io_pending to
             * see if we need to wait or not.
             */
            fWait = me->io_pending;
            me->io_suspended = PR_FALSE;
            me->md.interrupt_disabled = PR_TRUE;
            _PR_THREAD_UNLOCK(me);

            if (fWait)
                _NT_IO_WAIT(me, PR_INTERVAL_NO_TIMEOUT);
            PR_ASSERT(me->io_suspended ==  PR_FALSE);
            PR_ASSERT(me->io_pending ==  PR_FALSE);
            /*
             * I/O operation is no longer pending; the thread can now
             * run on any cpu
             */
            _PR_THREAD_LOCK(me);
            me->md.interrupt_disabled = PR_FALSE;
            me->md.thr_bound_cpu = NULL;
            me->io_suspended = PR_FALSE;
            me->io_pending = PR_FALSE;
            me->state = _PR_RUNNING;
            _PR_THREAD_UNLOCK(me);
        }
    }
    return rv;
}

Here is the call graph for this function:

void _PR_NT_FreeSecurityDescriptorACL ( PSECURITY_DESCRIPTOR  pSD,
PACL  pACL 
)

Definition at line 271 of file ntsec.c.

{
    if (pSD) {
        PR_Free(pSD);
    }
    if (pACL) {
        PR_Free(pACL);
    }
}

Definition at line 140 of file ntsec.c.

{
    if (_pr_nt_sids.owner) {
        PR_Free(_pr_nt_sids.owner);
    }
    if (_pr_nt_sids.group) {
        PR_Free(_pr_nt_sids.group);
    }
    if (_pr_nt_sids.everyone) {
        FreeSid(_pr_nt_sids.everyone);
    }
}

Definition at line 70 of file ntsec.c.

{
    SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
    HANDLE hToken = NULL; /* initialized to an arbitrary value to
                           * silence a Purify UMR warning */
    UCHAR infoBuffer[1024];
    PTOKEN_OWNER pTokenOwner = (PTOKEN_OWNER) infoBuffer;
    PTOKEN_PRIMARY_GROUP pTokenPrimaryGroup
            = (PTOKEN_PRIMARY_GROUP) infoBuffer;
    DWORD dwLength;
    BOOL rv;

    /*
     * Look up and make a copy of the owner and primary group
     * SIDs in the access token of the calling process.
     */
    rv = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken);
    if (rv == 0) {
        /*
         * On non-NT systems, this function is not implemented
         * (error code ERROR_CALL_NOT_IMPLEMENTED), and neither are
         * the other security functions.  There is no point in
         * going further.
         *
         * A process with insufficient access permissions may fail
         * with the error code ERROR_ACCESS_DENIED.
         */
        PR_LOG(_pr_io_lm, PR_LOG_DEBUG,
                ("_PR_NT_InitSids: OpenProcessToken() failed. Error: %d",
                GetLastError()));
        return;
    }

    rv = GetTokenInformation(hToken, TokenOwner, infoBuffer,
            sizeof(infoBuffer), &dwLength);
    PR_ASSERT(rv != 0);
    dwLength = GetLengthSid(pTokenOwner->Owner);
    _pr_nt_sids.owner = (PSID) PR_Malloc(dwLength);
    PR_ASSERT(_pr_nt_sids.owner != NULL);
    rv = CopySid(dwLength, _pr_nt_sids.owner, pTokenOwner->Owner);
    PR_ASSERT(rv != 0);

    rv = GetTokenInformation(hToken, TokenPrimaryGroup, infoBuffer,
            sizeof(infoBuffer), &dwLength);
    PR_ASSERT(rv != 0);
    dwLength = GetLengthSid(pTokenPrimaryGroup->PrimaryGroup);
    _pr_nt_sids.group = (PSID) PR_Malloc(dwLength);
    PR_ASSERT(_pr_nt_sids.group != NULL);
    rv = CopySid(dwLength, _pr_nt_sids.group,
            pTokenPrimaryGroup->PrimaryGroup);
    PR_ASSERT(rv != 0);

    rv = CloseHandle(hToken);
    PR_ASSERT(rv != 0);

    /* Create a well-known SID for the Everyone group. */
    rv = AllocateAndInitializeSid(&SIDAuthWorld, 1,
            SECURITY_WORLD_RID,
            0, 0, 0, 0, 0, 0, 0,
            &_pr_nt_sids.everyone);
    PR_ASSERT(rv != 0);
}
PRStatus _PR_NT_MakeSecurityDescriptorACL ( PRIntn  mode,
DWORD  accessTable[],
PSECURITY_DESCRIPTOR *  resultSD,
PACL *  resultACL 
)

Definition at line 165 of file ntsec.c.

{
    PSECURITY_DESCRIPTOR pSD = NULL;
    PACL pACL = NULL;
    DWORD cbACL;  /* size of ACL */
    DWORD accessMask;

    if (_pr_nt_sids.owner == NULL) {
        PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
        return PR_FAILURE;
    }

    pSD = (PSECURITY_DESCRIPTOR) PR_Malloc(SECURITY_DESCRIPTOR_MIN_LENGTH);
    if (pSD == NULL) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }
    if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }
    if (!SetSecurityDescriptorOwner(pSD, _pr_nt_sids.owner, FALSE)) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }
    if (!SetSecurityDescriptorGroup(pSD, _pr_nt_sids.group, FALSE)) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }

    /*
     * Construct a discretionary access-control list with three
     * access-control entries, one each for owner, primary group,
     * and Everyone.
     */

    cbACL = sizeof(ACL)
          + 3 * (sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD))
          + GetLengthSid(_pr_nt_sids.owner)
          + GetLengthSid(_pr_nt_sids.group)
          + GetLengthSid(_pr_nt_sids.everyone);
    pACL = (PACL) PR_Malloc(cbACL);
    if (pACL == NULL) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }
    if (!InitializeAcl(pACL, cbACL, ACL_REVISION)) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }
    accessMask = 0;
    if (mode & 00400) accessMask |= accessTable[0];
    if (mode & 00200) accessMask |= accessTable[1];
    if (mode & 00100) accessMask |= accessTable[2];
    if (accessMask && !AddAccessAllowedAce(pACL, ACL_REVISION, accessMask,
            _pr_nt_sids.owner)) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }
    accessMask = 0;
    if (mode & 00040) accessMask |= accessTable[0];
    if (mode & 00020) accessMask |= accessTable[1];
    if (mode & 00010) accessMask |= accessTable[2];
    if (accessMask && !AddAccessAllowedAce(pACL, ACL_REVISION, accessMask,
            _pr_nt_sids.group)) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }
    accessMask = 0;
    if (mode & 00004) accessMask |= accessTable[0];
    if (mode & 00002) accessMask |= accessTable[1];
    if (mode & 00001) accessMask |= accessTable[2];
    if (accessMask && !AddAccessAllowedAce(pACL, ACL_REVISION, accessMask,
            _pr_nt_sids.everyone)) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }

    if (!SetSecurityDescriptorDacl(pSD, TRUE, pACL, FALSE)) {
        _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
        goto failed;
    }

    *resultSD = pSD;
    *resultACL = pACL;
    return PR_SUCCESS;

failed:
    if (pSD) {
        PR_Free(pSD);
    }
    if (pACL) {
        PR_Free(pACL);
    }
    return PR_FAILURE;
}
int _PR_NTFiberSafeSelect ( int  ,
fd_set ,
fd_set ,
fd_set ,
const struct timeval  
)

Definition at line 68 of file w32poll.c.

{
    PRThread *me = _PR_MD_CURRENT_THREAD();
    int ready;

    if (_PR_IS_NATIVE_THREAD(me)) {
        ready = _MD_SELECT(nfds, readfds, writefds, exceptfds, timeout);
    }
    else
    {
        /*
        ** Creating a new thread on each call!!
        ** I guess web server doesn't use non-block I/O.
        */
        PRThread *selectThread;
        struct select_data_s data;
        data.status = 0;
        data.error = 0;
        data.rd = readfds;
        data.wt = writefds;
        data.ex = exceptfds;
        data.tv = timeout;

        selectThread = PR_CreateThread(
            PR_USER_THREAD, _PR_MD_select_thread, &data,
            PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
        if (selectThread == NULL) return -1;

        PR_JoinThread(selectThread);
        ready = data.status;
        if (ready == SOCKET_ERROR) WSASetLastError(data.error);
    }
    return ready;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3181 of file unix.c.

{
    int pri = thr->priority;
    _PRCPU *cpu = thr->cpu;
 
    /*
     * GLOBAL threads wakeup periodically to check for interrupt
     */
    if (_PR_IS_NATIVE_THREAD(thr)) {
        _PR_THREAD_UNLOCK(thr); 
        return;
    }

    PR_ASSERT(thr->flags & (_PR_ON_SLEEPQ | _PR_ON_PAUSEQ));
    _PR_SLEEPQ_LOCK(cpu);
    _PR_DEL_SLEEPQ(thr, PR_TRUE);
    _PR_SLEEPQ_UNLOCK(cpu);

    PR_ASSERT(!(thr->flags & _PR_IDLE_THREAD));
    thr->state = _PR_RUNNABLE;
    _PR_RUNQ_LOCK(cpu);
    _PR_ADD_RUNQ(thr, cpu, pri);
    _PR_RUNQ_UNLOCK(cpu);
    _PR_THREAD_UNLOCK(thr);
    _PR_MD_WAKEUP_WAITER(thr);
}

Here is the call graph for this function:

PRStatus _PR_WaitWindowsProcess ( struct PRProcess process,
PRInt32 exitCode 
)

Definition at line 455 of file ntmisc.c.

{
    DWORD dwRetVal;

    dwRetVal = WaitForSingleObject(process->md.handle, INFINITE);
    if (dwRetVal == WAIT_FAILED) {
        PR_SetError(PR_UNKNOWN_ERROR, GetLastError());
        return PR_FAILURE;
    }
    PR_ASSERT(dwRetVal == WAIT_OBJECT_0);
    if (exitCode != NULL &&
            GetExitCodeProcess(process->md.handle, exitCode) == FALSE) {
        PR_SetError(PR_UNKNOWN_ERROR, GetLastError());
        return PR_FAILURE;
    }
    CloseHandle(process->md.handle);
    PR_DELETE(process);
    return PR_SUCCESS;
}

Variable Documentation

Definition at line 49 of file w95thred.c.

Definition at line 42 of file ntthread.c.

Definition at line 45 of file ntthread.c.