ReactOS 0.4.16-dev-401-g45b008d
wintirpc.h File Reference
#include <stdlib.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#include <process.h>
#include <basetsd.h>
Include dependency graph for wintirpc.h:

Go to the source code of this file.

Classes

struct  timezone
 
struct  sockaddr_un
 

Macros

#define _CRT_SECURE_NO_WARNINGS   1
 
#define snprintf   _snprintf
 
#define strcasecmp   _stricmp
 
#define getpid   _getpid
 
#define bcmp   memcmp
 
#define bcopy(d, s, l)   memcpy(d,s,l)
 
#define bzero(d, s)   memset(d,0,s)
 
#define strtok_r   strtok_s
 
#define poll   WSAPoll
 
#define ioctl   ioctlsocket
 
#define __BEGIN_DECLS
 
#define __END_DECLS
 
#define __THROW
 
#define WINSOCK_HANDLE_HASH_SIZE   1024
 
#define WINSOCK_HANDLE_HASH(x)   (((x) >> 2) % WINSOCK_HANDLE_HASH_SIZE)
 
#define SOL_IPV6   IPPROTO_IPV6
 
#define MAXHOSTNAMELEN   256
 
#define SUN_LEN(ptr)   ((unsigned int)(sizeof(int) + strlen ((ptr)->sun_path)))
 

Functions

int gettimeofday (struct timeval *tv, struct timezone *tz)
 
int asprintf (char **str, const char *fmt,...)
 
void wintirpc_debug (char *fmt,...)
 

Macro Definition Documentation

◆ __BEGIN_DECLS

#define __BEGIN_DECLS

Definition at line 62 of file wintirpc.h.

◆ __END_DECLS

#define __END_DECLS

Definition at line 63 of file wintirpc.h.

◆ __THROW

#define __THROW

Definition at line 64 of file wintirpc.h.

◆ _CRT_SECURE_NO_WARNINGS

#define _CRT_SECURE_NO_WARNINGS   1

Definition at line 29 of file wintirpc.h.

◆ bcmp

#define bcmp   memcmp

Definition at line 54 of file wintirpc.h.

◆ bcopy

#define bcopy (   d,
  s,
  l 
)    memcpy(d,s,l)

Definition at line 55 of file wintirpc.h.

◆ bzero

#define bzero (   d,
  s 
)    memset(d,0,s)

Definition at line 56 of file wintirpc.h.

◆ getpid

#define getpid (   void)    _getpid

Definition at line 52 of file wintirpc.h.

◆ ioctl

#define ioctl   ioctlsocket

Definition at line 60 of file wintirpc.h.

◆ MAXHOSTNAMELEN

#define MAXHOSTNAMELEN   256

Definition at line 86 of file wintirpc.h.

◆ poll

#define poll   WSAPoll

Definition at line 59 of file wintirpc.h.

◆ snprintf

#define snprintf   _snprintf

Definition at line 48 of file wintirpc.h.

◆ SOL_IPV6

#define SOL_IPV6   IPPROTO_IPV6

Definition at line 84 of file wintirpc.h.

◆ strcasecmp

#define strcasecmp   _stricmp

Definition at line 50 of file wintirpc.h.

◆ strtok_r

#define strtok_r   strtok_s

Definition at line 57 of file wintirpc.h.

◆ SUN_LEN

#define SUN_LEN (   ptr)    ((unsigned int)(sizeof(int) + strlen ((ptr)->sun_path)))

Definition at line 94 of file wintirpc.h.

◆ WINSOCK_HANDLE_HASH

#define WINSOCK_HANDLE_HASH (   x)    (((x) >> 2) % WINSOCK_HANDLE_HASH_SIZE)

Definition at line 70 of file wintirpc.h.

◆ WINSOCK_HANDLE_HASH_SIZE

#define WINSOCK_HANDLE_HASH_SIZE   1024

Definition at line 69 of file wintirpc.h.

Function Documentation

◆ asprintf()

int asprintf ( char **  str,
const char fmt,
  ... 
)

Definition at line 95 of file asprintf.c.

96{
97 va_list ap;
98 int ret;
99
100 *str = NULL;
101 va_start(ap, fmt);
102 ret = vasprintf(str, fmt, ap);
103 va_end(ap);
104
105 return ret;
106}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
int vasprintf(char **str, const char *fmt, va_list ap)
Definition: asprintf.c:49
#define NULL
Definition: types.h:112
const WCHAR * str
Definition: dsound.c:943
int ret
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

Referenced by __rpc_taddr2uaddr_af().

◆ gettimeofday()

int gettimeofday ( struct timeval tv,
struct timezone tz 
)

Definition at line 308 of file fake.c.

309{
310 FILETIME ft;
312 __int64 t;
313 static int tzflag;
314
315 if (tv)
316 {
320 t = li.QuadPart; /* In 100-nanosecond intervals */
321 t -= EPOCHFILETIME; /* Offset to the Epoch time */
322 t /= 10; /* In microseconds */
323 tv->tv_sec = (long)(t / 1000000);
324 tv->tv_usec = (long)(t % 1000000);
325 }
326
327 if (tz)
328 {
329 if (!tzflag)
330 {
331 _tzset();
332 tzflag++;
333 }
334 tz->tz_minuteswest = _timezone / 60;
335 tz->tz_dsttime = _daylight;
336 }
337
338 return 0;
339}
#define __int64
Definition: basetyps.h:16
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
#define EPOCHFILETIME
Definition: fake.c:303
LARGE_INTEGER li
Definition: fxtimerapi.cpp:235
GLdouble GLdouble t
Definition: gl.h:2047
GLbyte GLbyte tz
Definition: glext.h:8756
#define long
Definition: qsort.c:33
_CRTIMP void __cdecl _tzset(void)
Definition: timezone.c:92
int _daylight
Definition: timezone.c:30
long _timezone
Definition: timezone.c:46
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
unsigned long tv_sec
Definition: linux.h:1738
unsigned long tv_usec
Definition: linux.h:1739
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106

◆ wintirpc_debug()

void wintirpc_debug ( char fmt,
  ... 
)

Definition at line 188 of file wintirpc.c.

189{
190#ifdef _DEBUG
191 char buffer[2048];
192#else
193 static int triedToOpen = 0;
194 static FILE *dbgFile = NULL;
195#endif
196
197 va_list vargs;
198 va_start(vargs, fmt);
199
200#ifdef _DEBUG
201 vsprintf(buffer, fmt, vargs);
203#else
204 if (dbgFile == NULL && triedToOpen == 0) {
205 triedToOpen = 1;
206 dbgFile = fopen("c:\\etc\\rpcsec_gss_debug.txt", "w");
207 }
208 if (dbgFile != NULL) {
209 vfprintf(dbgFile, fmt, vargs);
210 fflush(dbgFile);
211 }
212#endif
213
214 va_end(vargs);
215}
GLuint buffer
Definition: glext.h:5915
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
Definition: ignoredbgout.c:18
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733