blob: cde9457f0e7af51d05016dcf9556d31c9547494d [file] [log] [blame] [raw]
#include <windows.h>
#include <nt.h>
//#include <errno.h>
int unlink(const char *name) {
UNICODE_STRING name1;
RtlCreateUnicodeStringFromAsciiz(&name1, name);
// TODO: Convert the UNIX path name to NT style
OBJECT_ATTRIBUTES o = { sizeof(OBJECT_ATTRIBUTES), NULL, &name1, 0, NULL, NULL };
long int status = NtDeleteFile(&o);
RtlFreeUnicodeString(&name1);
//return ((errno = ntstatus_to_errno(status)) ? -1 : 0;
return status ? -1 : 0;
}