ReactOS 0.4.15-dev-7846-g8ba6c66
autodial.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Winsock 2 SPI
4 * FILE: lib/mswsock/lib/init.c
5 * PURPOSE: DLL Initialization
6 */
7
8#include "precomp.h"
9
10#include <ndk/iofuncs.h>
11#include <ndk/rtltypes.h>
12
13/* FUNCTIONS *****************************************************************/
14
18{
19 UNICODE_STRING DriverName = RTL_CONSTANT_STRING(L"\\Device\\RasAcd");
25
26 /* Initialize the object attributes */
28 &DriverName,
30 NULL,
31 NULL);
32
33 /* Open a handle to it */
38 NULL,
42 0,
43 NULL,
44 0);
45 if (!NT_SUCCESS(Status)) return FALSE;
46
47 /* Create an event */
49 if (!EventHandle)
50 {
51 /* Event failed, fail us */
53 return FALSE;
54 }
55
56 /* Connect to the driver */
59 NULL,
60 NULL,
63 Command,
64 sizeof(AUTODIAL_COMMAND),
65 NULL,
66 0);
67
68 /* Check if we need to wait */
70 {
71 /* Wait for the driver */
73
74 /* Update status */
76 }
77
78 /* Close handles and return */
81 return NT_SUCCESS(Status);
82}
83
84/*
85 * @implemented
86 */
90{
92
93 /* Clear the command packet */
95
96 /* Copy the address into the command packet */
97 RtlCopyMemory(&Command.Address, ConnectionAddress, sizeof(AUTODIAL_ADDR));
98
99 /* Send it to the driver */
100 return AcsHlpSendCommand(&Command);
101}
102
103/*
104 * @implemented
105 */
107WINAPI
109 IN PAUTODIAL_CONN Connection)
110{
112
113 /* Copy the address into the command packet */
114 RtlCopyMemory(&Command.Address, ConnectionAddress, sizeof(AUTODIAL_ADDR));
115
116 /* Set the New Connection flag and copy the connection data */
117 Command.NewConnection = TRUE;
118 RtlCopyMemory(&Command.Connection, Connection, sizeof(AUTODIAL_CONN));
119
120 /* Send it to the driver */
121 return AcsHlpSendCommand(&Command);
122}
static NDIS_HANDLE DriverHandle
unsigned char BOOLEAN
BOOLEAN WINAPI AcsHlpAttemptConnection(IN PAUTODIAL_ADDR ConnectionAddress)
Definition: autodial.c:89
BOOLEAN WINAPI AcsHlpSendCommand(IN PAUTODIAL_COMMAND Command)
Definition: autodial.c:17
BOOLEAN WINAPI AcsHlpNoteNewConnection(IN PAUTODIAL_ADDR ConnectionAddress, IN PAUTODIAL_CONN Connection)
Definition: autodial.c:108
LONG NTSTATUS
Definition: precomp.h:26
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define CloseHandle
Definition: compat.h:739
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
#define IOCTL_ACD_CONNECT_ADDRESS
Definition: precomp.h:34
#define INFINITE
Definition: serial.h:102
#define FILE_OPEN_IF
Definition: from_kernel.h:56
Status
Definition: gdiplustypes.h:25
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_WRITE_DATA
Definition: nt_native.h:631
#define FILE_READ_DATA
Definition: nt_native.h:628
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
#define STATUS_PENDING
Definition: ntstatus.h:82
#define L(x)
Definition: ntvdm.h:50
Definition: shell.h:41
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
#define CreateEvent
Definition: winbase.h:3683
#define WINAPI
Definition: msvc.h:6
_Out_ PHANDLE EventHandle
Definition: iofuncs.h:857