<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Michel's WEBlog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/michelmolongo/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/michelmolongo/feed.xml</link>
    <description>Dedicated to Microsoft Windows Platform development. Posts are in french and in english.</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:08:19 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Logon failure: unknown user name or bad password</title>
      <link>https://docs.microsoft.com/archive/blogs/michelmolongo/logon-failure-unknown-user-name-or-bad-password</link>
      <pubDate>Mon, 10 May 2010 06:19:00 GMT</pubDate>
      <dc:creator><![CDATA[Michel Molongo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/michelmolongo/2010/05/10/logon-failure-unknown-user-name-or-bad-password/</guid>
      <description><![CDATA[function show(id) {
        document.getElementById(id).style.display = '';
    }...]]></description>
      <content:encoded><![CDATA[
<SCRIPT language=javascript type=text/javascript>
    function show(id) {
        document.getElementById(id).style.display = '';
    }
    function hide(id) {
        document.getElementById(id).style.display = 'none';
    }
    function debug_message(message){document.write(message);}
</SCRIPT>
<!-- TEMPLATE --><A onclick="javascript:show('fr_3');hide('us_3');return false;" href="https://blogs.msdn.com/controlpanel/blogs/?fr_3" target=_self mce_href="?fr_3"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7693/00/00/03/26/29/90/fr.gif" original-url="https://blogs.technet.com/photos/mdegre/images/3262990/original.aspx" mce_src="https://blogs.technet.com/photos/mdegre/images/3262990/original.aspx"></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A onclick="javascript:show('us_3');hide('fr_3');return false;" href="https://blogs.msdn.com/controlpanel/blogs/?us_3" target=_self mce_href="?us_3"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7693/00/00/03/26/29/91/us.gif" original-url="https://blogs.technet.com/photos/mdegre/images/3262991/original.aspx" mce_src="https://blogs.technet.com/photos/mdegre/images/3262991/original.aspx"></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><BR>
<DIV id=us_3>Hi guys,<BR><BR>This article deals with windows user account authentication failure.<BR><BR>I'll try to explain somes tricks and tips I experienced while using the multiple ways available in <B>VBScript</B>, <B>C#</B>, <B>C++</B> or even <B>JAVA</B> to authenticate a user account on a local machine or against <B>Active Directory</B> domain using <B>LDAP</B>.<BR><BR>I'll focus on failure issues when you get the following error or exception :<BR><BR><STRONG>ERROR_LOGON_FAILURE<BR>Logon failure: unknown user name or bad password.</STRONG><BR><BR>Basically you get this error message when a logon attempt failed if the given password was bad, if the user account does not exist or if the password is expired, or if the password must be changed.<BR><BR>As a developer or IT Administrator you may need to know exactly why the attempt failed.&nbsp; <BR><BR>There are actually multiple APIs to do so, let's take <B>.NET</B> case and&nbsp; <STRONG>PrincipalContext</STRONG> class : <A href="https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext.aspx" mce_href="https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext.aspx">https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext.aspx</A><BR><BR>From Namespace : <A href="https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.aspx" mce_href="https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.aspx">System.DirectoryServices.AccountManagement</A><BR><BR>This class behind the scene instatiates a <B>COM</B> object that makes a <B>LDAP</B> query to the <B>Active Directory</B> domain to try to authenticate the user.<BR><BR>You'll understand later that this is basically the reason why you can get the same error message for multiple distinguished cause.<BR>Indeed, Active Directory Services Interface (<B>ADSI</B>) supports the following categories of error codes:<BR><B>- ADSI</B> error codes<BR>-<B> COM</B> general error codes<BR><B>- Win32</B> error codes for the Lightweight Directory Access Protocol (<B>LDAP</B>) provider.<BR><BR>All <B>ADSI</B> error codes are returned as <B>COM HRESULT</B> values and can be grouped into these three categories.<BR><BR>Because a Windows API can mix heterogeneous components, the system-supplied<B> LDAP</B> provider maps the standard <B>LDAP</B> error codes into the following Win32 error codes.<BR><BR>Standard <B>Win32</B> error codes are also used to return <B>ADSI</B> error messages. In particular, the <B>ADSI LDAP</B> provider maps all the <B>LDAP</B>-defined error codes to Win32 error codes.<BR><BR>The following KB articles deals with this topic :<BR><A href="https://support.microsoft.com/kb/232282/" mce_href="https://support.microsoft.com/kb/232282/">https://support.microsoft.com/kb/232282/</A>&nbsp; <BR><BR>The error we got "<STRONG>ERROR_LOGON_FAILURE</STRONG>" is actually the Win32 error code for "<B>LDAP_INVALID_CREDENTIALS</B>".<BR>The issue is that at an <B>LDAP</B> layer, there is no disction made with the cases we would like to differenciate.<BR><BR>The "<B>LDAP_INVALID_CREDENTIALS</B>" will be returned in any cases, if the password is wrong, expired or needs to be changed.<BR><BR>There are actually multiple workarounds you can use to achieve your goal.<BR><BR>Once you get the error : “<B>Logon failure: unknown user name or bad password.</B>” If you want to determine if the login attempt failed because the password is bad or because it is expired, what you can do is to query for that user on Active Directory using <B>LDAP</B>.<BR>Then look for value of <B>PasswordExpired</B> or <B>ms-DS-User-Password-Expired </B>attributes. <BR><BR>According to the documentation : <A href="https://msdn.microsoft.com/en-us/library/ms677838(VS.85).aspx" mce_href="https://msdn.microsoft.com/en-us/library/ms677838(VS.85).aspx">https://msdn.microsoft.com/en-us/library/ms677838(VS.85).aspx</A><BR>It Indicates whether the password for the account that this attribute references has expired. <B>True</B> if the password has expired; otherwise, <B>False</B>.<BR><BR>To finish, there is <B>Win32</B> API you can use to authenticate a user that is not based on that <B>COM</B> component and will return you the correct error code depending if the password is expired or if the password entered by the user is wrong.<BR><BR>You can use <B>LogonUser</B> <A href="https://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx" mce_href="https://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx">https://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx</A> that will return one of the following error : <BR><BR><B>ERROR_PASSWORD_EXPIRED 1330</B><BR><B>ERROR_LOGON_FAILURE 1326</B><BR><B>ERROR_PASSWORD_MUST_CHANGE 1907</B><BR><BR>Here we go, I hope that post helped you.<BR><BR>Cheers,<BR><BR>--Michel<BR><BR></DIV>
<DIV style="DISPLAY: none" id=fr_3>Salut à tous,<BR><BR>Cet article traite des problèmes d'authentification des comptes utilisateur Windows.<BR><BR>Je vais tenter partager avec vous quelques expériences rencontrées lors de développements <B>VBScript</B>, <B>C#</B>, <B>C++</B> ou même <B>JAVA</B> pour authentifier un compte utilisateur Windows sur une machine locale ou dans un domaine <B>Active Directory</B> en utilisant <B>LDAP</B>. <BR><BR>Je vous propose de nous interesser à l'erreur ou l'exception :<BR><BR><STRONG>ERROR_LOGON_FAILURE<BR>Logon failure: unknown user name or bad password.</STRONG><BR><BR>Typiquement vous obtenez ce message d'erreur losque qu'une tentative d'authentification échoue, si le mot de passe renseigné est incorrecte, si le compte utilisateur n'existe pas, si le mot de passe du compte est expiré ou alors doit être changé.<BR><BR>En tant que développeur ou Administrateur d'un parc informatique nous pouvons avoir besoin de connaitre la source exacte de l'erreur.<BR><BR>Il existe divers méthodes pour authentifier un compte, prenons par exemple l'exemple .Net avec la classe <STRONG>PrincipalContext</STRONG> : <A href="https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext.aspx" mce_href="https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext.aspx">https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext.aspx</A><BR><BR>De l'espace de nom : <A href="https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.aspx" mce_href="https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.aspx">System.DirectoryServices.AccountManagement</A><BR><BR>Le méchanisme interne de cette classe instancie un objet <B>COM</B> qui effectue des requêtes <B>LDAP</B> vers le domaine <B>&nbsp;Active Directory</B> afin de tenter une authentification.<BR><BR>Vous comprendrez pourquoi cette implémentation est en fait problématique dans notre effort de différentiation des types d'erreurs liés à l'authentification. <BR><BR>En effet,&nbsp; Active Directory Services Interface (<B>ADSI</B>) supporte les catégories suivantes de code d'erreurs : <BR>- Les codes d'erreurs <B>ADSI</B><BR>- Les codes d'erreurs standards de <B>COM</B><BR>- Les codes d'erreurs <B>WIN32</B> spécifique au fournisseur Lightweight Directory Access Protocol (<B>LDAP</B>)<BR><BR>Toutes les erreurs <B>ADSI</B> sont retournées comme des valeurs <B>HRESULT</B> <B>COM </B>qui peuvent être regroupées dans ces trois catégories.<BR><BR>Parce qu'une <B>API</B> <B>Windows</B> peut reposer sur des composants hétérogènes, le système propose un fournisseur <B>LDAP</B> dont les codes d'erreurs ont une correspondance avec les codes d'erreurs <B>Win32</B>.<BR><BR>Les codes d'erreurs standards <B>Win32</B> sont aussi utilisés pour retourner des message d'erreur <B>ADSI</B>. Plus précisément les fournisseurs <B>ADSI LDAP</B> font la correspondance entre toutes les erreurs définies par <B>LDAP</B>&nbsp; et leurs équivalents <B>Win32</B>.<BR><BR>L'article KB suivant traite de ce sujet :<BR><A href="https://support.microsoft.com/kb/232282/" mce_href="https://support.microsoft.com/kb/232282/">https://support.microsoft.com/kb/232282/</A>&nbsp; <BR><BR>L'erreur&nbsp; "<STRONG>ERROR_LOGON_FAILURE</STRONG>" que nous traitons dans cet article est en fait l'équivalent <B>Win32</B> de l'erreur LDAP "<B>LDAP_INVALID_CREDENTIALS</B>".<BR><BR>Le problème qui se pose c'est qu'au niveu <B>LDAP</B>, il n'y a pas de disctinction faite entre les différents cas de figures qui nous interressent.<BR><BR>L'erreur "<B>LDAP_INVALID_CREDENTIALS</B>" sera retournée par l'<B>API</B> appelante dans tous les cas, que le mot de passe du compte soit mauvais, expiré ou doive être changé.<BR>C'est donc assez problématique et cela masque la vraie nature du problème.<BR><BR>Il existe cependant des moyens de contournement afin de remonter à la source du problème.<BR><BR>Une fois que vous avez l'erreur : “<B>Logon failure: unknown user name or bad password.</B>” si vous souhaiter déterminer si l'authentification a échoué parce que le mot de passe du compte fournit était incorrect ou s'il a expiré vous pouvez faire une requête LDAP afin d'obtenir les valeurs des attributs du compte suivants&nbsp; <B>PasswordExpired</B> ou <B>ms-DS-User-Password-Expired.</B><BR><BR>D'après la documentation : <A href="https://msdn.microsoft.com/en-us/library/ms677838(VS.85).aspx" mce_href="https://msdn.microsoft.com/en-us/library/ms677838(VS.85).aspx">https://msdn.microsoft.com/en-us/library/ms677838(VS.85).aspx</A><BR>Cet attribue indique si le mot de passe est expiré. La valeur <B>True</B>&nbsp; sera renseignée si le mot de passe est expiré; sinon, <B>False</B>.<BR><BR>Pour terminer, il existe aussi des <B>API</B> <B>Win32</B> pour authentifier un compte qui ne sont pas basés sur ce composant <B>COM</B> et qui retourneront un code d'erreur approprié.<BR><BR>Vous pouvez utiliser par exemple <B>LogonUser</B> <A href="https://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx" mce_href="https://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx">https://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx</A> qui vous retournera l'une des erreurs suivantes : <BR><BR><B>ERROR_PASSWORD_EXPIRED 1330</B><BR><B>ERROR_LOGON_FAILURE 1326</B><BR><B>ERROR_PASSWORD_MUST_CHANGE 1907</B><BR><BR>Voilà j'espère que cet article vous a été utile.<BR><BR>Bon code.<BR><BR>--Michel <!-- TEMPLATE --></DIV>]]></content:encoded>
    </item>
    <item>
      <title>Windows Vista C++ application is unable to print out documents</title>
      <link>https://docs.microsoft.com/archive/blogs/michelmolongo/windows-vista-c-application-is-unable-to-print-out-documents</link>
      <pubDate>Sun, 08 Nov 2009 08:43:00 GMT</pubDate>
      <dc:creator><![CDATA[Michel Molongo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/michelmolongo/2009/11/08/windows-vista-c-application-is-unable-to-print-out-documents/</guid>
      <description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

Hi there,
I know some...]]></description>
      <content:encoded><![CDATA[<A onclick="javascript:show('fr_2');hide('us_2');return false;" href="https://blogs.msdn.com/controlpanel/blogs/?fr_2" target=_self mce_href="?fr_2"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7693/00/00/03/26/29/90/fr.gif" original-url="https://blogs.technet.com/photos/mdegre/images/3262990/original.aspx" mce_src="https://blogs.technet.com/photos/mdegre/images/3262990/original.aspx"></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A onclick="javascript:show('us_2');hide('fr_2');return false;" href="https://blogs.msdn.com/controlpanel/blogs/?us_2" target=_self mce_href="?us_2"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7693/00/00/03/26/29/91/us.gif" original-url="https://blogs.technet.com/photos/mdegre/images/3262991/original.aspx" mce_src="https://blogs.technet.com/photos/mdegre/images/3262991/original.aspx"></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><BR>
<DIV id=us_2>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Hi there,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>I know some of you have been waiting for a while before I made my first technical post. I’ve been busy helping you guys solving development issues, isn’t that a good justification? </FONT></SPAN><SPAN style="FONT-FAMILY: Wingdings; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">J</SPAN></SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Today, I’m going to give you an example of a typical scenario application’s developer faces with when a new version of <B style="mso-bidi-font-weight: normal">Windows</B> is released and we discover that our application that was working perfectly fine on previous version now has a completely different behavior.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>When that happens, we usually think that because our code was working fine before it means that something is going wrong with this new version of <B style="mso-bidi-font-weight: normal">Windows</B>. That can be true but experience shows that most of the time, we’ve to reconsider our assumption. To insure application backward compatibility, this is very unlikely that an API with the exact same name and parameter has his behavior changed from a version of <B style="mso-bidi-font-weight: normal">Windows</B> to another.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>I had a customer who was facing the following issue:<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT face=Calibri><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>PROBLEM:</SPAN></B><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>He has written a native <B style="mso-bidi-font-weight: normal">C++</B> application to print out his documents. The program has its own feature to connect a printer on network and printing out the documents. The application is working fine on <B style="mso-bidi-font-weight: normal">Windows XP</B> for years, but it seems that it is not compatible with <B style="mso-bidi-font-weight: normal">Windows Vista</B>. He’s getting an "<B style="mso-bidi-font-weight: normal">invalid handle</B>" error.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT face=Calibri><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>EXPECTATIONS / AGREED RESOLUTION:</SPAN></B><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>What is happening? How to get rid of this issue?<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT face=Calibri><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>ENVIRONMENT:</SPAN></B><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Windows Vista<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Shared printed accessible from any machines from local area network<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT face=Calibri><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>SUMMARY OF TROUBLESHOOTING:</SPAN></B><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>In such circumstances the first thing we need to find out is what API’s call generates the error.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>This can be done either by tracing the application with a debugger or by taking a process memory dump when the issue occurs. I’ll explain in a later post both of these different approaches.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>The error was returned by calling the <B style="mso-bidi-font-weight: normal">CreateFile</B> API (</FONT><A href="https://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx"><SPAN style="COLOR: blue"><FONT face=Calibri>https://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx</FONT></SPAN></A><FONT face=Calibri> ).<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 8pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>C++ </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>HANDLE WINAPI CreateFile(</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>LPCTSTR <I>lpFileName</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DWORD <I>dwDesiredAccess</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DWORD <I>dwShareMode</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in_opt<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>LPSECURITY_ATTRIBUTES <I>lpSecurityAttributes</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DWORD <I>dwCreationDisposition</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DWORD <I>dwFlagsAndAttributes</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in_opt<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>HANDLE <I>hTemplateFile</I></SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>);</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>&nbsp;<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>This function creates or opens a file or <B style="mso-bidi-font-weight: normal">I/O</B> device and returns a handle that can be used to access the file or device for various types of <B style="mso-bidi-font-weight: normal">I/O</B> depending on the file or device and the flags and attributes specified.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>The game is now to understand why the call fails on Windows Vista returning <B style="mso-bidi-font-weight: normal">VALID_HANDLE_VALUE</B>.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Reading the documentation we should have a look at the “<B style="mso-bidi-font-weight: normal">return value</B>” section.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>It says the following:<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT face=Calibri><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>Return Value :</SPAN></B><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>If the function succeeds, the return value is an open handle to the specified file, device, named pipe, or mail slot. <o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>If the function fails, the return value is <B style="mso-bidi-font-weight: normal">INVALID_HANDLE_VALUE</B>. To get extended error information, call <B style="mso-bidi-font-weight: normal">GetLastError()</B>.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>We could see that the <B style="mso-bidi-font-weight: normal">ERROR_FILE_NOT_FOUND</B> was returned by <B style="mso-bidi-font-weight: normal">GetLastError()</B>. This makes us think that for any reason, the API is not able to access the target file. At this step we can try to find in the documentation any hints that may lead us to any root cause, for instance any implementation changes or restriction coming with Windows Vista. Any reference like this one: </FONT><A href="https://support.microsoft.com/kb/942448/en-us"><SPAN style="COLOR: blue"><FONT face=Calibri>https://support.microsoft.com/kb/942448/en-us</FONT></SPAN></A><FONT face=Calibri> (Changes to the file system and to the storage stack to restrict direct disk access and direct volume access in <B style="mso-bidi-font-weight: normal">Windows Vista</B> and in <B style="mso-bidi-font-weight: normal">Windows Server 2008</B>).<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>The ultimate path to follow is to read all the information provided by the documentation regarding <B style="mso-bidi-font-weight: normal">ERROR_FILE_NOT_FOUND. </B>We are lucky more details regarding this error can be found in the documentation in the “Opening LPT Ports” section. It’s said that specifying <B style="mso-bidi-font-weight: normal">OPEN_EXISTING</B> as <B style="mso-bidi-font-weight: normal">dwCreationDisposition</B> parameter will cause the function to fail when called on <B style="mso-bidi-font-weight: normal">Windows</B> <B style="mso-bidi-font-weight: normal">Vista</B> or <B style="mso-bidi-font-weight: normal">Windows</B> <B style="mso-bidi-font-weight: normal">2008 server</B> to open an LPT port that is mapped to a network share. <B style="mso-bidi-font-weight: normal">GetLastError()</B> returns <B style="mso-bidi-font-weight: normal">ERROR_FILE_NOT_FOUND</B>.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>The customer’s application was calling the API with the following parameters:<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 8pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>C++ </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>CreateFile(“\\MyServer\MyPrinter” , FILE_FLAG_OVERLAPPED, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>&nbsp;<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>At this step we can notice that this is actually a known issue. To avoid this you should use the <B style="mso-bidi-font-weight: normal">OPEN_ALWAYS</B> flag instead that will force the driver to start the device so that the <B style="mso-bidi-font-weight: normal">WriteFile</B> interface is available. The code was modified that way:<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 8pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>C++ </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>CreateFile(“\\MyServer\MyPrinter” , FILE_FLAG_OVERLAPPED, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, 0, 0);</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>&nbsp;<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>&nbsp;With this solution the application was able to run successfully on both version of the operating system.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>To put it in a nutshell, when developing an application the first thing you should do is to read carefully the documentation and use the appropriate parameters. Most of the time this will prevent you for facing to this kind of issues. If any system change is susceptible to have an impact on an API, the documentation may mention it. If this is not the case, please don’t hesitate to raise the issue on the article in the appropriate section.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>I hope that you found this post useful. <o:p></o:p></FONT></SPAN></P><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-language: AR-SA" lang=EN-US>Cheers,</SPAN> </DIV>
<DIV style="DISPLAY: none" id=fr_2>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Bonjour à tous,<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Oui c’est vrai, j’ai un peu tardé à écrire mon premier post technique, mais j’ai une bonne excuse, j’étais occupé à aider certains d’entre vous à résoudre leurs problèmes de développement&nbsp;</FONT></SPAN><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Wingdings; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-char-type: symbol; mso-symbol-font-family: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">J</SPAN></SPAN><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Aujourd’hui je vais vous décrire un scenario typique que les développeurs d’application rencontrent lors d’une migration d’application pour la dernière mouture du système d’exploitation. Comment une application qui fonctionne parfaitement sur une version de <B style="mso-bidi-font-weight: normal">Windows</B> donnée se comporte-t-elle de manière différente sur son successeur ?<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>De manière générale quand ce type de situations se présente, le premier réflexe est de penser que quelque chose ne va pas avec cette nouvelle mouture de l’OS. C’est une assertion possible, mais dans la plupart des cas il faut savoir remettre en question cette hypothèse. Afin d’assurer la rétrocompatibilité des applications, il est vraiment peu probable qu’une API appelée avec les mêmes paramètres ait un comportement différent d’une version de l’OS à l’autre. Ce n’est cependant pas une hypothèse à exclure.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Un&nbsp;développeur&nbsp;a été confronté à la situation suivante :<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>PROBLEME :<o:p></o:p></FONT></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Il développe une application native en <B style="mso-bidi-font-weight: normal">C++</B> qui imprime des documents. L’application gère d’elle-même la connexion à l’imprimante réseau et y envoie les documents à imprimer. L’application fonctionne correctement depuis plusieurs années sous <B style="mso-bidi-font-weight: normal">Windows XP</B>, mais il semblerait qu’elle ne soit pas compatible avec <B style="mso-bidi-font-weight: normal">Windows Vista</B>. Il obtient le message d’erreur suivant quand il tente d’imprimer un document : "<B style="mso-bidi-font-weight: normal">invalid handle</B>".<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>ATTENTES DU DEVELOPPEUR :<o:p></o:p></FONT></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Savoir ce qui pose problème et comment faire en sorte que son application marche aussi bien sous <B style="mso-bidi-font-weight: normal">Windows XP</B> que <B style="mso-bidi-font-weight: normal">Windows Vista</B>.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>ENVIRONMENT:<o:p></o:p></FONT></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Windows Vista<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Imprimante partagée et accessible par toutes les machines du réseau local<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>RESUME :<o:p></o:p></FONT></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Dans de telles circonstances la première chose à faire est d’identifier l’appel à la fonction qui soulève le problème. <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Cela se fait généralement en traçant l’exécution du code avec débogueur ou alors par l’analyse d’une capture mémoire complète de la du processus. Je donnerai des exemples de ces deux approches dans un prochain article.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri></FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Dans ce cas précis, comme le problème a pu être facilement reproduit dans une application d’exemple minimaliste, il a été possible d’identifier que l’appel à la fonction suivante posait problème :<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>API <B style="mso-bidi-font-weight: normal">CreateFile</B> (</FONT><A href="https://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx"><FONT face=Calibri>https://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx</FONT></A><FONT face=Calibri> ).<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 8pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>C++ </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>HANDLE WINAPI CreateFile(</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>LPCTSTR <I>lpFileName</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DWORD <I>dwDesiredAccess</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DWORD <I>dwShareMode</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>__in_opt<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>LPSECURITY_ATTRIBUTES <I>lpSecurityAttributes</I>,</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Cette fonction crée puis ouvre un fichier ou <B style="mso-bidi-font-weight: normal">Entrée/Sortie</B> de périphérique et en retourne un handle qui peut être utilisé pour accéder au fichier ou périphérique en question selon différents types d’<B style="mso-bidi-font-weight: normal">E/S</B> en fonction des attributs spécifiés.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Le but du jeu est maintenant de comprendre pourquoi l’appel à cette fonction échoue et renvoie la valeur : <B style="mso-bidi-font-weight: normal">INVALID_HANDLE_VALUE</B>.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>En lisant la documentation de l’API dans la section “<B style="mso-bidi-font-weight: normal">valeur de retour</B>” nous pouvons lire les informations suivantes :<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Valeur de retour&nbsp;:<o:p></o:p></FONT></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Si la fonction réussit, la valeur de retour est un <B style="mso-bidi-font-weight: normal">handle</B> ouvert au fichier, périphérique, <B style="mso-bidi-font-weight: normal">named pipe</B> (canal nommé) ou <B style="mso-bidi-font-weight: normal">mailslot</B> spécifié. <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Si la fonction échoue, la valeur de retour est<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><B style="mso-bidi-font-weight: normal">INVALID_HANDLE_VALUE</B>. Afin d’obtenir plus d’information sur l’erreur faire un appel à <B style="mso-bidi-font-weight: normal">GetLastError()</B>.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>L’erreur <B style="mso-bidi-font-weight: normal">ERROR_FILE_NOT_FOUND</B><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>a été retournée par<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><B style="mso-bidi-font-weight: normal">GetLastError()</B>. Cela laisse à penser que pour une raison encore inconnue, l’API n’a pas pu accéder à ressource cible. A ce stade nous pouvons chercher des indications dans la documentation qui pourrait expliquer ce comportement. Des indices comme des changements d’implémentation ou de politique de sécurité et restriction sont à surveiller de près. <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri></FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>La référence suivante : <B style="mso-bidi-font-weight: normal">Modifications dans le système de fichiers et dans la pile de stockage pour limiter les accès disque direct et des accès directs volume dans Windows Vista et dans Windows Server 2008 </B>( </FONT><A href="https://support.microsoft.com/kb/942448/en-us"><FONT face=Calibri>https://support.microsoft.com/kb/942448/en-us</FONT></A><FONT face=Calibri> ) est typiquement le genre d’éléments qui peut avoir une impacte sur le comportement d’une API.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>La dernière piste à suivre est de lire en détails les informations fournies dans la documentation <B style="mso-bidi-font-weight: normal">MSDN</B> de l’API au sujet de l’erreur <B style="mso-bidi-font-weight: normal">ERROR_FILE_NOT_FOUND</B>. Dans ce cas précis nous avons dans la section “<B style="mso-bidi-font-weight: normal">Opening LPT Ports</B>” une référence intéressante. Il est expliqué que l’utilisation de l’API qui nous intéresse en spécifiant le paramètre <B style="mso-bidi-font-weight: normal">dwCreationDisposition</B> avec pour valeur <B style="mso-bidi-font-weight: normal">OPEN_EXISTING</B> aura pour effet de faire échouer l’appel sous <B style="mso-bidi-font-weight: normal">Windows Vista</B> et <B style="mso-bidi-font-weight: normal">Windows Server 2008</B> lors des tentatives d’ouverture de port de type <B style="mso-bidi-font-weight: normal">LPT</B> mappé sur un partage réseau. <B style="mso-bidi-font-weight: normal">GetLastError()</B> retourne dans ce cas <B style="mso-bidi-font-weight: normal">ERROR_FILE_NOT_FOUND</B>.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Le code source qui reproduit le problème appel l’API de la manière suivante :<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 8pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>C++ </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>CreateFile(“\\MyServer\MyPrinter” , FILE_FLAG_OVERLAPPED, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Nous sommes exactement dans le cas de figure décrit par la documentation. Afin d’éviter que cela se produise, il faudrait spécifier la valeur<SPAN style="mso-spacerun: yes"> </SPAN><B style="mso-bidi-font-weight: normal">OPEN_ALWAYS</B><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>pour le paramètre <B style="mso-bidi-font-weight: normal">dwCreationDisposition</B> ce qui aura pour effet de forcer le pilote d’impression à démarrer le périphérique afin que l’interface <B style="mso-bidi-font-weight: normal">WriteFile</B> utilisée par l’API <B style="mso-bidi-font-weight: normal">CreateFile</B> soit disponible. Le code doit être modifié de la manière suivante :<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: top" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin">C++ </SPAN><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; BACKGROUND: #dddddd; VERTICAL-ALIGN: top; WORD-BREAK: break-all; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class=MsoNormal><FONT face=Calibri><SPAN style="COLOR: black; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>CreateFile(“\\MyServer\MyPrinter” , FILE_FLAG_OVERLAPPED, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, 0, 0);</SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri></FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Avec cette solution, l’application est maintenant capable de s’exécuter&nbsp;correctement sous sur les différentes versions du système d’exploitation <STRONG>Windows</STRONG>.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Pour résumer, il est vraiment fondamental dans le cadre d’un développement ou d’un débogage d’application de se fier à la documentation et d’utiliser les paramètres appropriés en fonction du contexte d’appel aux différentes APIs. De manière générale, toute impact potentiel d’un changement au niveau du système est signalé dans la documentation de l’API. Si tel n’est pas le cas il ne faut pas hésiter à le signaler au niveau de l’article <B style="mso-bidi-font-weight: normal">MSDN</B> dans la section appropriée.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Voilà, j’espère que cet exemple vous a été utile et vous permettra d’anticiper ou résoudre les problèmes de ce type rencontrés lors d’une migration.<o:p></o:p></FONT></SPAN></P><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 12pt; mso-ansi-language: FR; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-language: AR-SA">--Michel</SPAN> </DIV>]]></content:encoded>
    </item>
    <item>
      <title>Introduction</title>
      <link>https://docs.microsoft.com/archive/blogs/michelmolongo/introduction</link>
      <pubDate>Mon, 31 Aug 2009 09:38:00 GMT</pubDate>
      <dc:creator><![CDATA[Michel Molongo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/michelmolongo/2009/08/31/introduction/</guid>
      <description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

Hi there,
&nbsp;
I’m...]]></description>
      <content:encoded><![CDATA[<A onclick="javascript:show('fr_1');hide('us_1');return false;" href="https://blogs.msdn.com/controlpanel/blogs/?fr_1" target=_self mce_href="?fr_1"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7693/00/00/03/26/29/90/fr.gif" original-url="https://blogs.technet.com/photos/mdegre/images/3262990/original.aspx" mce_src="https://blogs.technet.com/photos/mdegre/images/3262990/original.aspx"></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A onclick="javascript:show('us_1');hide('fr_1');return false;" href="https://blogs.msdn.com/controlpanel/blogs/?us_1" target=_self mce_href="?us_1"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7693/00/00/03/26/29/91/us.gif" original-url="https://blogs.technet.com/photos/mdegre/images/3262991/original.aspx" mce_src="https://blogs.technet.com/photos/mdegre/images/3262991/original.aspx"></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><BR>
<DIV id=us_1>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Hi there,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>I’m Michel Molongo, development support engineer on <B style="mso-bidi-font-weight: normal">Windows Platform</B> for nearly one year at <B style="mso-bidi-font-weight: normal">Microsoft EMEA</B> (Customer Service and Support Division). I’ve just created that blog in order to share with you different experience and topics I deal with on my day to day work around <B style="mso-bidi-font-weight: normal">Windows</B>. That’s also a great opportunity for me to tell about the not so well known of support engineer among <B style="mso-bidi-font-weight: normal">Microsoft</B>.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>To put it in a nutshell, my mission is to help developers to solve and understand issues they may face with when they develop application targeting <B style="mso-bidi-font-weight: normal">Windows Platform</B>.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Following different kinds of issues&nbsp;you may encounter:<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><FONT face="Times New Roman"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>1)</SPAN><SPAN style="FONT-SIZE: 7pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>I developed an application to manage my electric train toy in <B style="mso-bidi-font-weight: normal">C++</B> that is using the PC’s serial port. I would like to migrate the application in <B style="mso-bidi-font-weight: normal">.NET</B>, I would like to know which class of the <B style="mso-bidi-font-weight: normal">.NET Framework</B> can be used? Is it possible to get any code samples and recommendation to do this?</SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><FONT face="Times New Roman"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT>&nbsp;</P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><FONT face="Times New Roman"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>2)</SPAN><SPAN style="FONT-SIZE: 7pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>My application uses <B style="mso-bidi-font-weight: normal">System.IO.Ports </B>classes from <B style="mso-bidi-font-weight: normal">.NET Framework</B>. It crashes when I any attempt to send data on serial <B style="mso-bidi-font-weight: normal">COM2</B> port is made, an unhandled exception is thrown even if I tried to handle exception with <B style="mso-bidi-font-weight: normal">Try/Catch</B> block. What causes the problem and how to get rid of it?</SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><FONT face="Times New Roman"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT>&nbsp;</P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><FONT face="Times New Roman"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>3)</SPAN><SPAN style="FONT-SIZE: 7pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>My <B style="mso-bidi-font-weight: normal">Win32</B> application that is supposed to run as service works perfectly well with <B style="mso-bidi-font-weight: normal">Windows XP</B> and <B style="mso-bidi-font-weight: normal">Windows Server 2003</B> but doesn’t seem to work correctly with Windows Vista. Any call to <B style="mso-bidi-font-weight: normal">CreateWindow()</B> API returns <B style="mso-bidi-font-weight: normal"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>ERROR_ACCESS_DENIED</B>. I need help to understand what is happening here and how I can have my application to work on <B style="mso-bidi-font-weight: normal">Windows Vista</B>.</SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><FONT face="Times New Roman"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></FONT>&nbsp;</P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><FONT face="Times New Roman"><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>4)</SPAN><SPAN style="FONT-SIZE: 7pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US>My application is based on<B> Framework .NET 3.5</B>, it seems to work properly on my test environment but once in production I noticed that the process’s memory usage was getting higher and higher with utilization. It looks like there is a memory leak somehow, but I am not able to find anything going wrong in my code. After two days the application hangs. How can I determine the root cause of this issue?<o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>You now have an overview of how Support Engineer may help you. I’m actually the first interface between developers outside <B style="mso-bidi-font-weight: normal">Microsoft</B> and <B style="mso-bidi-font-weight: normal">Windows</B> Product group, from bug discovery to the hotfix delivery.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>My team is specialized on a set of Windows Technologies : <B>Active Directory</B>, <B>ADAM</B>/<B>AZMAN</B>/<B>SNMP</B>/<B>RPC</B>, <B>Crypto</B> / <B>Certificates</B> / <B>Security</B>, <B>GINA</B> / <B>Credential providers</B>, <B>MSI</B>, <B>NT Services</B>, <B>PowerShell</B>, <B>Printing</B>, <B>Sockets</B> / <B>TCP</B> / <B>IP Helper</B>, <B>Terminal Services</B> / <B>RDP</B>, <B>User Dumps</B>, <B>Vista</B> / <B>UAC</B> / <B>Upgrade</B>, <B>Win 32 API</B>, <B>WMI</B>, <B>WSUS (Windows Update Service).</B><o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>I’ll mainly tell you about multiple aspects of developing for Windows whether it is native (<B style="mso-bidi-font-weight: normal">C/C++</B>) or managed (<B style="mso-bidi-font-weight: normal">C#/VB.NET</B>) code but also issues that I, my colleagues or any other developers frequently face with. You will find here how any of them have been solved and how they could have been avoided. <o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>As a conclusion, you will also find in this blog recommendations and hints about tools you can use as troubleshooting purpose, code samples, information relative to <B style="mso-bidi-font-weight: normal">Windows</B> technologies, my job, my team and more generally <B style="mso-bidi-font-weight: normal">Microsoft</B>.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>I’ll publish the posts in French, English, and maybe soon in Spanish. </FONT></SPAN><SPAN style="FONT-FAMILY: Wingdings; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-char-type: symbol; mso-symbol-font-family: Wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin" lang=EN-US><SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">J</SPAN></SPAN><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Please feel free to contact me if there are any topics you want to read about in that blog.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>I wish you a pleasant reading.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face=Calibri>Cheers,<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: FR; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-latin" lang=EN-US>--Michel</SPAN> </DIV>
<DIV style="DISPLAY: none" id=fr_1>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Bonjour à tous,<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Je suis Michel Molongo, ingénieur au support développement sur plateforme <B style="mso-bidi-font-weight: normal">Windows</B> depuis un peu plus d'un an chez <B style="mso-bidi-font-weight: normal">Microsoft EMEA</B> (Division Customer Service and Support). Je viens de créer ce blog afin de partager avec vous différentes expériences et sujets abordés lors de mon travail quotidien autour de <B style="mso-bidi-font-weight: normal">Windows</B>. C'est aussi une opportunité de présenter le métier méconnu d'ingénieur support au sein <B style="mso-bidi-font-weight: normal">Microsoft</B>.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>En quelques mots, mon métier consiste à aider les développeurs à résoudre les problèmes qu'ils rencontrent lors de leur développement d'application à destination de la plateforme <B style="mso-bidi-font-weight: normal">Windows</B>.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Les problèmes peuvent être de plusieurs natures, par exemple :<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face="Times New Roman">1) J'ai développé une application pour contrôler un train électrique en <B style="mso-bidi-font-weight: normal">C++</B> qui utilise le Port Série du PC. Je voudrais porter l'application en <B style="mso-bidi-font-weight: normal">.NET</B>, je voudrais savoir quelles classes du <SPAN style="mso-spacerun: yes">&nbsp;</SPAN><B style="mso-bidi-font-weight: normal">Framework .NET</B> utiliser ? S’il est possible d’avoir des exemples d’utilisation de la classe ?<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face="Times New Roman">&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face="Times New Roman">2) Mon application utilise les classes <B style="mso-bidi-font-weight: normal">System.IO.Ports</B> du <B style="mso-bidi-font-weight: normal">Framework .NET</B>, mon application crashe quand j'essaye d'envoyer des données sur le port série <B style="mso-bidi-font-weight: normal">COM2</B>, une exception non gérée est levée alors que j'ai encapsulé mon code dans le bloc <B style="mso-bidi-font-weight: normal">Try/Catch</B> qui convient pour gérer l’exception. Comment puis-je éviter ce problème?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><o:p><FONT face="Times New Roman">&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face="Times New Roman">3) Mon application <B style="mso-bidi-font-weight: normal">Win32</B> exécutée en tant que service fonctionne correctement sous <B style="mso-bidi-font-weight: normal">Windows XP</B> et <B style="mso-bidi-font-weight: normal">Windows Server 2003</B> mais ne semble pas fonctionner sous Windows Vista. L’appel à l’API <B style="mso-bidi-font-weight: normal">CreateWindow()</B> retourne la valeur <B style="mso-bidi-font-weight: normal">ERROR_ACCESS_DENIED</B>. Qu’est-ce qui peut poser ce problème ? Comment puis-je faire fonctionner l’application sous <B style="mso-bidi-font-weight: normal">Windows Vista</B> ?<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-add-space: auto" class=MsoNormalCxSpMiddle><SPAN style="FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin" lang=EN-US><FONT face="Times New Roman">4) Mon application utilise le <B style="mso-bidi-font-weight: normal">Framework .NET</B><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><STRONG>3.5</STRONG>, elle fonctionne parfaitement dans mon environnement de test, mais une fois en production j’ai remarqué que la mémoire utilisée par le processus augmentait avec le temps sans jamais être libérée. Je constate une fuite mémoire importante qui bloque l’application au bout de deux jours d’utilisation. Je voudrais de l’aide pour déterminer les causes de ce problème.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Vous avez maintenant un petit aperçu des problématiques rencontrées.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Je suis aussi la première interface avec les développeurs pour adresser des problèmes au groupe produit Windows, de la découverte d'un bug à la publication d'un correctif.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Mon équipe est spécialiste sur un ensemble de technologies Windows <B><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>Active Directory</B>, <B>ADAM</B>/<B>AZMAN</B>/<B>SNMP</B>/<B>RPC</B>, <B>Crypto</B> / <B>Certificates</B> / <B>Security</B>, <B>GINA</B> / <B>Credential providers</B>, <B>MSI</B>, <B>NT Services</B>, <B>PowerShell</B>, <B>Printing</B>, <B>Sockets</B> / <B>TCP</B> / <B>IP Helper</B>, <B>Terminal Services</B> / <B>RDP</B>, <B>User Dumps</B>, <B>Vista</B> / <B>UAC</B> / <B>Upgrade</B>, <B>Win 32 API</B>, <B>WMI</B>, <B>WSUS (Windows Update Service).</B><o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Je parlerai donc principalement de différents aspects du développement sous Windows que ce soit en code natif (<B style="mso-bidi-font-weight: normal">C/C++</B>) ou managé (<B style="mso-bidi-font-weight: normal">C#/VB.NET</B>) mais aussi des problèmes qui sont régulièrement rencontrés par moi-même mais aussi par d'autres (collègues, partenaires) auxquels j'ai pu m'intéresser. Vous saurez comment certains des problèmes ont pu être résolus et de manière général comment éviter de le retrouver. <o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Pour finir, vous trouverez aussi sur ce blog des recommandations sur les outils à utiliser afin d'essayer de trouver la source de vos problèmes, des exemples de code source, des informations utiles relatives à <B style="mso-bidi-font-weight: normal">Windows</B>, aux technologies qui s’y associent, mon métier, mon équipe et <B style="mso-bidi-font-weight: normal">Microsoft</B> en général.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Je tâcherai de publier l'ensemble des articles en français, en anglais et dans un futur plus ou moins proche en espagnol :-)<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>N'hésitez pas à me contacter s'il y a des articles qui n'ont pas été clairs ou s'il y a des sujets que vous souhaiteriez voir abordés sur ce blog.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><FONT face=Calibri>Je vous souhaite une excellente lecture.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-fareast-language: FR; mso-bidi-theme-font: minor-latin"><o:p><FONT face=Calibri>&nbsp;</FONT></o:p></SPAN></P><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 12pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: FR; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-latin" lang=EN-US>--Michel</SPAN> </DIV>]]></content:encoded>
    </item>
  </channel>
</rss>