Hello, I have an MFC program that access a file in the samba (3.0.10) share with the following code.
CString strSearchPath = _T("\\\\TestServer\\TestShare\\tempfile.txt"); CStdioFile fValueFile; if( !fValueFile.Open(strSearchPath,CFile::modeReadWrite ) ) { cout<<GetLastError()<<endl; } else { cout<<"Opened"<<endl; } //CloseHandle( (HANDLE)fValueFile.m_hFile ); fValueFile.Close(); If i run this code on a Windows 2003 server, it leaves one HANDLE open. but if i try this operation from a windows XP ( with SP2) machine, every thing is fine. Also this leak seems to happen only for a samba share. If the "strSearchPath" is replaced with a Windows share, there is no leak. Number of files opened by our application is quite large and so may handles ( in 1000s ) are held up by the application. With the help of procexp utility i found that the handle used was a file handle (\\TestServer\\TestShare\ wrt to the sample code above. file name was not shown). Did any one face a similar problem? Any idea whether this problem is Samba related (since this happens only for samba shares) ? Any help/pionter in this regard will be of great help. With best regards, Kiran PS: My smb.conf is given below [global] workgroup = NMUSOL netbios name = TestServer interfaces = 132.186.71.238 bind interfaces only = Yes security = DOMAIN password server = 132.186.70.122 log level = 2 ldap ssl = no kernel oplocks = no [TestShare] path = /export/home1/TestShare read only = No oplocks = no strict locking = yes level2 oplocks = no -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba