⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 951-954.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Unleashed, Third Edition:The Wine Project</TITLE>

<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0672313723//-->

<!--TITLE=Linux Unleashed, Third Edition//-->

<!--AUTHOR=Tim Parker//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Sams//-->

<!--CHAPTER=59//-->

<!--PAGES=951-954//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="948-951.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="../ch60/955-958.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading19"></A><FONT COLOR="#000077">Using winestat to Analyze Windows Programs</FONT></H4>

<P>Part of Wine is the <TT>winestat</TT> utility. This is actually the same program as Wine, but instead of running an MS-Windows executable, <TT>winestat</TT> simply attempts to load a Windows executable and reports on how successful the load was. In loading an executable, <TT>winestat</TT> also loads any DLLs necessary and reports if any are missing. <TT>winestat</TT> looks for Windows API calls that are used by either the executable or any DLL and verifies their existence. A sample <TT>winestat</TT> run on the MS-Windows Paintbrush applet <TT>pbrush</TT> yields the following:</P>

<!-- CODE //-->

<PRE>

KERNEL.1 not implemented

KERNEL.54 not implemented

KERNEL.113 not implemented

KERNEL.114 not implemented

KERNEL.121 not implemented

KERNEL.154 not implemented

KERNEL.178 not implemented

KERNEL.207 not implemented

KERNEL: 52 of 66 (86.7 %)

USER: 150 of 150 (100.0 %)

GDI.151 not implemented

GDI.307 not implemented

GDI.366 not implemented

GDI.439 not implemented

GDI: 80 of 84 (95.2 %)

SHELL: 9 of 9 (100.0 %)

KEYBOARD: 2 of 2 (100.0 %)

TOTAL: 293 of 305 winapi functions implemented (96.1 %)

</PRE>

<!-- END CODE //-->

<P><TT>winestat</TT> calls out the individual functions by number and module that are not implemented by Wine. If you are curious as to the function name, rather than number, look at the Wine sources in the <TT>if1632</TT> directory for the given module name&#146;s spec file. A sample <TT>kernel.spec</TT> file is as follows:</P>

<!-- CODE SNIP //-->

<PRE>

#1 FATALEXIT

#2 EXITKERNEL

3  pascal GetVersion() GetVersion()

&#133;

&#133;

&#133;

#54 pascal16 GETINSTANCEDATA

</PRE>

<!-- END CODE SNIP //-->

<P>Any line in a <TT>.spec</TT> file that starts with a <TT>#</TT> is considered a comment, not an implemented function. In this example, both 1 and 54 are commented, with the respective names of <TT>FATALEXIT</TT> and <TT>GETINSTANCEDATA</TT>. <TT>FATALEXIT</TT> is used for debugging MS-Windows programs under error conditions and is not important for most MS-Windows users. <TT>GETINSTANCEDATA</TT> copies configuration data from a previous instance of an application. If you are running only one instance of an application, this does not apply.</P>

<P>The final percentage shows which MS-Windows API calls are implemented. This is often a good measure of how much of an application could work under Wine. Unfortunately, if a single, unimplemented API call is needed to initialize your MS-Windows application, anything less than 100 percent is not good enough.</P>

<P>MS-Windows applications to which <TT>winestat</TT> gives an overall implementation rating over 95 percent are worth a try. Unlike DOSemu, Wine is not as prone to leaving Linux in an unusable state. However, it is not always a trivial matter to kill an errant Wine session. The easiest thing to do is to start Wine with a separate desktop: <TT>wine -desktop 800&#215;660 <I>filename</I></TT>. Normal methods of killing a Windows process from your window manager should work.</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>Tip:&nbsp;&nbsp;</B><BR>When all else fails to stop an errant Wine session, switch to a free virtual console and kill the errant Wine process. For example, Alt&#43;Ctrl and F2 would switch to virtual console number 2. You can log in to a virtual console and use <TT>ps -ax | grep wine</TT> to find your Wine sessions. Use <TT>kill -15 <I>pid</I></TT> where <I>pid</I> is the process id returned by <TT>ps</TT> to stop the process.

<P>You can return to your X session by switching to the virtual console that is running X. If you don&#146;t know what console number that is, hold the Alt and Ctrl keys, and press F1 through F8 until you find it.<HR></FONT>

</BLOCKQUOTE>

</P>

<H4 ALIGN="LEFT"><A NAME="Heading20"></A><FONT COLOR="#000077">Major Pieces That Are Missing from Wine</FONT></H4>

<P>Perhaps the most obvious omission from Wine is the lack of a printer interface. Because this is a complex process, work on a printer interface is little more than a few ideas. It would be a huge task to support all of the types of printers supported under MS-Windows. Wine will likely implement only a PostScript driver. Existing Linux utilities such as <TT>GhostScript</TT> are already capable of converting PostScript to other types of printer types, such as HP laser and inkjet printers.</P>

<P>The 32-bit Windows API (<TT>win32</TT>) is mostly unsupported. This is the executable image format for Windows NT and Windows 95, and is known as PE (portable executable). Wine currently supports the loading of resource files, such as fonts, that are in PE format, but is unable to handle executables or DLLs.</P>

<H4 ALIGN="LEFT"><A NAME="Heading21"></A><FONT COLOR="#000077">Software Unlikely to Ever Work</FONT></H4>

<P>The Wine project has no plans to support Windows Virtual Device Drivers (VDDs). VDDs use a different image format, called LE for linear executable, that the Wine loader is unable to handle. Because VDDs do things like direct hardware manipulation, coexistence of a VDD with Linux device drivers would be a tough problem indeed. One of the uses of VDDs in commercial MS-Windows is for TCP/IP stacks. Wine supports TCP/IP through the <TT>winsock</TT> DLL, which uses the TCP/IP inherent in the Linux kernel.</P>

<H3><A NAME="Heading22"></A><FONT COLOR="#000077">Summary</FONT></H3>

<P>In this chapter you&#146;ve seen how to set up and use the Wine Windows Emulator to run Windows applications. Wine is not the only way to accomplish this task; there are several other Windows emulators and binary interfaces available (such as WABI). However, Wine is one of the oldest (at least as far as Linux is concerned) and has a good user base to support it.

</P>

<P>From here you can explore related chapters:</P>

<DL>

<DD>Use Wabi, the Windows Application Binary Interface, which lets you run Windows applications under X, in Chapter 23, &#147;Wabi.&#148;

<DD>Program C and C&#43;&#43; under Linux in Chapter 26, &#147;Programming in C,&#148; and Chapter 27, &#147;Programming in C&#43;&#43;.&#148;

<DD>Use the source code control system to control multiple file versions at once in Chapter 56, &#147;Source Code Control.&#148;

</DL>

<P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="948-951.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="../ch60/955-958.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -