<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:v =
"urn:schemas-microsoft-com:vml"><HEAD><!--[if !mso]>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
.shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
page: Section1
}
</STYLE>
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV><SPAN class=763424415-14062006><FONT face=Arial color=#0000ff size=2>Here
is the patch.</FONT></SPAN></DIV>
<DIV><SPAN class=763424415-14062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=763424415-14062006><FONT face=Arial color=#0000ff size=2>Please
note that there is probably another small issue here. Currently we create the
files on install and remove them on un-install. </FONT></SPAN></DIV>
<DIV><SPAN class=763424415-14062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=763424415-14062006><FONT face=Arial color=#0000ff size=2>I
think that the correct logic is to remove the files on the install or never to
remove them. (They are in the temp after all).</FONT></SPAN></DIV>
<DIV><SPAN class=763424415-14062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=763424415-14062006><FONT face=Arial color=#0000ff
size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=763424415-14062006><FONT face=Arial color=#0000ff
size=2>Tzachi</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Index:
installsp.c<BR>===================================================================<BR>---
installsp.c (revision 385)<BR>+++ installsp.c (working copy)<BR>@@
-133,25 +133,71 @@<BR> #define IBSP_PM_NUM_SYMBOLS
(sizeof(_pm_symbols)/sizeof(pm_symbol_def_t))<BR> #define IBSP_PM_LANGUAGE
"009" /* good for English */<BR> <BR>+static CHAR
*<BR>+_IBSPGenerateFileName(char *header, char *file
)<BR>+{<BR>+ DWORD size1, size;<BR>+ CHAR
*full_file_name;<BR>+ int header_len = header == NULL ? 0 :
strlen(header);<BR> <BR>+ size = GetTempPath(0, NULL);<BR>+ if
(size == 0)<BR>+ {<BR>+ fprintf( stderr, "GetTempPath
failed\n" );<BR>+ return NULL;<BR>+ }<BR>+ size1 = size +
strlen(file) + header_len;<BR>+ full_file_name = HeapAlloc (GetProcessHeap
(), HEAP_ZERO_MEMORY, size1);<BR>+ if ( full_file_name == NULL
)<BR>+ {<BR>+ fprintf( stderr, "GetTempPath failed\n"
);<BR>+ return NULL;<BR>+ }<BR>+ size1 = GetTempPath(size,
full_file_name + header_len);<BR>+ if (size != size1 + 1)
<BR>+ {<BR>+ fprintf( stderr, "Very strange, GetTempPath
returned something different\n" );<BR>+ HeapFree (GetProcessHeap (),
0, full_file_name);<BR>+ return NULL;<BR>+ }<BR>+ if
(header_len != 0)<BR>+ {<BR>+ memcpy(full_file_name, header,
header_len);<BR>+ }<BR>+ strcat(full_file_name,
file);<BR>+ return full_file_name;<BR>+}<BR>+<BR>+<BR> static
DWORD<BR> _IBSPPerfmonIniFilesGenerate( void
)<BR> {<BR> FILE *f_handle;<BR> DWORD num;<BR>+ DWORD
ret = ERROR_SUCCESS;<BR>+ char *ibsp_pm_sym_file = NULL;<BR>+ char
*ibsp_pm_ini_file = NULL;<BR> <BR> /* create ".h" file first
*/<BR>- f_handle = fopen( IBSP_PM_SYM_H_FILE, "w+"
);<BR>+ ibsp_pm_sym_file = _IBSPGenerateFileName(NULL,
IBSP_PM_SYM_H_FILE);<BR>+ if( !ibsp_pm_sym_file
)<BR>+ {<BR>+ fprintf( stderr, "_IBSPGenerateFileName
failed\n" );<BR>+ ret = ERROR_NOT_ENOUGH_MEMORY;<BR>+ goto
Cleanup;<BR>+ }<BR> <BR>+ f_handle = fopen( ibsp_pm_sym_file,
"w+" );<BR>+<BR> if( !f_handle
)<BR> {<BR>- fprintf(<BR>- stderr,
"Create Header file %s failed\n", IBSP_PM_SYM_H_FILE
);<BR>- return ERROR_FILE_INVALID;<BR>+ fprintf( stderr,
"Create Header file %s failed\n", ibsp_pm_sym_file );<BR>+ ret =
ERROR_FILE_INVALID;<BR>+ goto
Cleanup;<BR> }<BR> <BR> fprintf(<BR>- f_handle,
"/* %s Generated by program */ \r\n", IBSP_PM_SYM_H_FILE
);<BR>+ f_handle, "/* %s Generated by program */ \r\n",
ibsp_pm_sym_file );<BR> <BR> <BR> for(
num = 0; num < IBSP_PM_NUM_SYMBOLS; num++ )<BR>@@ -164,16 +210,24
@@<BR> fclose( f_handle );<BR> <BR> /* create 'ini'
file next */<BR>- f_handle = fopen( IBSP_PM_INI_FILE, "w+"
);<BR>+ ibsp_pm_ini_file = _IBSPGenerateFileName(NULL,
IBSP_PM_INI_FILE);<BR>+ if( !ibsp_pm_sym_file
)<BR>+ {<BR>+ fprintf( stderr, "_IBSPGenerateFileName
failed\n" );<BR>+ ret = ERROR_NOT_ENOUGH_MEMORY;<BR>+ goto
Cleanup;<BR>+ }<BR>+ f_handle = fopen( ibsp_pm_ini_file, "w+"
);<BR> <BR> if( !f_handle
)<BR> {<BR>- fprintf( stderr, "Create INI file %s
failed\n", IBSP_PM_INI_FILE );<BR>- return
ERROR_FILE_INVALID;<BR>+ fprintf( stderr, "Create INI file %s
failed\n", ibsp_pm_ini_file );<BR>+ ret =
ERROR_FILE_INVALID;<BR>+ goto
Cleanup;<BR> }<BR> <BR> fprintf( f_handle,
"[info]\r\ndrivername=" IBSP_PM_SUBKEY_NAME<BR>- "\r\nsymbolfile="
IBSP_PM_SYM_H_FILE "\r\n\r\n" );<BR>+ "\r\nsymbolfile=%s\r\n\r\n",
ibsp_pm_sym_file );<BR> fprintf( f_handle,"[languages]\r\n"
IBSP_PM_LANGUAGE<BR> "=language" IBSP_PM_LANGUAGE "\r\n\r\n"
);<BR> <BR>@@ -192,23 +246,60 @@<BR> fflush( f_handle
);<BR> fclose( f_handle );<BR> <BR>- return
ERROR_SUCCESS;<BR>+Cleanup:<BR>+ if ( ibsp_pm_sym_file
)<BR>+ {<BR>+ HeapFree (GetProcessHeap (), 0,
ibsp_pm_sym_file);<BR>+ }<BR>+ if ( ibsp_pm_ini_file
)<BR>+ {<BR>+ HeapFree (GetProcessHeap (), 0,
ibsp_pm_ini_file);<BR>+ }<BR>+ return
ret;<BR> }<BR> <BR> <BR> static
void<BR> _IBSPPerfmonIniFilesRemove( void )<BR> {<BR>- if(
!DeleteFile( IBSP_PM_INI_FILE ) )<BR>+ char *ibsp_pm_sym_file =
NULL;<BR>+ char *ibsp_pm_ini_file = NULL;<BR>+<BR>+ ibsp_pm_sym_file =
_IBSPGenerateFileName(NULL, IBSP_PM_SYM_H_FILE);<BR>+ if( !ibsp_pm_sym_file
)<BR> {<BR>+ fprintf( stderr, "_IBSPGenerateFileName
failed\n" );<BR>+ goto
Cleanup;<BR>+ }<BR>+<BR>+ ibsp_pm_ini_file =
_IBSPGenerateFileName(NULL, IBSP_PM_INI_FILE);<BR>+ if( !ibsp_pm_sym_file
)<BR>+ {<BR>+ fprintf( stderr, "_IBSPGenerateFileName
failed\n" );<BR>+ goto Cleanup;<BR>+ }<BR>+<BR>+ if(
!DeleteFile( ibsp_pm_ini_file ) )<BR>+ {<BR> fprintf(
stderr, "Delete file %s failed status
%d\n",<BR>- IBSP_PM_INI_FILE, GetLastError()
);<BR>+ ibsp_pm_ini_file, GetLastError()
);<BR> }<BR>- if( !DeleteFile( IBSP_PM_SYM_H_FILE )
)<BR>+ if( !DeleteFile( ibsp_pm_sym_file )
)<BR> {<BR> fprintf( stderr,"Delete file %s failed
status %d\n",<BR>- IBSP_PM_SYM_H_FILE, GetLastError()
);<BR>+ ibsp_pm_sym_file, GetLastError()
);<BR> }<BR>+<BR>+Cleanup: <BR>+ if ( ibsp_pm_sym_file
)<BR>+ {<BR>+ HeapFree (GetProcessHeap (), 0,
ibsp_pm_sym_file);<BR>+ }<BR>+ if ( ibsp_pm_ini_file
)<BR>+ {<BR>+ HeapFree (GetProcessHeap (), 0,
ibsp_pm_ini_file);<BR>+ }<BR>+ <BR> }<BR> <BR> <BR>@@
-322,20 +413,34 @@<BR> _IBSPPerfmonRegisterCounters( void
)<BR> {<BR> DWORD status;<BR>+ char *ibsp_pm_ini_file =
NULL;<BR>+<BR>+ ibsp_pm_ini_file = _IBSPGenerateFileName("unused ",
IBSP_PM_INI_FILE);<BR>+ if( !ibsp_pm_ini_file
)<BR>+ {<BR>+ fprintf( stderr, "_IBSPGenerateFileName
failed\n" );<BR>+ status =
ERROR_NOT_ENOUGH_MEMORY;<BR>+ goto
Cleanup;<BR>+ }<BR>+<BR> /*<BR> * format commandline
string, as per SDK :<BR> * Pointer to a null-terminated string
that consists of one or more <BR> * arbitrary letters, a space,
and then the name of the initialization<BR>
* file.<BR> */<BR>- status =
LoadPerfCounterTextStrings(<BR>- TEXT("unused ")
TEXT(IBSP_PM_INI_FILE), TRUE );<BR>+ status = LoadPerfCounterTextStrings(
ibsp_pm_ini_file, TRUE );<BR> if( status != ERROR_SUCCESS
)<BR> {<BR> status =
GetLastError();<BR> fprintf(
stderr,<BR> "IBSPPerfmonRegisterCounters install failed
status %d\n", status );<BR> }<BR>+Cleanup: <BR>+ if (
ibsp_pm_ini_file )<BR>+ {<BR>+ HeapFree (GetProcessHeap (), 0,
ibsp_pm_ini_file);<BR>+ }<BR> <BR> return
status;<BR> }</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><BR></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Tillier, Fabian
[mailto:ftillier@silverstorm.com] <BR><B>Sent:</B> Friday, June 09, 2006 12:57
AM<BR><B>To:</B> Tzachi Dar; openib-windows@openib.org<BR><B>Subject:</B> RE:
Installing WSD from a directory without write
permissions.<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Yes,
please.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Thanks,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">-
Fab<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> Tzachi
Dar [mailto:tzachid@mellanox.co.il] <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thursday, June 08, 2006 2:56
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Tillier, Fabian;
openib-windows@openib.org<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> Installing WSD from a directory
without write permissions.</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi
Fab,</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Installing WSD on a directory
without write permissions fails to write the needed data for
perfmon.</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The reason for this is that there
are files that are written to the local directory. It seems that the
solution</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">to this problem is to write the
files to the temp directory.</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Should I prepare a patch for
that?</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Tzachi
</SPAN></FONT><o:p></o:p></P></DIV></DIV></DIV></BLOCKQUOTE></BODY></HTML>