@bun-win32/rasapi32 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI.md +71 -0
- package/README.md +67 -0
- package/index.ts +4 -0
- package/package.json +63 -0
- package/structs/Rasapi32.ts +607 -0
- package/types/Rasapi32.ts +48 -0
package/AI.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# AI Guide for @bun-win32/rasapi32
|
|
2
|
+
|
|
3
|
+
How to use this package, not what the Win32 API does.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import Rasapi32, { SomeFlag } from '@bun-win32/rasapi32';
|
|
9
|
+
|
|
10
|
+
// Methods bind lazily on first call
|
|
11
|
+
const result = Rasapi32.SomeFunctionW(arg1, arg2);
|
|
12
|
+
|
|
13
|
+
// Preload: array, single string, or no args (all symbols)
|
|
14
|
+
Rasapi32.Preload(['SomeFunctionW', 'AnotherFunction']);
|
|
15
|
+
Rasapi32.Preload('SomeFunctionW');
|
|
16
|
+
Rasapi32.Preload();
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Where To Look
|
|
20
|
+
|
|
21
|
+
| Need | Read |
|
|
22
|
+
| --------------------------------- | --------------------- |
|
|
23
|
+
| Find a method or its MS Docs link | `structs/Rasapi32.ts` |
|
|
24
|
+
| Find types, enums, constants | `types/Rasapi32.ts` |
|
|
25
|
+
| Quick examples | `README.md` |
|
|
26
|
+
|
|
27
|
+
`index.ts` re-exports the class and all types — import from `@bun-win32/rasapi32` directly.
|
|
28
|
+
|
|
29
|
+
## Calling Convention
|
|
30
|
+
|
|
31
|
+
All documented `rasapi32.dll` exports are bound. Each method maps 1:1 to its DLL export. Names, parameter names, and order match Microsoft Docs.
|
|
32
|
+
|
|
33
|
+
### Strings
|
|
34
|
+
|
|
35
|
+
`W` methods take UTF-16LE NUL-terminated buffers. `A` methods take ANSI strings.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const wide = Buffer.from('Hello\0', 'utf16le'); // LPCWSTR
|
|
39
|
+
Rasapi32.SomeFunctionW(wide.ptr);
|
|
40
|
+
|
|
41
|
+
// Reading a wide string back from a buffer:
|
|
42
|
+
const text = new TextDecoder('utf-16').decode(buf).replace(/\0.*$/, '');
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Return types
|
|
46
|
+
|
|
47
|
+
- `HANDLE`, `HWND`, etc. → `bigint`
|
|
48
|
+
- `DWORD`, `UINT`, `BOOL`, `INT`, `LONG` → `number`
|
|
49
|
+
- `LPVOID`, `LPWSTR`, etc. → `Pointer`
|
|
50
|
+
- Win32 `BOOL` is `number` (0 or non-zero), **not** JS `boolean`. Do not compare with `=== true`.
|
|
51
|
+
|
|
52
|
+
### Pointers, handles, out-parameters
|
|
53
|
+
|
|
54
|
+
- **Pointer** params (`LP*`, `P*`, `Pointer`): pass `buffer.ptr` from a caller-allocated `Buffer`.
|
|
55
|
+
- **Handle** params (`HANDLE`, `HWND`, etc.): pass a `bigint` value.
|
|
56
|
+
- **Out-parameters**: allocate a `Buffer`, pass `.ptr`, read the result after the call.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
const out = Buffer.alloc(4);
|
|
60
|
+
Rasapi32.SomeFunction(out.ptr);
|
|
61
|
+
const value = out.readUInt32LE(0);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Nullability
|
|
65
|
+
|
|
66
|
+
- `| NULL` in a signature → pass `null` (optional pointer).
|
|
67
|
+
- `| 0n` in a signature → pass `0n` (optional handle).
|
|
68
|
+
|
|
69
|
+
## Errors and Cleanup
|
|
70
|
+
|
|
71
|
+
Return values are raw. If the Win32 function uses last-error semantics, read via `GetLastError()`. Resource cleanup is your responsibility — same as raw Win32.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @bun-win32/rasapi32
|
|
2
|
+
|
|
3
|
+
Zero-dependency, zero-overhead Win32 Rasapi32 bindings for [Bun](https://bun.sh) on Windows.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`@bun-win32/rasapi32` exposes the `rasapi32.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Rasapi32`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.
|
|
8
|
+
|
|
9
|
+
The bindings are strongly typed for a smooth DX in TypeScript.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.
|
|
14
|
+
- Direct FFI to `rasapi32.dll` (RAS dial-up, VPN, phonebook entries, connection management, projection info, and statistics).
|
|
15
|
+
- In-source docs in `structs/Rasapi32.ts` with links to Microsoft Docs.
|
|
16
|
+
- Lazy binding on first call; optional eager preload (`Rasapi32.Preload()`).
|
|
17
|
+
- No wrapper overhead; calls map 1:1 to native APIs.
|
|
18
|
+
- Strongly-typed Win32 aliases (see `types/Rasapi32.ts`).
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- [Bun](https://bun.sh) runtime
|
|
23
|
+
- Windows 10 or later
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
bun add @bun-win32/rasapi32
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import Rasapi32 from '@bun-win32/rasapi32';
|
|
35
|
+
|
|
36
|
+
// Optionally bind a subset up-front
|
|
37
|
+
Rasapi32.Preload(['RasEnumConnectionsW', 'RasGetErrorStringW']);
|
|
38
|
+
|
|
39
|
+
// How many RAS (dial-up/VPN) connections are active right now?
|
|
40
|
+
const cb = Buffer.alloc(4);
|
|
41
|
+
const count = Buffer.alloc(4);
|
|
42
|
+
// First call with a NULL buffer: a return of 0 with count 0 means none active.
|
|
43
|
+
Rasapi32.RasEnumConnectionsW(null, cb.ptr, count.ptr);
|
|
44
|
+
console.log('Active RAS connections: %d', count.readUInt32LE(0));
|
|
45
|
+
|
|
46
|
+
// Translate a RAS error code (691 = bad username/password) to a message.
|
|
47
|
+
const msg = Buffer.alloc(512);
|
|
48
|
+
Rasapi32.RasGetErrorStringW(691, msg.ptr, 256);
|
|
49
|
+
console.log(new TextDecoder('utf-16le').decode(msg).replace(/\0.*$/, ''));
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> [!NOTE]
|
|
53
|
+
> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
Run the included examples:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
bun run example:dialup-screech # Animated retro dial-up handshake visualizer
|
|
61
|
+
bun run example:ras-diagnostic # Full RAS subsystem diagnostic report
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Notes
|
|
65
|
+
|
|
66
|
+
- Either rely on lazy binding or call `Rasapi32.Preload()`.
|
|
67
|
+
- Windows only. Bun runtime required.
|
package/index.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Stev Peifer <stev@bell.net>",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/ObscuritySRL/bun-win32/issues"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@bun-win32/core": "1.1.2"
|
|
8
|
+
},
|
|
9
|
+
"description": "Zero-dependency, zero-overhead Win32 RASAPI32 bindings for Bun (FFI) on Windows.",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@bun-win32/kernel32": "1.0.21",
|
|
12
|
+
"@types/bun": "latest"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./index.ts"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"module": "index.ts",
|
|
19
|
+
"name": "@bun-win32/rasapi32",
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"typescript": "^5"
|
|
22
|
+
},
|
|
23
|
+
"private": false,
|
|
24
|
+
"homepage": "https://github.com/ObscuritySRL/bun-win32#readme",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git://github.com/ObscuritySRL/bun-win32.git",
|
|
28
|
+
"directory": "packages/rasapi32"
|
|
29
|
+
},
|
|
30
|
+
"type": "module",
|
|
31
|
+
"version": "1.0.0",
|
|
32
|
+
"main": "./index.ts",
|
|
33
|
+
"keywords": [
|
|
34
|
+
"bun",
|
|
35
|
+
"ffi",
|
|
36
|
+
"win32",
|
|
37
|
+
"windows",
|
|
38
|
+
"rasapi32",
|
|
39
|
+
"bindings",
|
|
40
|
+
"typescript",
|
|
41
|
+
"dll",
|
|
42
|
+
"ras",
|
|
43
|
+
"vpn",
|
|
44
|
+
"dial-up",
|
|
45
|
+
"phonebook",
|
|
46
|
+
"networking"
|
|
47
|
+
],
|
|
48
|
+
"files": [
|
|
49
|
+
"AI.md",
|
|
50
|
+
"README.md",
|
|
51
|
+
"index.ts",
|
|
52
|
+
"structs/*.ts",
|
|
53
|
+
"types/*.ts"
|
|
54
|
+
],
|
|
55
|
+
"sideEffects": false,
|
|
56
|
+
"engines": {
|
|
57
|
+
"bun": ">=1.1.0"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"example:dialup-screech": "bun ./example/dialup-screech.ts",
|
|
61
|
+
"example:ras-diagnostic": "bun ./example/ras-diagnostic.ts"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
import { type FFIFunction, FFIType } from 'bun:ffi';
|
|
2
|
+
|
|
3
|
+
import { Win32 } from '@bun-win32/core';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
BOOL,
|
|
7
|
+
DWORD,
|
|
8
|
+
HANDLE,
|
|
9
|
+
HRASCONN,
|
|
10
|
+
HWND,
|
|
11
|
+
LPBOOL,
|
|
12
|
+
LPBYTE,
|
|
13
|
+
LPCSTR,
|
|
14
|
+
LPCWSTR,
|
|
15
|
+
LPDWORD,
|
|
16
|
+
LPHRASCONN,
|
|
17
|
+
LPRASAUTODIALENTRYA,
|
|
18
|
+
LPRASAUTODIALENTRYW,
|
|
19
|
+
LPRASCONNA,
|
|
20
|
+
LPRASCONNSTATUSA,
|
|
21
|
+
LPRASCONNSTATUSW,
|
|
22
|
+
LPRASCONNW,
|
|
23
|
+
LPRASCREDENTIALSA,
|
|
24
|
+
LPRASCREDENTIALSW,
|
|
25
|
+
LPRASCTRYINFOA,
|
|
26
|
+
LPRASCTRYINFOW,
|
|
27
|
+
LPRASDEVINFOA,
|
|
28
|
+
LPRASDEVINFOW,
|
|
29
|
+
LPRASDIALEXTENSIONS,
|
|
30
|
+
LPRASDIALPARAMSA,
|
|
31
|
+
LPRASDIALPARAMSW,
|
|
32
|
+
LPRASEAPUSERIDENTITYA,
|
|
33
|
+
LPRASEAPUSERIDENTITYW,
|
|
34
|
+
LPRASENTRYA,
|
|
35
|
+
LPRASENTRYNAMEA,
|
|
36
|
+
LPRASENTRYNAMEW,
|
|
37
|
+
LPRASENTRYW,
|
|
38
|
+
LPRASNAPSTATE,
|
|
39
|
+
LPRASSUBENTRYA,
|
|
40
|
+
LPRASSUBENTRYW,
|
|
41
|
+
LPRASUPDATECONN,
|
|
42
|
+
LPRAS_STATS,
|
|
43
|
+
LPSTR,
|
|
44
|
+
LPVOID,
|
|
45
|
+
LPWSTR,
|
|
46
|
+
NULL,
|
|
47
|
+
PLPRASEAPUSERIDENTITYA,
|
|
48
|
+
PLPRASEAPUSERIDENTITYW,
|
|
49
|
+
PLPSTR,
|
|
50
|
+
PLPWSTR,
|
|
51
|
+
PRAS_PROJECTION_INFO,
|
|
52
|
+
RASPROJECTION,
|
|
53
|
+
UINT,
|
|
54
|
+
VOID,
|
|
55
|
+
} from '../types/Rasapi32';
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Thin, lazy-loaded FFI bindings for `rasapi32.dll`.
|
|
59
|
+
*
|
|
60
|
+
* Each static method corresponds one-to-one with a Win32 export declared in `Symbols`.
|
|
61
|
+
* The first call to a method binds the underlying native symbol via `bun:ffi` and
|
|
62
|
+
* memoizes it on the class for subsequent calls. For bulk, up-front binding, use `Preload`.
|
|
63
|
+
*
|
|
64
|
+
* Symbols are defined with explicit `FFIType` signatures and kept alphabetized.
|
|
65
|
+
* You normally do not access `Symbols` directly; call the static methods or preload
|
|
66
|
+
* a subset for hot paths.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* import Rasapi32 from './structs/Rasapi32';
|
|
71
|
+
*
|
|
72
|
+
* // Lazy: bind on first call
|
|
73
|
+
* const result = Rasapi32.RasEnumConnectionsW(null, lpcb.ptr, lpcConnections.ptr);
|
|
74
|
+
*
|
|
75
|
+
* // Or preload a subset to avoid per-symbol lazy binding cost
|
|
76
|
+
* Rasapi32.Preload(['RasEnumConnectionsW', 'RasGetConnectStatusW']);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
class Rasapi32 extends Win32 {
|
|
80
|
+
protected static override name = 'rasapi32.dll';
|
|
81
|
+
|
|
82
|
+
/** @inheritdoc */
|
|
83
|
+
protected static override readonly Symbols = {
|
|
84
|
+
RasClearConnectionStatistics: { args: [FFIType.u64], returns: FFIType.u32 },
|
|
85
|
+
RasClearLinkStatistics: { args: [FFIType.u64, FFIType.u32], returns: FFIType.u32 },
|
|
86
|
+
RasConnectionNotificationA: { args: [FFIType.u64, FFIType.u64, FFIType.u32], returns: FFIType.u32 },
|
|
87
|
+
RasConnectionNotificationW: { args: [FFIType.u64, FFIType.u64, FFIType.u32], returns: FFIType.u32 },
|
|
88
|
+
RasCreatePhonebookEntryA: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
89
|
+
RasCreatePhonebookEntryW: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
90
|
+
RasDeleteEntryA: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
91
|
+
RasDeleteEntryW: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
92
|
+
RasDeleteSubEntryA: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
93
|
+
RasDeleteSubEntryW: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
94
|
+
RasDialA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
95
|
+
RasDialW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
96
|
+
RasEditPhonebookEntryA: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
97
|
+
RasEditPhonebookEntryW: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
98
|
+
RasEnumAutodialAddressesA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
99
|
+
RasEnumAutodialAddressesW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
100
|
+
RasEnumConnectionsA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
101
|
+
RasEnumConnectionsW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
102
|
+
RasEnumDevicesA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
103
|
+
RasEnumDevicesW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
104
|
+
RasEnumEntriesA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
105
|
+
RasEnumEntriesW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
106
|
+
RasFreeEapUserIdentityA: { args: [FFIType.ptr], returns: FFIType.void },
|
|
107
|
+
RasFreeEapUserIdentityW: { args: [FFIType.ptr], returns: FFIType.void },
|
|
108
|
+
RasGetAutodialAddressA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
109
|
+
RasGetAutodialAddressW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
110
|
+
RasGetAutodialEnableA: { args: [FFIType.u32, FFIType.ptr], returns: FFIType.u32 },
|
|
111
|
+
RasGetAutodialEnableW: { args: [FFIType.u32, FFIType.ptr], returns: FFIType.u32 },
|
|
112
|
+
RasGetAutodialParamA: { args: [FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
113
|
+
RasGetAutodialParamW: { args: [FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
114
|
+
RasGetConnectStatusA: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
115
|
+
RasGetConnectStatusW: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
116
|
+
RasGetConnectionStatistics: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
117
|
+
RasGetCountryInfoA: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
118
|
+
RasGetCountryInfoW: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
119
|
+
RasGetCredentialsA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
120
|
+
RasGetCredentialsW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
121
|
+
RasGetCustomAuthDataA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
122
|
+
RasGetCustomAuthDataW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
123
|
+
RasGetEapUserDataA: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
124
|
+
RasGetEapUserDataW: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
125
|
+
RasGetEapUserIdentityA: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
126
|
+
RasGetEapUserIdentityW: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
127
|
+
RasGetEntryDialParamsA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
128
|
+
RasGetEntryDialParamsW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
129
|
+
RasGetEntryPropertiesA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
130
|
+
RasGetEntryPropertiesW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
131
|
+
RasGetErrorStringA: { args: [FFIType.u32, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
132
|
+
RasGetErrorStringW: { args: [FFIType.u32, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
133
|
+
RasGetLinkStatistics: { args: [FFIType.u64, FFIType.u32, FFIType.ptr], returns: FFIType.u32 },
|
|
134
|
+
RasGetNapStatus: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
135
|
+
RasGetProjectionInfoA: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
136
|
+
RasGetProjectionInfoEx: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
137
|
+
RasGetProjectionInfoW: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
138
|
+
RasGetSubEntryHandleA: { args: [FFIType.u64, FFIType.u32, FFIType.ptr], returns: FFIType.u32 },
|
|
139
|
+
RasGetSubEntryHandleW: { args: [FFIType.u64, FFIType.u32, FFIType.ptr], returns: FFIType.u32 },
|
|
140
|
+
RasGetSubEntryPropertiesA: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
141
|
+
RasGetSubEntryPropertiesW: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
142
|
+
RasHangUpA: { args: [FFIType.u64], returns: FFIType.u32 },
|
|
143
|
+
RasHangUpW: { args: [FFIType.u64], returns: FFIType.u32 },
|
|
144
|
+
RasInvokeEapUI: { args: [FFIType.u64, FFIType.u32, FFIType.ptr, FFIType.u64], returns: FFIType.u32 },
|
|
145
|
+
RasRenameEntryA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
146
|
+
RasRenameEntryW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
147
|
+
RasSetAutodialAddressA: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32, FFIType.u32], returns: FFIType.u32 },
|
|
148
|
+
RasSetAutodialAddressW: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32, FFIType.u32], returns: FFIType.u32 },
|
|
149
|
+
RasSetAutodialEnableA: { args: [FFIType.u32, FFIType.i32], returns: FFIType.u32 },
|
|
150
|
+
RasSetAutodialEnableW: { args: [FFIType.u32, FFIType.i32], returns: FFIType.u32 },
|
|
151
|
+
RasSetAutodialParamA: { args: [FFIType.u32, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
152
|
+
RasSetAutodialParamW: { args: [FFIType.u32, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
153
|
+
RasSetCredentialsA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32], returns: FFIType.u32 },
|
|
154
|
+
RasSetCredentialsW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32], returns: FFIType.u32 },
|
|
155
|
+
RasSetCustomAuthDataA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
156
|
+
RasSetCustomAuthDataW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
157
|
+
RasSetEapUserDataA: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
158
|
+
RasSetEapUserDataW: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
159
|
+
RasSetEntryDialParamsA: { args: [FFIType.ptr, FFIType.ptr, FFIType.i32], returns: FFIType.u32 },
|
|
160
|
+
RasSetEntryDialParamsW: { args: [FFIType.ptr, FFIType.ptr, FFIType.i32], returns: FFIType.u32 },
|
|
161
|
+
RasSetEntryPropertiesA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
162
|
+
RasSetEntryPropertiesW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
163
|
+
RasSetSubEntryPropertiesA: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
164
|
+
RasSetSubEntryPropertiesW: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
165
|
+
RasUpdateConnection: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u32 },
|
|
166
|
+
RasValidateEntryNameA: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
167
|
+
RasValidateEntryNameW: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
168
|
+
} as const satisfies Record<string, FFIFunction>;
|
|
169
|
+
|
|
170
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasclearconnectionstatistics
|
|
171
|
+
public static RasClearConnectionStatistics(hRasConn: HRASCONN): DWORD {
|
|
172
|
+
return Rasapi32.Load('RasClearConnectionStatistics')(hRasConn);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasclearlinkstatistics
|
|
176
|
+
public static RasClearLinkStatistics(hRasConn: HRASCONN, dwSubEntry: DWORD): DWORD {
|
|
177
|
+
return Rasapi32.Load('RasClearLinkStatistics')(hRasConn, dwSubEntry);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasconnectionnotificationa
|
|
181
|
+
public static RasConnectionNotificationA(hrasconn: HRASCONN, hEvent: HANDLE, dwFlags: DWORD): DWORD {
|
|
182
|
+
return Rasapi32.Load('RasConnectionNotificationA')(hrasconn, hEvent, dwFlags);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasconnectionnotificationw
|
|
186
|
+
public static RasConnectionNotificationW(hrasconn: HRASCONN, hEvent: HANDLE, dwFlags: DWORD): DWORD {
|
|
187
|
+
return Rasapi32.Load('RasConnectionNotificationW')(hrasconn, hEvent, dwFlags);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rascreatephonebookentrya
|
|
191
|
+
public static RasCreatePhonebookEntryA(hwnd: HWND, lpszPhonebook: LPCSTR | NULL): DWORD {
|
|
192
|
+
return Rasapi32.Load('RasCreatePhonebookEntryA')(hwnd, lpszPhonebook);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rascreatephonebookentryw
|
|
196
|
+
public static RasCreatePhonebookEntryW(hwnd: HWND, lpszPhonebook: LPCWSTR | NULL): DWORD {
|
|
197
|
+
return Rasapi32.Load('RasCreatePhonebookEntryW')(hwnd, lpszPhonebook);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasdeleteentrya
|
|
201
|
+
public static RasDeleteEntryA(lpszPhonebook: LPCSTR | NULL, lpszEntry: LPCSTR): DWORD {
|
|
202
|
+
return Rasapi32.Load('RasDeleteEntryA')(lpszPhonebook, lpszEntry);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasdeleteentryw
|
|
206
|
+
public static RasDeleteEntryW(lpszPhonebook: LPCWSTR | NULL, lpszEntry: LPCWSTR): DWORD {
|
|
207
|
+
return Rasapi32.Load('RasDeleteEntryW')(lpszPhonebook, lpszEntry);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasdeletesubentrya
|
|
211
|
+
public static RasDeleteSubEntryA(pszPhonebook: LPCSTR | NULL, pszEntry: LPCSTR, dwSubentryId: DWORD): DWORD {
|
|
212
|
+
return Rasapi32.Load('RasDeleteSubEntryA')(pszPhonebook, pszEntry, dwSubentryId);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasdeletesubentryw
|
|
216
|
+
public static RasDeleteSubEntryW(pszPhonebook: LPCWSTR | NULL, pszEntry: LPCWSTR, dwSubEntryId: DWORD): DWORD {
|
|
217
|
+
return Rasapi32.Load('RasDeleteSubEntryW')(pszPhonebook, pszEntry, dwSubEntryId);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasdiala
|
|
221
|
+
public static RasDialA(lpRasDialExtensions: LPRASDIALEXTENSIONS | NULL, lpszPhonebook: LPCSTR | NULL, lpRasDialParams: LPRASDIALPARAMSA, dwNotifierType: DWORD, lpvNotifier: LPVOID | NULL, lphRasConn: LPHRASCONN): DWORD {
|
|
222
|
+
return Rasapi32.Load('RasDialA')(lpRasDialExtensions, lpszPhonebook, lpRasDialParams, dwNotifierType, lpvNotifier, lphRasConn);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasdialw
|
|
226
|
+
public static RasDialW(lpRasDialExtensions: LPRASDIALEXTENSIONS | NULL, lpszPhonebook: LPCWSTR | NULL, lpRasDialParams: LPRASDIALPARAMSW, dwNotifierType: DWORD, lpvNotifier: LPVOID | NULL, lphRasConn: LPHRASCONN): DWORD {
|
|
227
|
+
return Rasapi32.Load('RasDialW')(lpRasDialExtensions, lpszPhonebook, lpRasDialParams, dwNotifierType, lpvNotifier, lphRasConn);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-raseditphonebookentrya
|
|
231
|
+
public static RasEditPhonebookEntryA(hwnd: HWND, lpszPhonebook: LPCSTR | NULL, lpszEntry: LPCSTR): DWORD {
|
|
232
|
+
return Rasapi32.Load('RasEditPhonebookEntryA')(hwnd, lpszPhonebook, lpszEntry);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-raseditphonebookentryw
|
|
236
|
+
public static RasEditPhonebookEntryW(hwnd: HWND, lpszPhonebook: LPCWSTR | NULL, lpszEntry: LPCWSTR): DWORD {
|
|
237
|
+
return Rasapi32.Load('RasEditPhonebookEntryW')(hwnd, lpszPhonebook, lpszEntry);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasenumautodialaddressesa
|
|
241
|
+
public static RasEnumAutodialAddressesA(lppRasAutodialAddresses: PLPSTR | NULL, lpdwcbRasAutodialAddresses: LPDWORD, lpdwcRasAutodialAddresses: LPDWORD): DWORD {
|
|
242
|
+
return Rasapi32.Load('RasEnumAutodialAddressesA')(lppRasAutodialAddresses, lpdwcbRasAutodialAddresses, lpdwcRasAutodialAddresses);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasenumautodialaddressesw
|
|
246
|
+
public static RasEnumAutodialAddressesW(lppRasAutodialAddresses: PLPWSTR | NULL, lpdwcbRasAutodialAddresses: LPDWORD, lpdwcRasAutodialAddresses: LPDWORD): DWORD {
|
|
247
|
+
return Rasapi32.Load('RasEnumAutodialAddressesW')(lppRasAutodialAddresses, lpdwcbRasAutodialAddresses, lpdwcRasAutodialAddresses);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasenumconnectionsa
|
|
251
|
+
public static RasEnumConnectionsA(lprasconn: LPRASCONNA | NULL, lpcb: LPDWORD, lpcConnections: LPDWORD): DWORD {
|
|
252
|
+
return Rasapi32.Load('RasEnumConnectionsA')(lprasconn, lpcb, lpcConnections);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasenumconnectionsw
|
|
256
|
+
public static RasEnumConnectionsW(lprasconn: LPRASCONNW | NULL, lpcb: LPDWORD, lpcConnections: LPDWORD): DWORD {
|
|
257
|
+
return Rasapi32.Load('RasEnumConnectionsW')(lprasconn, lpcb, lpcConnections);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasenumdevicesa
|
|
261
|
+
public static RasEnumDevicesA(lpRasDevInfo: LPRASDEVINFOA | NULL, lpcb: LPDWORD, lpcDevices: LPDWORD): DWORD {
|
|
262
|
+
return Rasapi32.Load('RasEnumDevicesA')(lpRasDevInfo, lpcb, lpcDevices);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasenumdevicesw
|
|
266
|
+
public static RasEnumDevicesW(lpRasDevInfo: LPRASDEVINFOW | NULL, lpcb: LPDWORD, lpcDevices: LPDWORD): DWORD {
|
|
267
|
+
return Rasapi32.Load('RasEnumDevicesW')(lpRasDevInfo, lpcb, lpcDevices);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasenumentriesa
|
|
271
|
+
public static RasEnumEntriesA(reserved: LPCSTR | NULL, lpszPhonebook: LPCSTR | NULL, lprasentryname: LPRASENTRYNAMEA | NULL, lpcb: LPDWORD, lpcEntries: LPDWORD): DWORD {
|
|
272
|
+
return Rasapi32.Load('RasEnumEntriesA')(reserved, lpszPhonebook, lprasentryname, lpcb, lpcEntries);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasenumentriesw
|
|
276
|
+
public static RasEnumEntriesW(reserved: LPCWSTR | NULL, lpszPhonebook: LPCWSTR | NULL, lprasentryname: LPRASENTRYNAMEW | NULL, lpcb: LPDWORD, lpcEntries: LPDWORD): DWORD {
|
|
277
|
+
return Rasapi32.Load('RasEnumEntriesW')(reserved, lpszPhonebook, lprasentryname, lpcb, lpcEntries);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasfreeeapuseridentitya
|
|
281
|
+
public static RasFreeEapUserIdentityA(pRasEapUserIdentity: LPRASEAPUSERIDENTITYA | NULL): VOID {
|
|
282
|
+
return Rasapi32.Load('RasFreeEapUserIdentityA')(pRasEapUserIdentity);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasfreeeapuseridentityw
|
|
286
|
+
public static RasFreeEapUserIdentityW(pRasEapUserIdentity: LPRASEAPUSERIDENTITYW | NULL): VOID {
|
|
287
|
+
return Rasapi32.Load('RasFreeEapUserIdentityW')(pRasEapUserIdentity);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetautodialaddressa
|
|
291
|
+
public static RasGetAutodialAddressA(lpszAddress: LPCSTR | NULL, lpdwReserved: LPDWORD | NULL, lpAutoDialEntries: LPRASAUTODIALENTRYA | NULL, lpdwcbAutoDialEntries: LPDWORD, lpdwcAutoDialEntries: LPDWORD): DWORD {
|
|
292
|
+
return Rasapi32.Load('RasGetAutodialAddressA')(lpszAddress, lpdwReserved, lpAutoDialEntries, lpdwcbAutoDialEntries, lpdwcAutoDialEntries);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetautodialaddressw
|
|
296
|
+
public static RasGetAutodialAddressW(lpszAddress: LPCWSTR | NULL, lpdwReserved: LPDWORD | NULL, lpAutoDialEntries: LPRASAUTODIALENTRYW | NULL, lpdwcbAutoDialEntries: LPDWORD, lpdwcAutoDialEntries: LPDWORD): DWORD {
|
|
297
|
+
return Rasapi32.Load('RasGetAutodialAddressW')(lpszAddress, lpdwReserved, lpAutoDialEntries, lpdwcbAutoDialEntries, lpdwcAutoDialEntries);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetautodialenablea
|
|
301
|
+
public static RasGetAutodialEnableA(dwDialingLocation: DWORD, lpfEnabled: LPBOOL): DWORD {
|
|
302
|
+
return Rasapi32.Load('RasGetAutodialEnableA')(dwDialingLocation, lpfEnabled);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetautodialenablew
|
|
306
|
+
public static RasGetAutodialEnableW(dwDialingLocation: DWORD, lpfEnabled: LPBOOL): DWORD {
|
|
307
|
+
return Rasapi32.Load('RasGetAutodialEnableW')(dwDialingLocation, lpfEnabled);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetautodialparama
|
|
311
|
+
public static RasGetAutodialParamA(dwKey: DWORD, lpvValue: LPVOID, lpdwcbValue: LPDWORD): DWORD {
|
|
312
|
+
return Rasapi32.Load('RasGetAutodialParamA')(dwKey, lpvValue, lpdwcbValue);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetautodialparamw
|
|
316
|
+
public static RasGetAutodialParamW(dwKey: DWORD, lpvValue: LPVOID, lpdwcbValue: LPDWORD): DWORD {
|
|
317
|
+
return Rasapi32.Load('RasGetAutodialParamW')(dwKey, lpvValue, lpdwcbValue);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetconnectstatusa
|
|
321
|
+
public static RasGetConnectStatusA(hrasconn: HRASCONN, lprasconnstatus: LPRASCONNSTATUSA): DWORD {
|
|
322
|
+
return Rasapi32.Load('RasGetConnectStatusA')(hrasconn, lprasconnstatus);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetconnectstatusw
|
|
326
|
+
public static RasGetConnectStatusW(hrasconn: HRASCONN, lprasconnstatus: LPRASCONNSTATUSW): DWORD {
|
|
327
|
+
return Rasapi32.Load('RasGetConnectStatusW')(hrasconn, lprasconnstatus);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetconnectionstatistics
|
|
331
|
+
public static RasGetConnectionStatistics(hRasConn: HRASCONN, lpStatistics: LPRAS_STATS): DWORD {
|
|
332
|
+
return Rasapi32.Load('RasGetConnectionStatistics')(hRasConn, lpStatistics);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetcountryinfoa
|
|
336
|
+
public static RasGetCountryInfoA(lpRasCtryInfo: LPRASCTRYINFOA | NULL, lpdwSize: LPDWORD): DWORD {
|
|
337
|
+
return Rasapi32.Load('RasGetCountryInfoA')(lpRasCtryInfo, lpdwSize);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetcountryinfow
|
|
341
|
+
public static RasGetCountryInfoW(lpRasCtryInfo: LPRASCTRYINFOW | NULL, lpdwSize: LPDWORD): DWORD {
|
|
342
|
+
return Rasapi32.Load('RasGetCountryInfoW')(lpRasCtryInfo, lpdwSize);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetcredentialsa
|
|
346
|
+
public static RasGetCredentialsA(lpszPhonebook: LPCSTR | NULL, lpszEntry: LPCSTR, lpCredentials: LPRASCREDENTIALSA): DWORD {
|
|
347
|
+
return Rasapi32.Load('RasGetCredentialsA')(lpszPhonebook, lpszEntry, lpCredentials);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetcredentialsw
|
|
351
|
+
public static RasGetCredentialsW(lpszPhonebook: LPCWSTR | NULL, lpszEntry: LPCWSTR, lpCredentials: LPRASCREDENTIALSW): DWORD {
|
|
352
|
+
return Rasapi32.Load('RasGetCredentialsW')(lpszPhonebook, lpszEntry, lpCredentials);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetcustomauthdataa
|
|
356
|
+
public static RasGetCustomAuthDataA(pszPhonebook: LPCSTR | NULL, pszEntry: LPCSTR, pbCustomAuthData: LPBYTE | NULL, pdwSizeofCustomAuthData: LPDWORD): DWORD {
|
|
357
|
+
return Rasapi32.Load('RasGetCustomAuthDataA')(pszPhonebook, pszEntry, pbCustomAuthData, pdwSizeofCustomAuthData);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetcustomauthdataw
|
|
361
|
+
public static RasGetCustomAuthDataW(pszPhonebook: LPCWSTR | NULL, pszEntry: LPCWSTR, pbCustomAuthData: LPBYTE | NULL, pdwSizeofCustomAuthData: LPDWORD): DWORD {
|
|
362
|
+
return Rasapi32.Load('RasGetCustomAuthDataW')(pszPhonebook, pszEntry, pbCustomAuthData, pdwSizeofCustomAuthData);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgeteapuserdataa
|
|
366
|
+
public static RasGetEapUserDataA(hToken: HANDLE | 0n, pszPhonebook: LPCSTR | NULL, pszEntry: LPCSTR, pbEapData: LPBYTE | NULL, pdwSizeofEapData: LPDWORD): DWORD {
|
|
367
|
+
return Rasapi32.Load('RasGetEapUserDataA')(hToken, pszPhonebook, pszEntry, pbEapData, pdwSizeofEapData);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgeteapuserdataw
|
|
371
|
+
public static RasGetEapUserDataW(hToken: HANDLE | 0n, pszPhonebook: LPCWSTR | NULL, pszEntry: LPCWSTR, pbEapData: LPBYTE | NULL, pdwSizeofEapData: LPDWORD): DWORD {
|
|
372
|
+
return Rasapi32.Load('RasGetEapUserDataW')(hToken, pszPhonebook, pszEntry, pbEapData, pdwSizeofEapData);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgeteapuseridentitya
|
|
376
|
+
public static RasGetEapUserIdentityA(pszPhonebook: LPCSTR | NULL, pszEntry: LPCSTR, dwFlags: DWORD, hwnd: HWND | 0n, ppRasEapUserIdentity: PLPRASEAPUSERIDENTITYA): DWORD {
|
|
377
|
+
return Rasapi32.Load('RasGetEapUserIdentityA')(pszPhonebook, pszEntry, dwFlags, hwnd, ppRasEapUserIdentity);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgeteapuseridentityw
|
|
381
|
+
public static RasGetEapUserIdentityW(pszPhonebook: LPCWSTR | NULL, pszEntry: LPCWSTR, dwFlags: DWORD, hwnd: HWND | 0n, ppRasEapUserIdentity: PLPRASEAPUSERIDENTITYW): DWORD {
|
|
382
|
+
return Rasapi32.Load('RasGetEapUserIdentityW')(pszPhonebook, pszEntry, dwFlags, hwnd, ppRasEapUserIdentity);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetentrydialparamsa
|
|
386
|
+
public static RasGetEntryDialParamsA(lpszPhonebook: LPCSTR | NULL, lpRasDialParams: LPRASDIALPARAMSA, lpfPassword: LPBOOL): DWORD {
|
|
387
|
+
return Rasapi32.Load('RasGetEntryDialParamsA')(lpszPhonebook, lpRasDialParams, lpfPassword);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetentrydialparamsw
|
|
391
|
+
public static RasGetEntryDialParamsW(lpszPhonebook: LPCWSTR | NULL, lpRasDialParams: LPRASDIALPARAMSW, lpfPassword: LPBOOL): DWORD {
|
|
392
|
+
return Rasapi32.Load('RasGetEntryDialParamsW')(lpszPhonebook, lpRasDialParams, lpfPassword);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetentrypropertiesa
|
|
396
|
+
public static RasGetEntryPropertiesA(lpszPhonebook: LPCSTR | NULL, lpszEntry: LPCSTR, lpRasEntry: LPRASENTRYA | NULL, lpdwEntryInfoSize: LPDWORD | NULL, lpbDeviceInfo: LPBYTE | NULL, lpdwDeviceInfoSize: LPDWORD | NULL): DWORD {
|
|
397
|
+
return Rasapi32.Load('RasGetEntryPropertiesA')(lpszPhonebook, lpszEntry, lpRasEntry, lpdwEntryInfoSize, lpbDeviceInfo, lpdwDeviceInfoSize);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetentrypropertiesw
|
|
401
|
+
public static RasGetEntryPropertiesW(lpszPhonebook: LPCWSTR | NULL, lpszEntry: LPCWSTR, lpRasEntry: LPRASENTRYW | NULL, lpdwEntryInfoSize: LPDWORD | NULL, lpbDeviceInfo: LPBYTE | NULL, lpdwDeviceInfoSize: LPDWORD | NULL): DWORD {
|
|
402
|
+
return Rasapi32.Load('RasGetEntryPropertiesW')(lpszPhonebook, lpszEntry, lpRasEntry, lpdwEntryInfoSize, lpbDeviceInfo, lpdwDeviceInfoSize);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgeterrorstringa
|
|
406
|
+
public static RasGetErrorStringA(ResourceId: UINT, lpszString: LPSTR, InBufSize: DWORD): DWORD {
|
|
407
|
+
return Rasapi32.Load('RasGetErrorStringA')(ResourceId, lpszString, InBufSize);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgeterrorstringw
|
|
411
|
+
public static RasGetErrorStringW(ResourceId: UINT, lpszString: LPWSTR, InBufSize: DWORD): DWORD {
|
|
412
|
+
return Rasapi32.Load('RasGetErrorStringW')(ResourceId, lpszString, InBufSize);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetlinkstatistics
|
|
416
|
+
public static RasGetLinkStatistics(hRasConn: HRASCONN, dwSubEntry: DWORD, lpStatistics: LPRAS_STATS): DWORD {
|
|
417
|
+
return Rasapi32.Load('RasGetLinkStatistics')(hRasConn, dwSubEntry, lpStatistics);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetnapstatus
|
|
421
|
+
public static RasGetNapStatus(hRasconn: HRASCONN, pRasNapState: LPRASNAPSTATE): DWORD {
|
|
422
|
+
return Rasapi32.Load('RasGetNapStatus')(hRasconn, pRasNapState);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetprojectioninfo
|
|
426
|
+
public static RasGetProjectionInfoA(hrasconn: HRASCONN, rasprojection: RASPROJECTION, lpprojection: LPVOID, lpcb: LPDWORD): DWORD {
|
|
427
|
+
return Rasapi32.Load('RasGetProjectionInfoA')(hrasconn, rasprojection, lpprojection, lpcb);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetprojectioninfoex
|
|
431
|
+
public static RasGetProjectionInfoEx(hrasconn: HRASCONN, pRasProjection: PRAS_PROJECTION_INFO | NULL, lpdwSize: LPDWORD): DWORD {
|
|
432
|
+
return Rasapi32.Load('RasGetProjectionInfoEx')(hrasconn, pRasProjection, lpdwSize);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetprojectioninfo
|
|
436
|
+
public static RasGetProjectionInfoW(hrasconn: HRASCONN, rasprojection: RASPROJECTION, lpprojection: LPVOID, lpcb: LPDWORD): DWORD {
|
|
437
|
+
return Rasapi32.Load('RasGetProjectionInfoW')(hrasconn, rasprojection, lpprojection, lpcb);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetsubentryhandlea
|
|
441
|
+
public static RasGetSubEntryHandleA(hrasconn: HRASCONN, dwSubEntry: DWORD, lphrasconn: LPHRASCONN): DWORD {
|
|
442
|
+
return Rasapi32.Load('RasGetSubEntryHandleA')(hrasconn, dwSubEntry, lphrasconn);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetsubentryhandlew
|
|
446
|
+
public static RasGetSubEntryHandleW(hrasconn: HRASCONN, dwSubEntry: DWORD, lphrasconn: LPHRASCONN): DWORD {
|
|
447
|
+
return Rasapi32.Load('RasGetSubEntryHandleW')(hrasconn, dwSubEntry, lphrasconn);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetsubentrypropertiesa
|
|
451
|
+
public static RasGetSubEntryPropertiesA(
|
|
452
|
+
lpszPhonebook: LPCSTR | NULL,
|
|
453
|
+
lpszEntry: LPCSTR,
|
|
454
|
+
dwSubEntry: DWORD,
|
|
455
|
+
lpRasSubEntry: LPRASSUBENTRYA | NULL,
|
|
456
|
+
lpdwcb: LPDWORD | NULL,
|
|
457
|
+
lpbDeviceConfig: LPBYTE | NULL,
|
|
458
|
+
lpdwcbDeviceConfig: LPDWORD | NULL,
|
|
459
|
+
): DWORD {
|
|
460
|
+
return Rasapi32.Load('RasGetSubEntryPropertiesA')(lpszPhonebook, lpszEntry, dwSubEntry, lpRasSubEntry, lpdwcb, lpbDeviceConfig, lpdwcbDeviceConfig);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasgetsubentrypropertiesw
|
|
464
|
+
public static RasGetSubEntryPropertiesW(
|
|
465
|
+
lpszPhonebook: LPCWSTR | NULL,
|
|
466
|
+
lpszEntry: LPCWSTR,
|
|
467
|
+
dwSubEntry: DWORD,
|
|
468
|
+
lpRasSubEntry: LPRASSUBENTRYW | NULL,
|
|
469
|
+
lpdwcb: LPDWORD | NULL,
|
|
470
|
+
lpbDeviceConfig: LPBYTE | NULL,
|
|
471
|
+
lpdwcbDeviceConfig: LPDWORD | NULL,
|
|
472
|
+
): DWORD {
|
|
473
|
+
return Rasapi32.Load('RasGetSubEntryPropertiesW')(lpszPhonebook, lpszEntry, dwSubEntry, lpRasSubEntry, lpdwcb, lpbDeviceConfig, lpdwcbDeviceConfig);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rashangupa
|
|
477
|
+
public static RasHangUpA(hrasconn: HRASCONN): DWORD {
|
|
478
|
+
return Rasapi32.Load('RasHangUpA')(hrasconn);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rashangupw
|
|
482
|
+
public static RasHangUpW(hrasconn: HRASCONN): DWORD {
|
|
483
|
+
return Rasapi32.Load('RasHangUpW')(hrasconn);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasinvokeeapui
|
|
487
|
+
public static RasInvokeEapUI(hrasconn: HRASCONN, dwSubEntry: DWORD, lpRasDialExtensions: LPRASDIALEXTENSIONS, hwnd: HWND): DWORD {
|
|
488
|
+
return Rasapi32.Load('RasInvokeEapUI')(hrasconn, dwSubEntry, lpRasDialExtensions, hwnd);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasrenameentrya
|
|
492
|
+
public static RasRenameEntryA(lpszPhonebook: LPCSTR | NULL, lpszOldEntry: LPCSTR, lpszNewEntry: LPCSTR): DWORD {
|
|
493
|
+
return Rasapi32.Load('RasRenameEntryA')(lpszPhonebook, lpszOldEntry, lpszNewEntry);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasrenameentryw
|
|
497
|
+
public static RasRenameEntryW(lpszPhonebook: LPCWSTR | NULL, lpszOldEntry: LPCWSTR, lpszNewEntry: LPCWSTR): DWORD {
|
|
498
|
+
return Rasapi32.Load('RasRenameEntryW')(lpszPhonebook, lpszOldEntry, lpszNewEntry);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetautodialaddressa
|
|
502
|
+
public static RasSetAutodialAddressA(lpszAddress: LPCSTR | NULL, dwReserved: DWORD, lpAutoDialEntries: LPRASAUTODIALENTRYA | NULL, dwcbAutoDialEntries: DWORD, dwcAutoDialEntries: DWORD): DWORD {
|
|
503
|
+
return Rasapi32.Load('RasSetAutodialAddressA')(lpszAddress, dwReserved, lpAutoDialEntries, dwcbAutoDialEntries, dwcAutoDialEntries);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetautodialaddressw
|
|
507
|
+
public static RasSetAutodialAddressW(lpszAddress: LPCWSTR | NULL, dwReserved: DWORD, lpAutoDialEntries: LPRASAUTODIALENTRYW | NULL, dwcbAutoDialEntries: DWORD, dwcAutoDialEntries: DWORD): DWORD {
|
|
508
|
+
return Rasapi32.Load('RasSetAutodialAddressW')(lpszAddress, dwReserved, lpAutoDialEntries, dwcbAutoDialEntries, dwcAutoDialEntries);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetautodialenablea
|
|
512
|
+
public static RasSetAutodialEnableA(dwDialingLocation: DWORD, fEnabled: BOOL): DWORD {
|
|
513
|
+
return Rasapi32.Load('RasSetAutodialEnableA')(dwDialingLocation, fEnabled);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetautodialenablew
|
|
517
|
+
public static RasSetAutodialEnableW(dwDialingLocation: DWORD, fEnabled: BOOL): DWORD {
|
|
518
|
+
return Rasapi32.Load('RasSetAutodialEnableW')(dwDialingLocation, fEnabled);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetautodialparama
|
|
522
|
+
public static RasSetAutodialParamA(dwKey: DWORD, lpvValue: LPVOID, dwcbValue: DWORD): DWORD {
|
|
523
|
+
return Rasapi32.Load('RasSetAutodialParamA')(dwKey, lpvValue, dwcbValue);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetautodialparamw
|
|
527
|
+
public static RasSetAutodialParamW(dwKey: DWORD, lpvValue: LPVOID, dwcbValue: DWORD): DWORD {
|
|
528
|
+
return Rasapi32.Load('RasSetAutodialParamW')(dwKey, lpvValue, dwcbValue);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetcredentialsa
|
|
532
|
+
public static RasSetCredentialsA(lpszPhonebook: LPCSTR | NULL, lpszEntry: LPCSTR, lpCredentials: LPRASCREDENTIALSA, fClearCredentials: BOOL): DWORD {
|
|
533
|
+
return Rasapi32.Load('RasSetCredentialsA')(lpszPhonebook, lpszEntry, lpCredentials, fClearCredentials);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetcredentialsw
|
|
537
|
+
public static RasSetCredentialsW(lpszPhonebook: LPCWSTR | NULL, lpszEntry: LPCWSTR, lpCredentials: LPRASCREDENTIALSW, fClearCredentials: BOOL): DWORD {
|
|
538
|
+
return Rasapi32.Load('RasSetCredentialsW')(lpszPhonebook, lpszEntry, lpCredentials, fClearCredentials);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetcustomauthdataa
|
|
542
|
+
public static RasSetCustomAuthDataA(pszPhonebook: LPCSTR | NULL, pszEntry: LPCSTR, pbCustomAuthData: LPBYTE, dwSizeofCustomAuthData: DWORD): DWORD {
|
|
543
|
+
return Rasapi32.Load('RasSetCustomAuthDataA')(pszPhonebook, pszEntry, pbCustomAuthData, dwSizeofCustomAuthData);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetcustomauthdataw
|
|
547
|
+
public static RasSetCustomAuthDataW(pszPhonebook: LPCWSTR | NULL, pszEntry: LPCWSTR, pbCustomAuthData: LPBYTE, dwSizeofCustomAuthData: DWORD): DWORD {
|
|
548
|
+
return Rasapi32.Load('RasSetCustomAuthDataW')(pszPhonebook, pszEntry, pbCustomAuthData, dwSizeofCustomAuthData);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasseteapuserdataa
|
|
552
|
+
public static RasSetEapUserDataA(hToken: HANDLE | 0n, pszPhonebook: LPCSTR | NULL, pszEntry: LPCSTR, pbEapData: LPBYTE, dwSizeofEapData: DWORD): DWORD {
|
|
553
|
+
return Rasapi32.Load('RasSetEapUserDataA')(hToken, pszPhonebook, pszEntry, pbEapData, dwSizeofEapData);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasseteapuserdataw
|
|
557
|
+
public static RasSetEapUserDataW(hToken: HANDLE | 0n, pszPhonebook: LPCWSTR | NULL, pszEntry: LPCWSTR, pbEapData: LPBYTE, dwSizeofEapData: DWORD): DWORD {
|
|
558
|
+
return Rasapi32.Load('RasSetEapUserDataW')(hToken, pszPhonebook, pszEntry, pbEapData, dwSizeofEapData);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetentrydialparamsa
|
|
562
|
+
public static RasSetEntryDialParamsA(lpszPhonebook: LPCSTR | NULL, lpRasDialParams: LPRASDIALPARAMSA, fRemovePassword: BOOL): DWORD {
|
|
563
|
+
return Rasapi32.Load('RasSetEntryDialParamsA')(lpszPhonebook, lpRasDialParams, fRemovePassword);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetentrydialparamsw
|
|
567
|
+
public static RasSetEntryDialParamsW(lpszPhonebook: LPCWSTR | NULL, lpRasDialParams: LPRASDIALPARAMSW, fRemovePassword: BOOL): DWORD {
|
|
568
|
+
return Rasapi32.Load('RasSetEntryDialParamsW')(lpszPhonebook, lpRasDialParams, fRemovePassword);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetentrypropertiesa
|
|
572
|
+
public static RasSetEntryPropertiesA(lpszPhonebook: LPCSTR | NULL, lpszEntry: LPCSTR, lpRasEntry: LPRASENTRYA, dwEntryInfoSize: DWORD, lpbDeviceInfo: LPBYTE | NULL, dwDeviceInfoSize: DWORD): DWORD {
|
|
573
|
+
return Rasapi32.Load('RasSetEntryPropertiesA')(lpszPhonebook, lpszEntry, lpRasEntry, dwEntryInfoSize, lpbDeviceInfo, dwDeviceInfoSize);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetentrypropertiesw
|
|
577
|
+
public static RasSetEntryPropertiesW(lpszPhonebook: LPCWSTR | NULL, lpszEntry: LPCWSTR, lpRasEntry: LPRASENTRYW, dwEntryInfoSize: DWORD, lpbDeviceInfo: LPBYTE | NULL, dwDeviceInfoSize: DWORD): DWORD {
|
|
578
|
+
return Rasapi32.Load('RasSetEntryPropertiesW')(lpszPhonebook, lpszEntry, lpRasEntry, dwEntryInfoSize, lpbDeviceInfo, dwDeviceInfoSize);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetsubentrypropertiesa
|
|
582
|
+
public static RasSetSubEntryPropertiesA(lpszPhonebook: LPCSTR | NULL, lpszEntry: LPCSTR, dwSubEntry: DWORD, lpRasSubEntry: LPRASSUBENTRYA, dwcbRasSubEntry: DWORD, lpbDeviceConfig: LPBYTE | NULL, dwcbDeviceConfig: DWORD): DWORD {
|
|
583
|
+
return Rasapi32.Load('RasSetSubEntryPropertiesA')(lpszPhonebook, lpszEntry, dwSubEntry, lpRasSubEntry, dwcbRasSubEntry, lpbDeviceConfig, dwcbDeviceConfig);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rassetsubentrypropertiesw
|
|
587
|
+
public static RasSetSubEntryPropertiesW(lpszPhonebook: LPCWSTR | NULL, lpszEntry: LPCWSTR, dwSubEntry: DWORD, lpRasSubEntry: LPRASSUBENTRYW, dwcbRasSubEntry: DWORD, lpbDeviceConfig: LPBYTE | NULL, dwcbDeviceConfig: DWORD): DWORD {
|
|
588
|
+
return Rasapi32.Load('RasSetSubEntryPropertiesW')(lpszPhonebook, lpszEntry, dwSubEntry, lpRasSubEntry, dwcbRasSubEntry, lpbDeviceConfig, dwcbDeviceConfig);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasupdateconnection
|
|
592
|
+
public static RasUpdateConnection(hrasconn: HRASCONN, lprasupdateconn: LPRASUPDATECONN): DWORD {
|
|
593
|
+
return Rasapi32.Load('RasUpdateConnection')(hrasconn, lprasupdateconn);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasvalidateentrynamea
|
|
597
|
+
public static RasValidateEntryNameA(lpszPhonebook: LPCSTR | NULL, lpszEntry: LPCSTR): DWORD {
|
|
598
|
+
return Rasapi32.Load('RasValidateEntryNameA')(lpszPhonebook, lpszEntry);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ras/nf-ras-rasvalidateentrynamew
|
|
602
|
+
public static RasValidateEntryNameW(lpszPhonebook: LPCWSTR | NULL, lpszEntry: LPCWSTR): DWORD {
|
|
603
|
+
return Rasapi32.Load('RasValidateEntryNameW')(lpszPhonebook, lpszEntry);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export default Rasapi32;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Pointer } from 'bun:ffi';
|
|
2
|
+
|
|
3
|
+
export type { BOOL, DWORD, HANDLE, HWND, LPBOOL, LPBYTE, LPCSTR, LPCWSTR, LPDWORD, LPSTR, LPVOID, LPWSTR, NULL, UINT, VOID } from '@bun-win32/core';
|
|
4
|
+
|
|
5
|
+
export enum RASPROJECTION {
|
|
6
|
+
RASP_Amb = 0x0001_0000,
|
|
7
|
+
RASP_PppCcp = 0x0000_80fd,
|
|
8
|
+
RASP_PppIp = 0x0000_8021,
|
|
9
|
+
RASP_PppIpv6 = 0x0000_8057,
|
|
10
|
+
RASP_PppIpx = 0x0000_802b,
|
|
11
|
+
RASP_PppLcp = 0x0000_c021,
|
|
12
|
+
RASP_PppNbf = 0x0000_803f,
|
|
13
|
+
RASP_Slip = 0x0002_0000,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type HRASCONN = bigint;
|
|
17
|
+
export type LPHRASCONN = Pointer;
|
|
18
|
+
export type LPRASAUTODIALENTRYA = Pointer;
|
|
19
|
+
export type LPRASAUTODIALENTRYW = Pointer;
|
|
20
|
+
export type LPRASCONNA = Pointer;
|
|
21
|
+
export type LPRASCONNSTATUSA = Pointer;
|
|
22
|
+
export type LPRASCONNSTATUSW = Pointer;
|
|
23
|
+
export type LPRASCONNW = Pointer;
|
|
24
|
+
export type LPRASCREDENTIALSA = Pointer;
|
|
25
|
+
export type LPRASCREDENTIALSW = Pointer;
|
|
26
|
+
export type LPRASCTRYINFOA = Pointer;
|
|
27
|
+
export type LPRASCTRYINFOW = Pointer;
|
|
28
|
+
export type LPRASDEVINFOA = Pointer;
|
|
29
|
+
export type LPRASDEVINFOW = Pointer;
|
|
30
|
+
export type LPRASDIALEXTENSIONS = Pointer;
|
|
31
|
+
export type LPRASDIALPARAMSA = Pointer;
|
|
32
|
+
export type LPRASDIALPARAMSW = Pointer;
|
|
33
|
+
export type LPRASEAPUSERIDENTITYA = Pointer;
|
|
34
|
+
export type LPRASEAPUSERIDENTITYW = Pointer;
|
|
35
|
+
export type LPRASENTRYA = Pointer;
|
|
36
|
+
export type LPRASENTRYNAMEA = Pointer;
|
|
37
|
+
export type LPRASENTRYNAMEW = Pointer;
|
|
38
|
+
export type LPRASENTRYW = Pointer;
|
|
39
|
+
export type LPRASNAPSTATE = Pointer;
|
|
40
|
+
export type LPRASSUBENTRYA = Pointer;
|
|
41
|
+
export type LPRASSUBENTRYW = Pointer;
|
|
42
|
+
export type LPRASUPDATECONN = Pointer;
|
|
43
|
+
export type LPRAS_STATS = Pointer;
|
|
44
|
+
export type PLPRASEAPUSERIDENTITYA = Pointer;
|
|
45
|
+
export type PLPRASEAPUSERIDENTITYW = Pointer;
|
|
46
|
+
export type PLPSTR = Pointer;
|
|
47
|
+
export type PLPWSTR = Pointer;
|
|
48
|
+
export type PRAS_PROJECTION_INFO = Pointer;
|