397 lines
16 KiB
HTML
397 lines
16 KiB
HTML
<!- Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved ->
|
||
<!doctype html public "-//W3C//DTD HTML 4.0 Draft//EN">
|
||
<html xmlns:v="urn:schemas-microsoft-com:vml"
|
||
xmlns:o="urn:schemas-microsoft-com:office:office"
|
||
xmlns:w="urn:schemas-microsoft-com:office:word"
|
||
xmlns="http://www.w3.org/TR/REC-html40">
|
||
|
||
<head>
|
||
<meta http-equiv=Content-Type content="text/html; charset=windows-1251">
|
||
<meta name=ProgId content=Word.Document>
|
||
<meta name=Generator content="Microsoft Word 10">
|
||
<meta name=Originator content="Microsoft Word 10">
|
||
<link rel=File-List href="Security_files/filelist.xml">
|
||
<title>WMI SDK Sample - MethCli</title>
|
||
<!--[if gte mso 9]><xml>
|
||
<o:DocumentProperties>
|
||
<o:Author>Michael Maston</o:Author>
|
||
<o:Template>Normal</o:Template>
|
||
<o:LastAuthor>davj</o:LastAuthor>
|
||
<o:Revision>13</o:Revision>
|
||
<o:TotalTime>300</o:TotalTime>
|
||
<o:Created>1999-01-25T19:35:00Z</o:Created>
|
||
<o:LastSaved>2001-07-03T22:20:00Z</o:LastSaved>
|
||
<o:Pages>1</o:Pages>
|
||
<o:Words>280</o:Words>
|
||
<o:Characters>1599</o:Characters>
|
||
<o:Company>Microsoft</o:Company>
|
||
<o:Lines>13</o:Lines>
|
||
<o:Paragraphs>3</o:Paragraphs>
|
||
<o:CharactersWithSpaces>1876</o:CharactersWithSpaces>
|
||
<o:Version>10.2625</o:Version>
|
||
</o:DocumentProperties>
|
||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
||
<w:WordDocument>
|
||
<w:Zoom>103</w:Zoom>
|
||
<w:SpellingState>Clean</w:SpellingState>
|
||
<w:GrammarState>Clean</w:GrammarState>
|
||
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
|
||
</w:WordDocument>
|
||
</xml><![endif]-->
|
||
<style>
|
||
<!--
|
||
/* Font Definitions */
|
||
@font-face
|
||
{font-family:"MS Mincho";
|
||
panose-1:2 2 6 9 4 2 5 8 3 4;
|
||
mso-font-alt:"MS Mincho";
|
||
mso-font-charset:128;
|
||
mso-generic-font-family:roman;
|
||
mso-font-format:other;
|
||
mso-font-pitch:fixed;
|
||
mso-font-signature:1 134676480 16 0 131072 0;}
|
||
@font-face
|
||
{font-family:Verdana;
|
||
panose-1:2 11 6 4 3 5 4 4 2 4;
|
||
mso-font-charset:0;
|
||
mso-generic-font-family:swiss;
|
||
mso-font-pitch:variable;
|
||
mso-font-signature:536871559 0 0 0 415 0;}
|
||
@font-face
|
||
{font-family:"\@MS Mincho";
|
||
mso-font-charset:128;
|
||
mso-generic-font-family:modern;
|
||
mso-font-pitch:fixed;
|
||
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
|
||
/* Style Definitions */
|
||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||
{mso-style-parent:"";
|
||
margin:0in;
|
||
margin-bottom:.0001pt;
|
||
mso-pagination:widow-orphan;
|
||
font-size:12.0pt;
|
||
font-family:"Times New Roman";
|
||
mso-fareast-font-family:"Times New Roman";
|
||
color:black;}
|
||
a:link, span.MsoHyperlink
|
||
{color:blue;
|
||
text-decoration:underline;
|
||
text-underline:single;}
|
||
a:visited, span.MsoHyperlinkFollowed
|
||
{color:blue;
|
||
text-decoration:underline;
|
||
text-underline:single;}
|
||
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
|
||
{margin:0in;
|
||
margin-bottom:.0001pt;
|
||
mso-pagination:widow-orphan;
|
||
font-size:10.0pt;
|
||
font-family:"Courier New";
|
||
mso-fareast-font-family:"Times New Roman";}
|
||
span.SpellE
|
||
{mso-style-name:"";
|
||
mso-spl-e:yes;}
|
||
@page Section1
|
||
{size:8.5in 11.0in;
|
||
margin:1.0in 1.25in 1.0in 1.25in;
|
||
mso-header-margin:.5in;
|
||
mso-footer-margin:.5in;
|
||
mso-paper-source:0;}
|
||
div.Section1
|
||
{page:Section1;}
|
||
/* List Definitions */
|
||
@list l0
|
||
{mso-list-id:141585200;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-1475592626 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
|
||
@list l0:level1
|
||
{mso-level-tab-stop:.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level2
|
||
{mso-level-tab-stop:1.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level3
|
||
{mso-level-tab-stop:1.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level4
|
||
{mso-level-tab-stop:2.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level5
|
||
{mso-level-tab-stop:2.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level6
|
||
{mso-level-tab-stop:3.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level7
|
||
{mso-level-tab-stop:3.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level8
|
||
{mso-level-tab-stop:4.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level9
|
||
{mso-level-tab-stop:4.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l1
|
||
{mso-list-id:994183607;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-208100182 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
|
||
@list l1:level1
|
||
{mso-level-tab-stop:.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;
|
||
font-family:"Times New Roman";}
|
||
@list l1:level2
|
||
{mso-level-tab-stop:1.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l1:level3
|
||
{mso-level-tab-stop:1.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l1:level4
|
||
{mso-level-tab-stop:2.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l1:level5
|
||
{mso-level-tab-stop:2.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l1:level6
|
||
{mso-level-tab-stop:3.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l1:level7
|
||
{mso-level-tab-stop:3.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l1:level8
|
||
{mso-level-tab-stop:4.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l1:level9
|
||
{mso-level-tab-stop:4.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
ol
|
||
{margin-bottom:0in;}
|
||
ul
|
||
{margin-bottom:0in;}
|
||
-->
|
||
</style>
|
||
<!--[if gte mso 10]>
|
||
<style>
|
||
/* Style Definitions */
|
||
table.MsoNormalTable
|
||
{mso-style-name:"Table Normal";
|
||
mso-tstyle-rowband-size:0;
|
||
mso-tstyle-colband-size:0;
|
||
mso-style-noshow:yes;
|
||
mso-style-parent:"";
|
||
mso-padding-alt:0in 5.4pt 0in 5.4pt;
|
||
mso-para-margin:0in;
|
||
mso-para-margin-bottom:.0001pt;
|
||
mso-pagination:widow-orphan;
|
||
font-size:10.0pt;
|
||
font-family:"Times New Roman";}
|
||
</style>
|
||
<![endif]-->
|
||
<meta name=MS-HAID content=VJsamples>
|
||
<!--[if gte mso 9]><xml>
|
||
<o:shapedefaults v:ext="edit" spidmax="2050"/>
|
||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
||
<o:shapelayout v:ext="edit">
|
||
<o:idmap v:ext="edit" data="1"/>
|
||
</o:shapelayout></xml><![endif]-->
|
||
</head>
|
||
|
||
<body bgcolor=white lang=EN-US link=blue vlink=blue style='tab-interval:.5in'>
|
||
|
||
<div class=Section1>
|
||
|
||
<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
|
||
style='width:100.0%;mso-cellspacing:1.5pt;mso-padding-alt:0in 0in 0in 0in'>
|
||
<tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes'>
|
||
<td width=160 style='width:120.0pt;background:#330099;padding:.75pt .75pt .75pt .75pt'>
|
||
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Verdana;
|
||
color:white'> <nobr><b>Windows Management Instrumentation SDK Sample</b></span>
|
||
<o:p></o:p></p>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p class=MsoPlainText><br>
|
||
<strong><span style='font-size:13.5pt;font-family:Verdana;mso-bidi-font-family:
|
||
"Courier New"'>Security</span></strong><br style='mso-special-character:line-break'>
|
||
<![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
|
||
<![endif]><span style='font-family:Verdana'><o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'>The Security sample demonstrates
|
||
the basics of how set the security on interface <span class=SpellE>proxys</span>.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>It demonstrates this by allowing the
|
||
connection to be made as a caller other than the currently logged on user.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>It also demonstrates how to access the
|
||
security descriptor for a namespace.<span style='mso-spacerun:yes'><EFBFBD> </span><o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt;
|
||
font-family:Verdana'>Building the Security Application<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText> </p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'>The application can be
|
||
built from the command line using NMAKE, or it can be built using Microsoft
|
||
Visual C++.<span yes> </span><o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'> <o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'>From the command line in
|
||
the sample installation directory, type the following: <o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'> <o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.25in'><b><span style='font-family:
|
||
Verdana'>NMAKE /f "<span class=SpellE>Makefile</span>"<o:p></o:p></span></b></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'> <o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'>From Microsoft Visual
|
||
C++: <o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'> <o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText .5in list lfo2 level1 l0><span style='font-family:Verdana'>1.<span
|
||
Roman New Times></span><span style='font-size:7.0pt;font-family:Verdana'></span>
|
||
</span><span style='font-family:Verdana'>Select File + Open Workspace<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText .5in list lfo2 level1 l0><span style='font-family:Verdana'>2.<span
|
||
Roman New Times></span><span style='font-size:7.0pt;font-family:Verdana'></span>
|
||
</span><span style='font-family:Verdana'>Select the <span class=SpellE>Security.dsp</span>
|
||
file<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><b><span style='font-family:Verdana'><o:p> </o:p></span></b></p>
|
||
|
||
<p class=MsoPlainText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt;
|
||
font-family:Verdana'>Using the Security Sample<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><o:p> </o:p></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:Verdana;
|
||
mso-fareast-font-family:Verdana;mso-bidi-font-family:Verdana'><span
|
||
style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>
|
||
</span></span></span><![endif]><span style='font-family:Verdana'>Build the
|
||
Security sample using NMAKE as described above<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:Verdana;
|
||
mso-fareast-font-family:Verdana;mso-bidi-font-family:Verdana'><span
|
||
style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>
|
||
</span></span></span><![endif]><span style='font-family:Verdana'>Execute the
|
||
Security application and the appropriate options will be listed.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>From the command line in the sample
|
||
installation directory, type the following:<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText><span style='font-family:Verdana'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.5in'><b><span style='font-family:
|
||
Verdana'>Security.exe<o:p></o:p></span></b></p>
|
||
|
||
<p class=MsoPlainText style='tab-stops:list .5in'><o:p> </o:p></p>
|
||
|
||
<p class=MsoNormal style='tab-stops:list .5in'><strong><span style='font-family:
|
||
Verdana;font-weight:normal'>General Notes<o:p></o:p></span></strong></p>
|
||
|
||
<p class=MsoNormal style='tab-stops:list .5in'><strong><span style='font-family:
|
||
Verdana;font-weight:normal'><o:p> </o:p></span></strong></p>
|
||
|
||
<p class=MsoPlainText style='tab-stops:list .5in'><span style='font-family:
|
||
Verdana;mso-fareast-font-family:"MS Mincho";mso-bidi-font-family:"Times New Roman"'>Things
|
||
to remember when you're building your own WMI client application:</span><span
|
||
style='mso-fareast-font-family:"MS Mincho";mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='tab-stops:list .5in'><span style='font-family:
|
||
Verdana;mso-fareast-font-family:"MS Mincho";mso-bidi-font-family:"Times New Roman"'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.25in;text-indent:-.25in;mso-list:
|
||
l1 level1 lfo4;tab-stops:list .25in .5in'><![if !supportLists]><span
|
||
style='font-family:"Times New Roman"'><span style='mso-list:Ignore'>1.<span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span></span><![endif]><span style='font-family:Verdana;mso-fareast-font-family:
|
||
"MS Mincho";mso-bidi-font-family:"Times New Roman"'>WMI interfaces are defined
|
||
in <span class=SpellE>wbemcli.h</span> and <span class=SpellE>wbemprov.h</span>
|
||
found in the <span class=SpellE>wmi</span>\include directory.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>You may #include both these files by including
|
||
just <span class=SpellE>wbemidl.h</span> located in the same directory.<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='tab-stops:list .5in'><span style='font-family:
|
||
Verdana;mso-fareast-font-family:"MS Mincho";mso-bidi-font-family:"Times New Roman"'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.25in;text-indent:-.25in;mso-list:
|
||
l1 level1 lfo4;tab-stops:list .25in .5in'><![if !supportLists]><span
|
||
style='font-family:"Times New Roman"'><span style='mso-list:Ignore'>2.<span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span></span><![endif]><span style='font-family:Verdana;mso-fareast-font-family:
|
||
"MS Mincho";mso-bidi-font-family:"Times New Roman"'>WMI interface <span
|
||
class=SpellE>CLSIDs</span> are defined in <span class=SpellE>wbemuuid.lib</span>.
|
||
If you get unresolved externals in interfaces and <span class=SpellE>CLSIDs</span>,
|
||
this is what is missing. <o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='tab-stops:list .5in'><span style='font-family:
|
||
Verdana;mso-fareast-font-family:"MS Mincho";mso-bidi-font-family:"Times New Roman"'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.25in;text-indent:-.25in;mso-list:
|
||
l1 level1 lfo4;tab-stops:list .25in .5in'><![if !supportLists]><span
|
||
style='font-family:"Times New Roman"'><span style='mso-list:Ignore'>3.<span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span></span><![endif]><span style='font-family:Verdana;mso-fareast-font-family:
|
||
"MS Mincho";mso-bidi-font-family:"Times New Roman"'>You'll need to link with
|
||
oleaut32.lib and ole32.lib to get the needed COM support.<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='tab-stops:list .5in'><span style='font-family:
|
||
Verdana;mso-fareast-font-family:"MS Mincho";mso-bidi-font-family:"Times New Roman"'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.25in;text-indent:-.25in;mso-list:
|
||
l1 level1 lfo4;tab-stops:list .25in .5in'><![if !supportLists]><span
|
||
style='font-family:"Times New Roman"'><span style='mso-list:Ignore'>4.<span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span></span><![endif]><span style='font-family:Verdana;mso-fareast-font-family:
|
||
"MS Mincho";mso-bidi-font-family:"Times New Roman"'>In the <span class=SpellE>Link|Output</span>
|
||
settings, specify '<span class=SpellE>wWinMainCRTStartup</span>' as the entry
|
||
point. This is per the Unicode programming instructions.<o:p></o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='tab-stops:list .5in'><span style='font-family:
|
||
Verdana;mso-fareast-font-family:"MS Mincho";mso-bidi-font-family:"Times New Roman"'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoPlainText style='margin-left:.25in;text-indent:-.25in;mso-list:
|
||
l1 level1 lfo4;tab-stops:list .25in .5in'><![if !supportLists]><span
|
||
style='font-family:"Times New Roman"'><span style='mso-list:Ignore'>5.<span
|
||
style='font:7.0pt "Times New Roman"'>
|
||
</span></span></span><![endif]><span style='font-family:Verdana;mso-fareast-font-family:
|
||
"MS Mincho"'>If you're using the <span class=SpellE>makefiles</span>, don't
|
||
forget to set the Visual C++ environment variables. This is done by running
|
||
VCVARS32.BAT.<o:p></o:p></span></p>
|
||
|
||
<p class=MsoNormal style='tab-stops:list .5in'><br>
|
||
<span style='font-family:Arial'><a
|
||
href="http://www.microsoft.com/misc/CPYRIGHT.HTM"><span style='mso-field-code:
|
||
"HYPERLINK \0022http\:\/\/www\.microsoft\.com\/misc\/CPYRIGHT\.HTM\0022"'><b><EFBFBD> 2001
|
||
Microsoft Corporation. All rights reserved.</b></span></a></span></p>
|
||
|
||
</div>
|
||
|
||
</body>
|
||
|
||
</html>
|