if (NS_SUCCEEDED(supports->QueryInterface(nsCOMTypeInfo<nsIOutputStream>::GetIID(), (void**)&outStr))) {
if (NS_SUCCEEDED(supports->QueryInterface(NS_GET_IID(nsIOutputStream), (void**)&outStr))) {
NS_COM nsresult NS_NewTypicalOutputFileStream(    nsISupports** aResult,    const nsFileSpec& inFile    /*default nsprMode= (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE)*/    /*Default accessMode= 0700 (octal)*/)// Factory method to get an nsOutputStream to a file - most common case.//----------------------------------------------------------------------------------------{  // This QueryInterface was needed because NS_NewIOFileStream  // does a cast from (void *) to (nsISupports *) thus causing a   // vtable problem on Windows, where we really didn't have the proper pointer  // to an nsIOutputStream, this ensures that we do #if 1/*    nsISupports     * supports;    nsIOutputStream * outStr;    nsresult rv = NS_NewIOFileStream(        &supports,        inFile,        (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE),        0700);    *aResult = nsnull;    if (NS_SUCCEEDED(rv)) {       if (NS_SUCCEEDED(supports->QueryInterface(nsCOMTypeInfo<nsIOutputStream>::GetIID(), (void**)&outStr))) {        *aResult = outStr;      }      NS_RELEASE(supports);    }    return rv;    */    nsCOMPtr<nsISupports> supports;    nsIOutputStream * outStr;    nsresult rv = NS_NewIOFileStream(        getter_AddRefs(supports),        inFile,        (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE),        0700);    *aResult = nsnull;    if (NS_SUCCEEDED(rv)) {       if (NS_SUCCEEDED(supports->QueryInterface(nsCOMTypeInfo<nsIOutputStream>::GetIID(), (void**)&outStr))) {        *aResult = outStr;      }    }    return rv;#else    return NS_NewIOFileStream(        aResult,        inFile,        (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE),        0700);#endif}