3 /* #include <sys/select.h> */
6 * This symbol, if defined, indicates that the ioctl() routine is
7 * available to set I/O characteristics
12 * This symbol, if defined, indicates that the routine utime() is
13 * available to update the access and modification times of files.
15 #define HAS_UTIME /**/
20 #define HAS_WAITPID_RUNTIME (_emx_env & 0x200)
23 * This symbol, if defined, indicates that the getpwnam() and
24 * getpwuid() routines are available to get password entries.
25 * The getpwent() has a separate definition, HAS_GETPWENT.
30 * This symbol, if defined, indicates that the getgrnam() and
31 * getgrgid() routines are available to get group entries.
32 * The getgrent() has a separate definition, HAS_GETGRENT.
35 #define HAS_GETGRENT /* fake */
36 #define HAS_SETGRENT /* fake */
37 #define HAS_ENDGRENT /* fake */
40 * This symbol, if defined, indicates that the program should
41 * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
42 * that a file is in "binary" mode -- that is, that no translation
43 * of bytes occurs on read or write operations.
48 * This symbol holds the type used to declare buffers for information
49 * returned by stat(). It's usually just struct stat. It may be necessary
50 * to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
53 #define Stat_t struct stat
56 * This symbol is defined if this system has a stat structure declaring
59 #define USE_STAT_RDEV /**/
62 * This symbol, if defined, indicates that error messages should be
63 * should be generated in a format that allows the use of the Acme
64 * GUI/editor's autofind feature.
69 * This symbol, if defined, contains a "magic" string which may be used
70 * as the first line of a Perl program designed to be executed directly
71 * by name, instead of the standard Unix #!. If ALTERNATE_SHEBANG
72 * begins with a character other then #, then Perl will only treat
73 * it as a command line if if finds the string "perl" in the first
74 * word; otherwise it's treated as the first line of code in the script.
75 * (IOW, Perl won't hand off to another interpreter via an alternate
76 * shebang sequence that might be legal Perl code.)
78 #define ALTERNATE_SHEBANG "extproc "
81 # define SIGABRT SIGILL
84 # define SIGILL 6 /* blech */
86 #define ABORT() kill(PerlProc_getpid(),SIGABRT);
88 #define BIT_BUCKET "/dev/nul" /* Will this work? */
90 /* Apparently TCPIPV4 defines may be included even with only IAK present */
92 #if !defined(NO_TCPIPV4) && !defined(TCPIPV4)
94 # define TCPIPV4_FORCED /* Just in case */
97 #if defined(I_SYS_UN) && !defined(TCPIPV4)
98 /* It is not working without TCPIPV4 defined. */
104 #define do_spawn(a) os2_do_spawn(aTHX_ (a))
105 #define do_aspawn(a,b,c) os2_do_aspawn(aTHX_ (a),(b),(c))
107 #define OS2_ERROR_ALREADY_POSTED 299 /* Avoid os2.h */
111 #define MUTEX_INIT(m) \
114 if ((rc = _rmutex_create(m,0))) \
115 Perl_croak_nocontext("panic: MUTEX_INIT: rc=%i", rc); \
117 #define MUTEX_LOCK(m) \
120 if ((rc = _rmutex_request(m,_FMR_IGNINT))) \
121 Perl_croak_nocontext("panic: MUTEX_LOCK: rc=%i", rc); \
123 #define MUTEX_UNLOCK(m) \
126 if ((rc = _rmutex_release(m))) \
127 Perl_croak_nocontext("panic: MUTEX_UNLOCK: rc=%i", rc); \
129 #define MUTEX_DESTROY(m) \
132 if ((rc = _rmutex_close(m))) \
133 Perl_croak_nocontext("panic: MUTEX_DESTROY: rc=%i", rc); \
136 #define COND_INIT(c) \
139 if ((rc = DosCreateEventSem(NULL,c,0,0))) \
140 Perl_croak_nocontext("panic: COND_INIT: rc=%i", rc); \
142 #define COND_SIGNAL(c) \
145 if ((rc = DosPostEventSem(*(c))) && rc != OS2_ERROR_ALREADY_POSTED)\
146 Perl_croak_nocontext("panic: COND_SIGNAL, rc=%ld", rc); \
148 #define COND_BROADCAST(c) \
151 if ((rc = DosPostEventSem(*(c))) && rc != OS2_ERROR_ALREADY_POSTED)\
152 Perl_croak_nocontext("panic: COND_BROADCAST, rc=%i", rc); \
154 /* #define COND_WAIT(c, m) \
156 if (WaitForSingleObject(*(c),INFINITE) == WAIT_FAILED) \
157 Perl_croak_nocontext("panic: COND_WAIT"); \
160 #define COND_WAIT(c, m) os2_cond_wait(c,m)
162 #define COND_WAIT_win32(c, m) \
165 if ((rc = SignalObjectAndWait(*(m),*(c),INFINITE,FALSE))) \
166 Perl_croak_nocontext("panic: COND_WAIT"); \
170 #define COND_DESTROY(c) \
173 if ((rc = DosCloseEventSem(*(c)))) \
174 Perl_croak_nocontext("panic: COND_DESTROY, rc=%i", rc); \
176 /*#define THR ((struct thread *) TlsGetValue(PL_thr_key))
179 #ifdef USE_SLOW_THREAD_SPECIFIC
180 # define pthread_getspecific(k) (*_threadstore())
181 # define pthread_setspecific(k,v) (*_threadstore()=v,0)
182 # define pthread_key_create(keyp,flag) (*keyp=_gettid(),0)
183 #else /* USE_SLOW_THREAD_SPECIFIC */
184 # define pthread_getspecific(k) (*(k))
185 # define pthread_setspecific(k,v) (*(k)=(v),0)
186 # define pthread_key_create(keyp,flag) \
187 ( DosAllocThreadLocalMemory(1,(U32*)keyp) \
188 ? Perl_croak_nocontext("LocalMemory"),1 \
191 #endif /* USE_SLOW_THREAD_SPECIFIC */
192 #define pthread_key_delete(keyp)
193 #define pthread_self() _gettid()
194 #define YIELD DosSleep(0)
196 #ifdef PTHREADS_INCLUDED /* For ./x2p stuff. */
197 int pthread_join(pthread_t tid, void **status);
198 int pthread_detach(pthread_t tid);
199 int pthread_create(pthread_t *tid, const pthread_attr_t *attr,
200 void *(*start_routine)(void*), void *arg);
201 #endif /* PTHREAD_INCLUDED */
203 #define THREADS_ELSEWHERE
205 #else /* USE_THREADS */
207 #define do_spawn(a) os2_do_spawn(a)
208 #define do_aspawn(a,b,c) os2_do_aspawn((a),(b),(c))
210 #endif /* USE_THREADS */
212 void Perl_OS2_init(char **);
214 /* XXX This code hideously puts env inside: */
217 # define PERL_SYS_INIT3(argcp, argvp, envp) STMT_START { \
218 _response(argcp, argvp); \
219 _wildcard(argcp, argvp); \
220 Perl_OS2_init(*envp); } STMT_END
221 # define PERL_SYS_INIT(argcp, argvp) STMT_START { \
222 _response(argcp, argvp); \
223 _wildcard(argcp, argvp); \
224 Perl_OS2_init(NULL); } STMT_END
225 #else /* Compiling embedded Perl or Perl extension */
226 # define PERL_SYS_INIT3(argcp, argvp, envp) STMT_START { \
227 Perl_OS2_init(*envp); } STMT_END
228 # define PERL_SYS_INIT(argcp, argvp) STMT_START { \
229 Perl_OS2_init(NULL); } STMT_END
233 # define PERL_CALLCONV _System
236 #define PERL_SYS_TERM() MALLOC_TERM
238 /* #define PERL_SYS_TERM() STMT_START { \
239 if (Perl_HAB_set) WinTerminate(Perl_hab); } STMT_END */
241 #define dXSUB_SYS OS2_XS_init()
244 /* # define HAS_FORK */
245 /* # define HIDEMYMALLOC */
246 /* # define PERL_SBRK_VIA_MALLOC */ /* gets off-page sbrk... */
247 #else /* !PERL_IS_AOUT */
248 # ifndef PERL_FOR_X2P
250 # define USE_PERL_SBRK
255 # define SYSTEM_ALLOC(a) sys_alloc(a)
257 void *sys_alloc(int size);
259 #endif /* !PERL_IS_AOUT */
260 #if !defined(PERL_CORE) && !defined(PerlIO) /* a2p */
264 /* os2ish is used from a2p/a2p.h without pTHX/pTHX_ first being
265 * defined. Hack around this to get us to compile.
276 #define TMPPATH1 "plXXXXXX"
277 extern char *tmppath;
278 PerlIO *my_syspopen(pTHX_ char *cmd, char *mode);
279 /* Cannot prototype with I32 at this point. */
280 int my_syspclose(PerlIO *f);
281 FILE *my_tmpfile (void);
282 char *my_tmpnam (char *);
283 int my_mkdir (__const__ char *, long);
284 int my_rmdir (__const__ char *);
285 struct passwd *my_getpwent (void);
286 void my_setpwent (void);
287 void my_endpwent (void);
289 struct group *getgrent (void);
290 void setgrent (void);
291 void endgrent (void);
293 struct passwd *my_getpwuid (uid_t);
294 struct passwd *my_getpwnam (__const__ char *);
297 #define L_tmpnam MAXPATHLEN
299 #define tmpfile my_tmpfile
300 #define tmpnam my_tmpnam
301 #define isatty _isterm
303 #define srand srandom
304 #define strtoll _strtoll
305 #define strtoull _strtoull
308 * fwrite1() should be a routine with the same calling sequence as fwrite(),
309 * but which outputs all of the bytes requested as a single stream (unlike
310 * fwrite() itself, which on some systems outputs several distinct records
311 * if the number_of_items parameter is >1).
313 #define fwrite1 fwrite
315 #define my_getenv(var) getenv(var)
316 #define flock my_flock
317 #define rmdir my_rmdir
318 #define mkdir my_mkdir
319 #define setpwent my_setpwent
320 #define getpwent my_getpwent
321 #define endpwent my_endpwent
322 #define getpwuid my_getpwuid
323 #define getpwnam my_getpwnam
325 void *emx_calloc (size_t, size_t);
326 void emx_free (void *);
327 void *emx_malloc (size_t);
328 void *emx_realloc (void *, size_t);
330 /*****************************************************************************/
332 #include <stdlib.h> /* before the following definitions */
333 #include <unistd.h> /* before the following definitions */
335 #define chdir _chdir2
336 #define getcwd _getcwd2
338 /* This guy is needed for quick stdstd */
340 #if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE)
341 /* Perl uses ungetc only with successful return */
342 # define ungetc(c,fp) \
343 (FILE_ptr(fp) > FILE_base(fp) && c == (int)*(FILE_ptr(fp) - 1) \
344 ? (--FILE_ptr(fp), ++FILE_cnt(fp), (int)c) : ungetc(c,fp))
347 /* ctermid is missing from emx0.9d */
348 char *ctermid(char *s);
350 #define OP_BINARY O_BINARY
352 #define OS2_STAT_HACK 1
355 #define Stat(fname,bufptr) os2_stat((fname),(bufptr))
356 #define Fstat(fd,bufptr) fstat((fd),(bufptr))
357 #define Fflush(fp) fflush(fp)
358 #define Mkdir(path,mode) mkdir((path),(mode))
362 #define S_IFBLK 0120000
363 #define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
367 #define Stat(fname,bufptr) stat((fname),(bufptr))
368 #define Fstat(fd,bufptr) fstat((fd),(bufptr))
369 #define Fflush(fp) fflush(fp)
370 #define Mkdir(path,mode) mkdir((path),(mode))
374 /* With SD386 it is impossible to debug register variables. */
375 #if !defined(PERL_IS_AOUT) && defined(DEBUGGING) && !defined(register)
379 /* Our private OS/2 specific data. */
381 typedef struct OS2_Perl_data {
386 unsigned long severity;
387 unsigned long phmq; /* Handle to message queue */
388 unsigned long phmq_refcnt;
389 unsigned long phmq_servers;
390 unsigned long initial_mode; /* VIO etc. mode we were started in */
393 extern OS2_Perl_data_t OS2_Perl_data;
395 #define Perl_hab ((HAB)OS2_Perl_data.phab)
396 #define Perl_rc (OS2_Perl_data.rc)
397 #define Perl_severity (OS2_Perl_data.severity)
398 #define errno_isOS2 12345678
399 #define errno_isOS2_set 12345679
400 #define OS2_Perl_flags (OS2_Perl_data.flags)
401 #define Perl_HAB_set_f 1
402 #define Perl_HAB_set (OS2_Perl_flags & Perl_HAB_set_f)
403 #define set_Perl_HAB_f (OS2_Perl_flags |= Perl_HAB_set_f)
404 #define set_Perl_HAB(h) (set_Perl_HAB_f, Perl_hab = h)
405 #define _obtain_Perl_HAB (init_PMWIN_entries(), \
406 Perl_hab = (*PMWIN_entries.Initialize)(0), \
407 set_Perl_HAB_f, Perl_hab)
408 #define perl_hab_GET() (Perl_HAB_set ? Perl_hab : _obtain_Perl_HAB)
409 #define Acquire_hab() perl_hab_GET()
410 #define Perl_hmq ((HMQ)OS2_Perl_data.phmq)
411 #define Perl_hmq_refcnt (OS2_Perl_data.phmq_refcnt)
412 #define Perl_hmq_servers (OS2_Perl_data.phmq_servers)
413 #define Perl_os2_initial_mode (OS2_Perl_data.initial_mode)
415 unsigned long Perl_hab_GET();
416 unsigned long Perl_Register_MQ(int serve);
417 void Perl_Deregister_MQ(int serve);
418 int Perl_Serve_Messages(int force);
419 /* Cannot prototype with I32 at this point. */
420 int Perl_Process_Messages(int force, long *cntp);
421 char *os2_execname(pTHX);
424 struct PMWIN_entries_t {
425 unsigned long (*Initialize)( unsigned long fsOptions );
426 unsigned long (*CreateMsgQueue)(unsigned long hab, long cmsg);
427 int (*DestroyMsgQueue)(unsigned long hmq);
428 int (*PeekMsg)(unsigned long hab, struct _QMSG *pqmsg,
429 unsigned long hwndFilter, unsigned long msgFilterFirst,
430 unsigned long msgFilterLast, unsigned long fl);
431 int (*GetMsg)(unsigned long hab, struct _QMSG *pqmsg,
432 unsigned long hwndFilter, unsigned long msgFilterFirst,
433 unsigned long msgFilterLast);
434 void * (*DispatchMsg)(unsigned long hab, struct _QMSG *pqmsg);
435 unsigned long (*GetLastError)(unsigned long hab);
436 unsigned long (*CancelShutdown)(unsigned long hmq, unsigned long fCancelAlways);
438 extern struct PMWIN_entries_t PMWIN_entries;
439 void init_PMWIN_entries(void);
441 #define perl_hmq_GET(serve) Perl_Register_MQ(serve)
442 #define perl_hmq_UNSET(serve) Perl_Deregister_MQ(serve)
444 #define OS2_XS_init() (*OS2_Perl_data.xs_init)(aTHX)
446 #if _EMX_CRT_REV_ >= 60
447 # define os2_setsyserrno(rc) (Perl_rc = rc, errno = errno_isOS2_set, \
450 # define os2_setsyserrno(rc) (Perl_rc = rc, errno = errno_isOS2)
453 /* The expressions below return true on error. */
454 /* INCL_DOSERRORS needed. rc should be declared outside. */
455 #define CheckOSError(expr) (!(rc = (expr)) ? 0 : (FillOSError(rc), 1))
456 /* INCL_WINERRORS needed. */
457 #define SaveWinError(expr) ((expr) ? : (FillWinError, 0))
458 #define CheckWinError(expr) ((expr) ? 0: (FillWinError, 1))
459 #define FillOSError(rc) (os2_setsyserrno(rc), \
460 Perl_severity = SEVERITY_ERROR)
462 /* At this moment init_PMWIN_entries() should be a nop (WinInitialize should
463 be called already, right?), so we do not risk stepping over our own error */
464 #define FillWinError ( init_PMWIN_entries(), \
465 Perl_rc=(*PMWIN_entries.GetLastError)(perl_hab_GET()),\
466 Perl_severity = ERRORIDSEV(Perl_rc), \
467 Perl_rc = ERRORIDERROR(Perl_rc), \
468 os2_setsyserrno(Perl_rc))
470 #define STATIC_FILE_LENGTH 127
472 /* This should match loadOrdinals[] array in os2.c */
473 enum entries_ordinals {
474 ORD_DosQueryExtLibpath,
475 ORD_DosSetExtLibpath,
490 ORD_WinCreateMsgQueue,
491 ORD_WinDestroyMsgQueue,
496 ORD_WinCancelShutdown,
498 ORD_RexxVariablePool,
499 ORD_RexxRegisterFunctionExe,
500 ORD_RexxDeregisterFunction,
502 ORD_PRF32QUERYPROFILESIZE,
503 ORD_PRF32OPENPROFILE,
504 ORD_PRF32CLOSEPROFILE,
505 ORD_PRF32QUERYPROFILE,
507 ORD_PRF32QUERYPROFILEDATA,
508 ORD_PRF32WRITEPROFILEDATA,
510 ORD_WinChangeSwitchEntry,
511 ORD_WinQuerySwitchEntry,
512 ORD_WinQuerySwitchHandle,
513 ORD_WinQuerySwitchList,
514 ORD_WinSwitchToProgram,
515 ORD_WinBeginEnumWindows,
516 ORD_WinEndEnumWindows,
518 ORD_WinGetNextWindow,
520 ORD_WinQueryActiveWindow,
521 ORD_WinQueryClassName,
524 ORD_WinQueryWindowPos,
525 ORD_WinQueryWindowProcess,
526 ORD_WinQueryWindowText,
527 ORD_WinQueryWindowTextLength,
530 ORD_WinSetWindowText,
534 ORD_WinWindowFromPoint,
539 /* RET: return type, AT: argument signature in (), ARGS: should be in () */
540 #define CallORD(ret,o,at,args) (((ret (*)at) loadByOrdinal(o, 1))args)
541 #define DeclFuncByORD(ret,name,o,at,args) \
542 ret name at { return CallORD(ret,o,at,args); }
543 #define DeclVoidFuncByORD(name,o,at,args) \
544 void name at { CallORD(void,o,at,args); }
546 /* These functions return false on error, and save the error info in $^E */
547 #define DeclOSFuncByORD(ret,name,o,at,args) \
548 ret name at { unsigned long rc; return !CheckOSError(CallORD(ret,o,at,args)); }
549 #define DeclWinFuncByORD(ret,name,o,at,args) \
550 ret name at { return SaveWinError(CallORD(ret,o,at,args)); }
552 #define AssignFuncPByORD(p,o) (*(Perl_PFN*)&(p) = (loadByOrdinal(o, 1)))
554 #define PERLLIB_MANGLE(s, n) perllib_mangle((s), (n))
555 char *perllib_mangle(char *, unsigned int);
557 typedef int (*Perl_PFN)();
558 Perl_PFN loadByOrdinal(enum entries_ordinals ord, int fail);
559 extern const Perl_PFN * const pExtFCN;
560 char *os2error(int rc);
561 int os2_stat(const char *name, struct stat *st);
562 int setpriority(int which, int pid, int val);
563 int getpriority(int which /* ignored */, int pid);
566 int os2_do_spawn(pTHX_ char *cmd);
567 int os2_do_aspawn(pTHX_ SV *really, void **vmark, void **vsp);
572 /* Replacement for syslog.h */
573 # define LOG_EMERG 0 /* system is unusable */
574 # define LOG_ALERT 1 /* action must be taken immediately */
575 # define LOG_CRIT 2 /* critical conditions */
576 # define LOG_ERR 3 /* error conditions */
577 # define LOG_WARNING 4 /* warning conditions */
578 # define LOG_NOTICE 5 /* normal but significant condition */
579 # define LOG_INFO 6 /* informational */
580 # define LOG_DEBUG 7 /* debug-level messages */
582 # define LOG_PRIMASK 0x007 /* mask to extract priority part (internal) */
583 /* extract priority */
584 # define LOG_PRI(p) ((p) & LOG_PRIMASK)
585 # define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
588 # define LOG_KERN (0<<3) /* kernel messages */
589 # define LOG_USER (1<<3) /* random user-level messages */
590 # define LOG_MAIL (2<<3) /* mail system */
591 # define LOG_DAEMON (3<<3) /* system daemons */
592 # define LOG_AUTH (4<<3) /* security/authorization messages */
593 # define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
594 # define LOG_LPR (6<<3) /* line printer subsystem */
595 # define LOG_NEWS (7<<3) /* network news subsystem */
596 # define LOG_UUCP (8<<3) /* UUCP subsystem */
597 # define LOG_CRON (15<<3) /* clock daemon */
598 /* other codes through 15 reserved for system use */
599 # define LOG_LOCAL0 (16<<3) /* reserved for local use */
600 # define LOG_LOCAL1 (17<<3) /* reserved for local use */
601 # define LOG_LOCAL2 (18<<3) /* reserved for local use */
602 # define LOG_LOCAL3 (19<<3) /* reserved for local use */
603 # define LOG_LOCAL4 (20<<3) /* reserved for local use */
604 # define LOG_LOCAL5 (21<<3) /* reserved for local use */
605 # define LOG_LOCAL6 (22<<3) /* reserved for local use */
606 # define LOG_LOCAL7 (23<<3) /* reserved for local use */
608 # define LOG_NFACILITIES 24 /* current number of facilities */
609 # define LOG_FACMASK 0x03f8 /* mask to extract facility part */
610 /* facility of pri */
611 # define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
614 * arguments to setlogmask.
616 # define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
617 # define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
620 * Option flags for openlog.
622 * LOG_ODELAY no longer does anything.
623 * LOG_NDELAY is the inverse of what it used to be.
625 # define LOG_PID 0x01 /* log the pid with each message */
626 # define LOG_CONS 0x02 /* log on the console if errors in sending */
627 # define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
628 # define LOG_NDELAY 0x08 /* don't delay open */
629 # define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
630 # define LOG_PERROR 0x20 /* log to stderr as well */
634 /* ************************************************************ */
635 #define Dos32QuerySysState DosQuerySysState
636 #define QuerySysState(flags, pid, buf, bufsz) \
637 Dos32QuerySysState(flags, 0, pid, 0, buf, bufsz)
639 #define QSS_PROCESS 1
641 #define QSS_SEMAPHORES 2
642 #define QSS_FILE 8 /* Buggy until fixpack18 */
643 #define QSS_SHARED 16
647 APIRET APIENTRY Dos32QuerySysState(ULONG func,ULONG arg1,ULONG pid,
648 ULONG _res_,PVOID buf,ULONG bufsz);
653 } QGLOBAL, *PQGLOBAL;
664 UCHAR _reserved1_; /* padding to ULONG */
665 USHORT _reserved2_; /* padding to ULONG */
666 } QTHREAD, *PQTHREAD;
681 typedef struct qfile {
709 } QPROCESS, *PQPROCESS;
711 typedef struct sema {
728 } QSEMSTRUC, *PQSEMSTRUC;
733 } QSEMOWNER32, *PQSEMOWNER32;
738 PVOID semrecs; /* array of associated sema's */
742 USHORT _reserved_; /* padding to ULONG */
743 } QSEMSMUX32, *PQSEMSMUX32;
751 } QSEMEV32, *PQSEMEV32;
760 USHORT _reserved_; /* padding to ULONG */
761 } QSEMMUX32, *PQSEMMUX32;
763 typedef struct semstr32 {
768 } QSEMSTRUC32, *PQSEMSTRUC32;
770 typedef struct shrmem {
776 } QSHRMEM, *PQSHRMEM;
778 typedef struct module {
787 } QMODULE, *PQMODULE;
793 PQSEMSTRUC32 sem32data;
798 } QTOPLEVEL, *PQTOPLEVEL;
799 /* ************************************************************ */
801 PQTOPLEVEL get_sysinfo(ULONG pid, ULONG flags);