File:  [WindowsNT SDKs] / q_a / samples / ddk / simple / gethndl.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 18:30:32 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: ntsdk-nov-1993, HEAD
Microsoft Windows NT Build 511 (DDK SDK) 11-01-1993


#include "windows.h"
#include "stdio.h"

int main(int argc, char **argv) {


    HANDLE hTest;


    if ((hTest = CreateFile(
                     "\\\\.\\LOADTEST",
                     GENERIC_READ | GENERIC_WRITE,
                     0,
                     NULL,
                     OPEN_EXISTING,
                     FILE_ATTRIBUTE_NORMAL,
                     NULL
                     )) != ((HANDLE)-1)) {

        printf("Wow - it really worked!!!\n");

        //
        // Point proven.  Be a nice program and close up shop.
        //

        CloseHandle(hTest);

    } else {

        printf("Can't get a handle to LOADTEST\n");

    }

    return 1;

}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.