NT4/private/ntos/dd/pcmcia/cmd/noinput/noinput.c
2020-09-30 17:12:29 +02:00

94 lines
1.4 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
pcmcmd.c
Abstract:
This program converses with the PCMCIA support driver to display
tuple and other information.
Author:
Bob Rinne
Environment:
User process.
Notes:
Revision History:
--*/
#include <stdio.h>
#include <windows.h>
#include <winioctl.h>
#include <ntddpcm.h>
//
// Constants
//
#define PCMCIA_DEVICE_NAME "\\\\.\\Pcmcia0"
#define BUFFER_SIZE 4096
//
// Procedures
//
int _CRTAPI1
main(
int argc,
char *argv[]
)
/*++
Routine Description:
Arguments:
Return Value:
--*/
{
HANDLE handle;
ULONG returnValue;
handle = CreateFile(PCMCIA_DEVICE_NAME,
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
if (handle == INVALID_HANDLE_VALUE) {
printf("Open failed (%d)\n", GetLastError());
return 1;
}
if (!DeviceIoControl(handle,
IOCTL_PCMCIA_CONFIGURATION,
NULL,
0,
NULL,
0,
&returnValue,
NULL)) {
printf("Ioctl failed (%d)\n", GetLastError());
return 2;
}
CloseHandle(handle);
return 0;
}