I'm integrating my application so that it can edit files stored in SharePoint. I'm using the Web Client service AKA WebDAV Redirector(webclnt.dll) which does a wonderful job of letting the normal CreateFile/read/write Windows api calls be redirected from their normal drive I/O path out to the network via WebDAV. However, I can only get read-only access to the file if it's checked in.
Using the Web Client service, how can I cause the file to be checked out when I edit it, and then cause it to be checked in when I'm finished editing it?
Edit: I tried using the GetFileAttributes and SetFileAttributes to test for FILE_ATTRIBUTE_READONLY, hoping that I could use that flag to determine when the file was not checked out, and then to check it out (by unsetting that flag to check out, then setting it to check it in). No luck there; the file always appears as not read-only.