GetTempFileName() causes crush

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JoderCoder
    New Member
    • Feb 2008
    • 18

    GetTempFileName() causes crush

    Hello, i have an application which I am investigating the crush dump for. The application is supposed to create a tmp file under C:\DOCUME~1\<us ername>\LOCALS~ 1\Temp\

    The API called is GetTempFileName ()

    Code:
    GetTempFileName(lpPathBuffer, TEXT("NEW"), 0, szTempName);
    I made sure lpPathBuffer is correct (C:\DOCUME~1\<u sername>\LOCALS ~1\Temp\). The function NEVER returns 0, which is supposed to mean that a unique tmp file is created under C:\DOCUME~1\<us ername>\LOCALS~ 1\Temp\. However, in the crush dump szTempName is 0x035801cf <Bad Ptr>. In a working scenario, szTempName is something like 0x00f32968 "C:\DOCUME~1\<u sername>\LOCALS ~1\Temp\NEWE075 .tmp"

    Any idea why szTempName did get a bad value i.e. 0x035801cf <Bad Ptr> for the crush scenario? Any thought shared is really appreciated.
Working...