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

📄 3-2.htm

📁 计算机操作系统 西安电子科技大学出版社 操作系统实验
💻 HTM
📖 第 1 页 / 共 5 页
字号:
   <o:entry new="12" old="11"/>
   <o:entry new="13" old="12"/>
   <o:entry new="14" old="12"/>
   <o:entry new="15" old="12"/>
   <o:entry new="16" old="0"/>
   <o:entry new="17" old="0"/>
   <o:entry new="18" old="17"/>
   <o:entry new="19" old="18"/>
   <o:entry new="20" old="19"/>
   <o:entry new="21" old="20"/>
   <o:entry new="22" old="21"/>
   <o:entry new="23" old="22"/>
   <o:entry new="24" old="23"/>
   <o:entry new="25" old="24"/>
   <o:entry new="26" old="0"/>
  </o:regrouptable>
 </o:shapelayout></xml><![endif]--><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/>
</head>

<body lang=ZH-CN link=blue vlink=purple style='tab-interval:21.0pt;text-justify-trim:
punctuation'>

<div class=Section1 style='layout-grid:15.6pt'>

<p class=MsoNormal align=right style='text-align:right'><a name="_top"></a><b><span
style='font-size:26.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman";color:#993366'>实验</span></b><b><i
style='mso-bidi-font-style:normal'><span lang=EN-US style='font-size:55.0pt;
mso-bidi-font-size:12.0pt;color:#993366'>3</span></i><span lang=EN-US
style='color:#993366'><o:p></o:p></span></b></p>

<p class=MsoNormal align=right style='text-align:right;word-break:break-all'><!--[if gte vml 1]><v:shapetype
 id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
 path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
 <v:stroke joinstyle="miter"/>
 <v:formulas>
  <v:f eqn="if lineDrawn pixelLineWidth 0"/>
  <v:f eqn="sum @0 1 0"/>
  <v:f eqn="sum 0 0 @1"/>
  <v:f eqn="prod @2 1 2"/>
  <v:f eqn="prod @3 21600 pixelWidth"/>
  <v:f eqn="prod @3 21600 pixelHeight"/>
  <v:f eqn="sum @0 0 1"/>
  <v:f eqn="prod @6 1 2"/>
  <v:f eqn="prod @7 21600 pixelWidth"/>
  <v:f eqn="sum @8 21600 0"/>
  <v:f eqn="prod @7 21600 pixelHeight"/>
  <v:f eqn="sum @10 21600 0"/>
 </v:formulas>
 <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
 <o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_s1609" type="#_x0000_t75" style='position:absolute;
 left:0;text-align:left;margin-left:0;margin-top:0;width:546.85pt;height:34.15pt;
 z-index:-1;mso-wrap-edited:f;mso-position-horizontal:left;
 mso-position-vertical:top;mso-position-vertical-relative:line' wrapcoords="-26 0 -26 21176 21600 21176 21600 0 -26 0"
 o:allowoverlap="f">
 <v:imagedata src="./3-2.files/image001.jpg" o:title="image_bk"/>
 <w:wrap type="square" anchorx="page"/>
</v:shape><![endif]--><![if !vml]><img width=729 height=46
src="./3-2.files/image002.jpg" align=left hspace=12 v:shapes="_x0000_s1609"><![endif]><b><span
style='font-size:24.0pt;mso-bidi-font-size:12.0pt;font-family:黑体;mso-ascii-font-family:
"Times New Roman";color:navy'>进程控制与描述</span></b><b><span lang=EN-US
style='font-size:16.0pt;mso-bidi-font-size:12.0pt;mso-fareast-font-family:黑体;
color:navy'><span style="mso-spacerun: yes">&nbsp; </span></span></b></p>

<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>

<h2><a name="_Toc36437026"></a><a name="_Toc36947203"></a><a name="_Toc39769777"></a><a
name="_Toc45702454"></a><a name="_Toc16587483"><span style='mso-bookmark:_Toc45702454'><span
style='mso-bookmark:_Toc39769777'><span style='mso-bookmark:_Toc36947203'><span
style='mso-bookmark:_Toc36437026'><span lang=EN-US style='mso-bidi-font-family:
宋体'>3.2<span style="mso-spacerun: yes">&nbsp; </span>Windows 2000</span></span></span></span></span></a><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc45702454'><span
style='mso-bookmark:_Toc39769777'><span style='mso-bookmark:_Toc36947203'><span
style='mso-bidi-font-family:宋体'>编程</span></span></span></span></span><span
style='mso-bookmark:_Toc16587483'><span lang=EN-US style='mso-bidi-font-family:
宋体'><o:p></o:p></span></span></h2>

<p class=MsoNormal align=center style='text-align:center'><span
style='mso-bookmark:_Toc16587483'><span lang=EN-US>(</span></span><span
style='mso-bookmark:_Toc16587483'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>实验估计时间:</span><span
lang=EN-US>120</span></span><span style='mso-bookmark:_Toc16587483'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>分钟</span><span lang=EN-US>)</span></span></p>

<p class=MsoNormal><span style='mso-bookmark:_Toc16587483'><span lang=EN-US>&nbsp;</span></span></p>

<p class=MsoFooter style='margin-left:21.0pt;text-indent:-21.0pt;mso-list:l0 level1 lfo2;
tab-stops:list 21.0pt center 207.65pt right 415.3pt'><span style='mso-bookmark:
_Toc16587483'><![if !supportLists]><span lang=EN-US style='font-size:10.5pt;
mso-bidi-font-size:9.0pt;font-family:Wingdings'>&Oslash;<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]></span><a href="#_背景知识"><span style='mso-bookmark:_Toc16587483'><b
style='mso-bidi-font-weight:normal'><span style='font-size:10.5pt;mso-bidi-font-size:
9.0pt;font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>背景知识</span></b></span><span style='mso-bookmark:_Toc16587483'></span></a><span
style='mso-bookmark:_Toc16587483'><b style='mso-bidi-font-weight:normal'><span
lang=EN-US style='font-size:10.5pt;mso-bidi-font-size:9.0pt'><o:p></o:p></span></b></span></p>

<p class=MsoFooter style='margin-left:21.0pt;text-indent:-21.0pt;mso-list:l0 level1 lfo2;
tab-stops:list 21.0pt center 207.65pt right 415.3pt'><span style='mso-bookmark:
_Toc16587483'><![if !supportLists]><span lang=EN-US style='font-size:10.5pt;
mso-bidi-font-size:9.0pt;font-family:Wingdings'>&Oslash;<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]></span><a href="#_实验目的"><span style='mso-bookmark:_Toc16587483'><b
style='mso-bidi-font-weight:normal'><span style='font-size:10.5pt;mso-bidi-font-size:
9.0pt;font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>实验目的</span></b></span><span style='mso-bookmark:_Toc16587483'></span></a><span
style='mso-bookmark:_Toc16587483'><b style='mso-bidi-font-weight:normal'><span
lang=EN-US style='font-size:10.5pt;mso-bidi-font-size:9.0pt'><o:p></o:p></span></b></span></p>

<p class=MsoFooter style='margin-left:21.0pt;text-indent:-21.0pt;mso-list:l0 level1 lfo2;
tab-stops:list 21.0pt center 207.65pt right 415.3pt'><span style='mso-bookmark:
_Toc16587483'><![if !supportLists]><span lang=EN-US style='font-size:10.5pt;
mso-bidi-font-size:9.0pt;font-family:Wingdings'>&Oslash;<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]></span><a href="#_工具/准备工作"><span style='mso-bookmark:
_Toc16587483'><b style='mso-bidi-font-weight:normal'><span style='font-size:
10.5pt;mso-bidi-font-size:9.0pt;font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"'>工具</span></b></span><span
style='mso-bookmark:_Toc16587483'><b style='mso-bidi-font-weight:normal'><span
lang=EN-US style='font-size:10.5pt;mso-bidi-font-size:9.0pt'>/</span></b></span><span
style='mso-bookmark:_Toc16587483'><b style='mso-bidi-font-weight:normal'><span
style='font-size:10.5pt;mso-bidi-font-size:9.0pt;font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>准备工作</span></b></span><span
style='mso-bookmark:_Toc16587483'></span></a><span style='mso-bookmark:_Toc16587483'><b
style='mso-bidi-font-weight:normal'><span lang=EN-US style='font-size:10.5pt;
mso-bidi-font-size:9.0pt'><o:p></o:p></span></b></span></p>

<p class=MsoFooter style='margin-left:21.0pt;text-indent:-21.0pt;mso-list:l0 level1 lfo2;
tab-stops:list 21.0pt center 207.65pt right 415.3pt'><span style='mso-bookmark:
_Toc16587483'><![if !supportLists]><span lang=EN-US style='font-size:10.5pt;
mso-bidi-font-size:9.0pt;font-family:Wingdings'>&Oslash;<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]></span><a href="#_实验内容与步骤"><span style='mso-bookmark:
_Toc16587483'><b style='mso-bidi-font-weight:normal'><span style='font-size:
10.5pt;mso-bidi-font-size:9.0pt;font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"'>实验内容与步骤</span></b></span><span
style='mso-bookmark:_Toc16587483'></span></a><span style='mso-bookmark:_Toc16587483'><b
style='mso-bidi-font-weight:normal'><span lang=EN-US style='font-size:10.5pt;
mso-bidi-font-size:9.0pt'><o:p></o:p></span></b></span></p>

<p class=MsoNormal><span style='mso-bookmark:_Toc16587483'><span lang=EN-US>&nbsp;</span></span></p>

<h3><span style='mso-bookmark:_Toc16587483'><a name="_Toc36437027"></a><a
name="_Toc36947204"></a><a name="_Toc39769778"></a><a name="_Toc45702455"></a><a
name="_背景知识"></a><span style='mso-bookmark:_Toc36437027'><span
style='mso-bookmark:_Toc36947204'><span style='mso-bookmark:_Toc39769778'><span
style='mso-bookmark:_Toc45702455'><span style='mso-bidi-font-family:宋体'>背景知识</span></span></span></span></span></span><span
style='mso-bookmark:_Toc16587483'><span lang=EN-US style='mso-bidi-font-family:
宋体'><o:p></o:p></span></span></h3>

<p class=MsoNormal style='text-indent:21.0pt;mso-char-indent-count:2.0;
mso-char-indent-size:10.5pt'><span style='mso-bookmark:_Toc16587483'><a
name="_Toc36437028"><span lang=EN-US>Windows 2000</span></a></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>可以识别的应用程序包括控制台应用程序、</span><span lang=EN-US>GUI</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>应用程序和服务应用程序。控制台应用程序可以创建</span><span lang=EN-US>GUI</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>,</span><span lang=EN-US>GUI</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>应用程序可以作为服务来运行,服务也可以向标准的输出流写入数据。不同类型应用程序间的惟一重要区别是其启动方法。</span></span></span></p>

<p class=MsoNormal style='text-indent:21.0pt;mso-char-indent-count:2.0;
mso-char-indent-size:10.5pt'><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span lang=EN-US>Windows 2000</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>是以</span><span lang=EN-US>NT</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>的技术构建的,它提供了创建控制台应用程序的能力,使用户可以利用标准的</span><span lang=EN-US>C++</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>工具,如</span><span lang=EN-US>iostream</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>库中的</span><span lang=EN-US>cout</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>和</span><span lang=EN-US>cin</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>对象,来创建小型应用程序。当系统运行时,</span><span lang=EN-US>Windows 2000</span></span></span><span
style='mso-bookmark:_Toc16587483'><span style='mso-bookmark:_Toc36437028'><span
style='font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"'>的服务通常要向系统用户提供所需功能。</span></span></span></p>

<p class=MsoNormal style='text-indent:21.0pt;mso-char-indent-count:2.0;
mso-char-indent-size:10.5pt'><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>服务应用程序类型需要</span><span
lang=EN-US>ServiceMail() </span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>函数,由服务控制管理器</span><span
lang=EN-US> (SCM) </span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>加以调用。</span><span
lang=EN-US>SCM</span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>是操作系统的集成部分,负责响应系统启动以开始服务、指导用户控制或从另一个服务中来的请求。其本身负责使应用程序的行为像一个服务。通常,服务登录到特殊的</span><span
lang=EN-US>LocalSystem</span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>账号下,此账号具有与开发人员创建的服务不同的权限。</span></span></span></p>

<p class=MsoNormal style='text-indent:21.0pt;mso-char-indent-count:2.0;
mso-char-indent-size:10.5pt'><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>当令</span><span
lang=EN-US>C++ </span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>编译器创建可执行程序时,编译器将源代码编译成</span><span
lang=EN-US>OBJ</span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>文件,然后将其与标准库相链接。产生的</span><span
lang=EN-US>EXE</span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>文件是装载器指令、机器指令和应用程序的数据的集合。装载器指令告诉系统从哪里装载机器代码。另一个装载器指令告诉系统从哪里开始执行进程的主线程。在进行某些设置后,进入开发者提供的</span><span
lang=EN-US>main() </span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>、</span><span
lang=EN-US>ServiceMain() </span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>或</span><span
lang=EN-US>WinMain() </span></span></span><span style='mso-bookmark:_Toc16587483'><span
style='mso-bookmark:_Toc36437028'><span style='font-family:宋体;mso-ascii-font-family:

⌨️ 快捷键说明

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