MSVCIRT and _pioinfo()

Uwe Bonnes bon at
Fri Mar 7 14:15:39 CST 2003


the MS Standard C++ Libraries implementation in MSVCIRT directly accesses
low level MSVCRT structures, like _pioinfo(), the pointer to an array of
ioinfo structures. A google/search search brings up some information,
e.g. (*1).

Some program in the Xilinx suite silently crashes when this _pioinfo() is
accessed inside MSVCIRT with builtin msvcrt. How should we handle this
case? Implement this array, in the same way as Microsoft did? Or can we
construct a builtin MSVCIRT perhaps by using wrappers around some other
Standard C++ Libraries implementation?

At least a more visible way to crash when unimplemted structures are
accessed would be fine.

Comments welcome.


(squid cvs)

+/* internal to CTRLIB */
+typedef struct {
+        long osfhnd;    /* underlying OS file HANDLE */
+        char osfile;    /* attributes of file (e.g., open in text mode?) */
+        char pipech;    /* one char buffer for handles opened on pipes */
+#ifdef _MT
+        int lockinitflag;
+        CRITICAL_SECTION lock;
+#endif  /* _MT */
+    }   ioinfo;
+extern _CRTIMP ioinfo * __pioinfo[];
+#define IOINFO_L2E          5
+#define _pioinfo(i) ( __pioinfo[(i) > IOINFO_L2E] + ((i) &(IOINFO_ARRAY_ELTS - \
+                              1)) )
+#define _osfile(i)  ( _pioinfo(i)->osfile )

Uwe Bonnes                bon at

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

More information about the wine-devel mailing list