Exemple #1
0
/*
 * @implemented
 */
NTSTATUS
GlobalDeleteSymbolicLink(IN PUNICODE_STRING DosName)
{
    NTSTATUS Status;
    UNICODE_STRING GlobalName;

    /* Recreate the string (to find the link) */
    Status = CreateStringWithGlobal(DosName, &GlobalName);
    if (!NT_SUCCESS(Status))
    {
        return Status;
    }

    /* And delete the link */
    Status = IoDeleteSymbolicLink(&GlobalName);

    FreePool(GlobalName.Buffer);

    return Status;
}
Exemple #2
0
/*
 * @implemented
 */
NTSTATUS
GlobalCreateSymbolicLink(IN PUNICODE_STRING DosName,
                         IN PUNICODE_STRING DeviceName)
{
    NTSTATUS Status;
    UNICODE_STRING GlobalName;

    /* First create the global string */
    Status = CreateStringWithGlobal(DosName, &GlobalName);
    if (!NT_SUCCESS(Status))
    {
        return Status;
    }

    /* Then, create the symlink */
    Status = IoCreateSymbolicLink(&GlobalName, DosName);

    FreePool(GlobalName.Buffer);

    return Status;
}