@bun-win32/ole32 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 +66 -0
- package/README.md +58 -0
- package/index.ts +4 -0
- package/package.json +57 -0
- package/structs/Ole32.ts +950 -0
- package/types/Ole32.ts +133 -0
package/AI.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# AI Guide for @bun-win32/ole32
|
|
2
|
+
|
|
3
|
+
How to use this package, not what the Win32 API does.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import Ole32 from '@bun-win32/ole32';
|
|
9
|
+
|
|
10
|
+
const result = Ole32.OleBuildVersion();
|
|
11
|
+
|
|
12
|
+
Ole32.Preload(['OleBuildVersion', 'StgIsStorageFile']);
|
|
13
|
+
Ole32.Preload('OleBuildVersion');
|
|
14
|
+
Ole32.Preload();
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Where To Look
|
|
18
|
+
|
|
19
|
+
| Need | Read |
|
|
20
|
+
| --------------------------------- | ----------------- |
|
|
21
|
+
| Find a method or its MS Docs link | `structs/Ole32.ts` |
|
|
22
|
+
| Find types, enums, constants | `types/Ole32.ts` |
|
|
23
|
+
| Quick examples | `README.md` |
|
|
24
|
+
|
|
25
|
+
`index.ts` re-exports the class and all types - import from `@bun-win32/ole32` directly.
|
|
26
|
+
|
|
27
|
+
## Calling Convention
|
|
28
|
+
|
|
29
|
+
All documented `ole32.dll` exports in this package are bound. Each method maps 1:1 to its DLL export. Names, parameter names, and order match Microsoft Docs or Windows SDK headers.
|
|
30
|
+
|
|
31
|
+
### Strings
|
|
32
|
+
|
|
33
|
+
`W` methods take UTF-16LE NUL-terminated buffers.
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
const wide = Buffer.from('Hello\\0', 'utf16le');
|
|
37
|
+
const result = Ole32.StgIsStorageFile(wide.ptr);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Return types
|
|
41
|
+
|
|
42
|
+
- `HANDLE`, `HWND`, `HGLOBAL`, `HICON`, `HOLEMENU`, and similar handle types -> `bigint`
|
|
43
|
+
- `DWORD`, `UINT`, `BOOL`, `INT`, `LONG`, `HRESULT`, and similar scalar types -> `number`
|
|
44
|
+
- `LPVOID`, COM interface pointers, `LPOLESTR`, and other pointer types -> `Pointer`
|
|
45
|
+
|
|
46
|
+
### Pointers, handles, out-parameters
|
|
47
|
+
|
|
48
|
+
- Pointer params (`LP*`, `P*`, interface pointers): pass `buffer.ptr` from caller-allocated memory.
|
|
49
|
+
- Handle params (`HANDLE`, `HGLOBAL`, `HWND`, etc.): pass a `bigint`.
|
|
50
|
+
- Out-parameters: allocate a buffer, pass `.ptr`, then read the result after the call.
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
const fileTimeBuffer = Buffer.alloc(8);
|
|
54
|
+
const dosDateBuffer = Buffer.alloc(2);
|
|
55
|
+
const dosTimeBuffer = Buffer.alloc(2);
|
|
56
|
+
Ole32.CoFileTimeToDosDateTime(fileTimeBuffer.ptr, dosDateBuffer.ptr, dosTimeBuffer.ptr);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Nullability
|
|
60
|
+
|
|
61
|
+
- `| NULL` in a signature -> pass `null`.
|
|
62
|
+
- `| 0n` in a signature -> pass `0n`.
|
|
63
|
+
|
|
64
|
+
## Errors and Cleanup
|
|
65
|
+
|
|
66
|
+
Return values are raw. If a call returns an interface pointer, handle, or allocated memory, cleanup is still your responsibility. COM interface pointers returned by flat exports are raw pointers; this package does not wrap vtable-based method calls or reference counting.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @bun-win32/ole32
|
|
2
|
+
|
|
3
|
+
Zero-dependency, zero-overhead Win32 Ole32 bindings for [Bun](https://bun.sh) on Windows.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`@bun-win32/ole32` exposes the `ole32.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Ole32`, 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. The package intentionally stays flat-FFI only: it binds exports, pointer types, and handles, but it does not wrap COM vtables or automate reference counting for returned interface pointers.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Bun-first ergonomics on Windows 10/11.
|
|
14
|
+
- Direct FFI to `ole32.dll` for COM/OLE helpers, monikers, structured storage, drag-drop, and property-set utilities.
|
|
15
|
+
- In-source docs in `structs/Ole32.ts` with Microsoft Learn links.
|
|
16
|
+
- Lazy binding on first call; optional eager preload with `Ole32.Preload()`.
|
|
17
|
+
- No wrapper overhead; calls map 1:1 to the underlying DLL export.
|
|
18
|
+
- Strongly-typed Win32 aliases for storage helpers, interface pointers, handles, and wide strings.
|
|
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/ole32
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import Ole32 from '@bun-win32/ole32';
|
|
35
|
+
|
|
36
|
+
const comVersion = Ole32.CoBuildVersion();
|
|
37
|
+
const oleVersion = Ole32.OleBuildVersion();
|
|
38
|
+
|
|
39
|
+
console.log({ comVersion, oleVersion });
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> [!NOTE]
|
|
43
|
+
> AI agents: see `AI.md` for the package binding contract and source-navigation guidance.
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
Run the included examples:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
bun run example:property-set-galaxy
|
|
51
|
+
bun run example:storage-audit
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Notes
|
|
55
|
+
|
|
56
|
+
- Use `Ole32.Preload()` when you want to front-load symbol resolution.
|
|
57
|
+
- Interface pointers returned from APIs like `StgOpenStorage` are raw COM pointers; callers must manage any vtable-based lifetime and method invocation themselves.
|
|
58
|
+
- Windows only. Bun runtime required.
|
package/index.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
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 OLE32 bindings for Bun (FFI) on Windows.",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/bun": "latest"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"bun": ">=1.1.0"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./index.ts"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"AI.md",
|
|
21
|
+
"README.md",
|
|
22
|
+
"index.ts",
|
|
23
|
+
"structs/*.ts",
|
|
24
|
+
"types/*.ts"
|
|
25
|
+
],
|
|
26
|
+
"homepage": "https://github.com/ObscuritySRL/bun-win32#readme",
|
|
27
|
+
"keywords": [
|
|
28
|
+
"bun",
|
|
29
|
+
"ffi",
|
|
30
|
+
"win32",
|
|
31
|
+
"windows",
|
|
32
|
+
"ole32",
|
|
33
|
+
"bindings",
|
|
34
|
+
"typescript",
|
|
35
|
+
"dll"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"main": "./index.ts",
|
|
39
|
+
"module": "index.ts",
|
|
40
|
+
"name": "@bun-win32/ole32",
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"typescript": "^5"
|
|
43
|
+
},
|
|
44
|
+
"private": false,
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git://github.com/ObscuritySRL/bun-win32.git",
|
|
48
|
+
"directory": "packages/ole32"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"example:property-set-galaxy": "bun ./example/property-set-galaxy.ts",
|
|
52
|
+
"example:storage-audit": "bun ./example/storage-audit.ts"
|
|
53
|
+
},
|
|
54
|
+
"sideEffects": false,
|
|
55
|
+
"type": "module",
|
|
56
|
+
"version": "1.0.0"
|
|
57
|
+
}
|
package/structs/Ole32.ts
ADDED
|
@@ -0,0 +1,950 @@
|
|
|
1
|
+
import { type FFIFunction, FFIType } from 'bun:ffi';
|
|
2
|
+
|
|
3
|
+
import { Win32 } from '@bun-win32/core';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
BOOL,
|
|
7
|
+
BIND_OPTS,
|
|
8
|
+
BOOLEAN,
|
|
9
|
+
BYTE,
|
|
10
|
+
CLIPFORMAT,
|
|
11
|
+
CLSID,
|
|
12
|
+
DWORD,
|
|
13
|
+
DVTARGETDEVICE,
|
|
14
|
+
FILETIME,
|
|
15
|
+
FMTID,
|
|
16
|
+
HACCEL,
|
|
17
|
+
HANDLE,
|
|
18
|
+
HDC,
|
|
19
|
+
HGLOBAL,
|
|
20
|
+
HICON,
|
|
21
|
+
HINSTANCE,
|
|
22
|
+
HMENU,
|
|
23
|
+
HOLEMENU,
|
|
24
|
+
HRESULT,
|
|
25
|
+
HWND,
|
|
26
|
+
IAdviseSink,
|
|
27
|
+
IFillLockBytes,
|
|
28
|
+
ILockBytes,
|
|
29
|
+
INT,
|
|
30
|
+
LONG,
|
|
31
|
+
LPBC,
|
|
32
|
+
LPCLASSFACTORY,
|
|
33
|
+
IStorage,
|
|
34
|
+
LPDATAOBJECT,
|
|
35
|
+
LPDWORD,
|
|
36
|
+
LPFORMATETC,
|
|
37
|
+
LPCLSID,
|
|
38
|
+
LPCOLESTR,
|
|
39
|
+
LPCRECT,
|
|
40
|
+
LPCWSTR,
|
|
41
|
+
LPDROPSOURCE,
|
|
42
|
+
LPDROPTARGET,
|
|
43
|
+
LPLONG,
|
|
44
|
+
LPLOCKBYTES,
|
|
45
|
+
LPLPVOID,
|
|
46
|
+
LPMESSAGEFILTER,
|
|
47
|
+
LPMONIKER,
|
|
48
|
+
LPMSG,
|
|
49
|
+
LPOLECLIENTSITE,
|
|
50
|
+
LPOLEINPLACEACTIVEOBJECT,
|
|
51
|
+
LPOLEINPLACEFRAME,
|
|
52
|
+
LPOLEINPLACEFRAMEINFO,
|
|
53
|
+
LPOLEMENUGROUPWIDTHS,
|
|
54
|
+
LPOLEOBJECT,
|
|
55
|
+
LPOLESTR,
|
|
56
|
+
LPOLESTREAM,
|
|
57
|
+
LPPERSISTSTORAGE,
|
|
58
|
+
LPPERSISTSTREAM,
|
|
59
|
+
LPSTGMEDIUM,
|
|
60
|
+
LPSTORAGE,
|
|
61
|
+
LPSTREAM,
|
|
62
|
+
LPUNKNOWN,
|
|
63
|
+
LPVOID,
|
|
64
|
+
LPWORD,
|
|
65
|
+
LPWSTR,
|
|
66
|
+
NULL,
|
|
67
|
+
PHGLOBAL,
|
|
68
|
+
PMemoryAllocator,
|
|
69
|
+
PPBC,
|
|
70
|
+
PPDATAADVISEHOLDER,
|
|
71
|
+
PPDATAOBJECT,
|
|
72
|
+
PPENUMFORMATETC,
|
|
73
|
+
PPENUMOLEVERB,
|
|
74
|
+
PPIFillLockBytes,
|
|
75
|
+
PPLOCKBYTES,
|
|
76
|
+
PPMESSAGEFILTER,
|
|
77
|
+
PPMONIKER,
|
|
78
|
+
PPOLEADVISEHOLDER,
|
|
79
|
+
PPOLESTR,
|
|
80
|
+
PPIPropertySetStorage,
|
|
81
|
+
PPIPropertyStorage,
|
|
82
|
+
PPIStorage,
|
|
83
|
+
PPRUNNINGOBJECTTABLE,
|
|
84
|
+
PPVOID,
|
|
85
|
+
PPWSTR,
|
|
86
|
+
PSECURITY_DESCRIPTOR,
|
|
87
|
+
PROPID,
|
|
88
|
+
PROPVARIANT,
|
|
89
|
+
PROPVAR_CHANGE_FLAGS,
|
|
90
|
+
PULONG,
|
|
91
|
+
QUERYCONTEXT,
|
|
92
|
+
REFCLSID,
|
|
93
|
+
REFFMTID,
|
|
94
|
+
REFGUID,
|
|
95
|
+
REFIID,
|
|
96
|
+
REFPROPVARIANT,
|
|
97
|
+
SERIALIZEDPROPERTYVALUE,
|
|
98
|
+
SNB,
|
|
99
|
+
STGOPTIONS,
|
|
100
|
+
UINT,
|
|
101
|
+
ULONG,
|
|
102
|
+
USHORT,
|
|
103
|
+
uCLSSPEC,
|
|
104
|
+
VARTYPE,
|
|
105
|
+
WORD,
|
|
106
|
+
} from '../types/Ole32';
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Thin, lazy-loaded FFI bindings for `ole32.dll`.
|
|
110
|
+
*
|
|
111
|
+
* Each static method corresponds one-to-one with a Win32 export declared in `Symbols`.
|
|
112
|
+
* The first call to a method binds the underlying native symbol via `bun:ffi` and
|
|
113
|
+
* memoizes it on the class for subsequent calls. For bulk, up-front binding, use `Preload`.
|
|
114
|
+
*
|
|
115
|
+
* Symbols are defined with explicit `FFIType` signatures and kept alphabetized.
|
|
116
|
+
* You normally do not access `Symbols` directly; call the static methods or preload
|
|
117
|
+
* a subset for hot paths.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* import Ole32 from './structs/Ole32';
|
|
122
|
+
*
|
|
123
|
+
* const comVersion = Ole32.CoBuildVersion();
|
|
124
|
+
* const oleVersion = Ole32.OleBuildVersion();
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
class Ole32 extends Win32 {
|
|
128
|
+
protected static override readonly name = 'ole32.dll';
|
|
129
|
+
|
|
130
|
+
/** @inheritdoc */
|
|
131
|
+
protected static override readonly Symbols = {
|
|
132
|
+
BindMoniker: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
133
|
+
CoAllowSetForegroundWindow: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
134
|
+
CoBuildVersion: { args: [], returns: FFIType.u32 },
|
|
135
|
+
CoDosDateTimeToFileTime: { args: [FFIType.u16, FFIType.u16, FFIType.ptr], returns: FFIType.i32 },
|
|
136
|
+
CoFileTimeToDosDateTime: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
137
|
+
CoFreeAllLibraries: { args: [], returns: FFIType.void },
|
|
138
|
+
CoFreeLibrary: { args: [FFIType.u64], returns: FFIType.void },
|
|
139
|
+
CoGetInterceptor: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
140
|
+
CoGetObject: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
141
|
+
CoInitialize: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
142
|
+
CoInstall: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
143
|
+
CoLoadLibrary: { args: [FFIType.ptr, FFIType.i32], returns: FFIType.u64 },
|
|
144
|
+
CoRegisterMessageFilter: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
145
|
+
CoTaskMemFree: { args: [FFIType.ptr], returns: FFIType.void },
|
|
146
|
+
CreateAntiMoniker: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
147
|
+
CreateBindCtx: { args: [FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
148
|
+
CreateClassMoniker: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
149
|
+
CreateDataAdviseHolder: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
150
|
+
CreateDataCache: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
151
|
+
CreateFileMoniker: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
152
|
+
CreateGenericComposite: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
153
|
+
CreateILockBytesOnHGlobal: { args: [FFIType.u64, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
|
|
154
|
+
CreateItemMoniker: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
155
|
+
CreateObjrefMoniker: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
156
|
+
CreateOleAdviseHolder: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
157
|
+
CreatePointerMoniker: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
158
|
+
DllGetClassObject: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
159
|
+
DllRegisterServer: { args: [], returns: FFIType.i32 },
|
|
160
|
+
DoDragDrop: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
161
|
+
FmtIdToPropStgName: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
162
|
+
GetClassFile: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
163
|
+
GetConvertStg: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
164
|
+
GetHGlobalFromILockBytes: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
165
|
+
GetRunningObjectTable: { args: [FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
166
|
+
IsAccelerator: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
167
|
+
IsEqualGUID: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
168
|
+
MkParseDisplayName: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
169
|
+
MonikerCommonPrefixWith: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
170
|
+
MonikerRelativePathTo: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
171
|
+
OleBuildVersion: { args: [], returns: FFIType.u32 },
|
|
172
|
+
OleConvertIStorageToOLESTREAM: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
173
|
+
OleConvertIStorageToOLESTREAMEx: { args: [FFIType.ptr, FFIType.u16, FFIType.i32, FFIType.i32, FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
174
|
+
OleConvertOLESTREAMToIStorage: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
175
|
+
OleConvertOLESTREAMToIStorageEx: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
176
|
+
OleCreate: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
177
|
+
OleCreateDefaultHandler: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
178
|
+
OleCreateEmbeddingHelper: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
179
|
+
OleCreateEx: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
180
|
+
OleCreateFromData: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
181
|
+
OleCreateFromDataEx: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
182
|
+
OleCreateFromFile: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
183
|
+
OleCreateFromFileEx: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
184
|
+
OleCreateLink: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
185
|
+
OleCreateLinkEx: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
186
|
+
OleCreateLinkFromData: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
187
|
+
OleCreateLinkFromDataEx: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
188
|
+
OleCreateLinkToFile: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
189
|
+
OleCreateLinkToFileEx: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
190
|
+
OleCreateMenuDescriptor: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u64 },
|
|
191
|
+
OleCreateStaticFromData: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
192
|
+
OleDestroyMenuDescriptor: { args: [FFIType.u64], returns: FFIType.i32 },
|
|
193
|
+
OleDoAutoConvert: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
194
|
+
OleDraw: { args: [FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
195
|
+
OleDuplicateData: { args: [FFIType.u64, FFIType.u16, FFIType.u32], returns: FFIType.u64 },
|
|
196
|
+
OleFlushClipboard: { args: [], returns: FFIType.i32 },
|
|
197
|
+
OleGetAutoConvert: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
198
|
+
OleGetClipboard: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
199
|
+
OleGetClipboardWithEnterpriseInfo: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
200
|
+
OleGetIconOfClass: { args: [FFIType.ptr, FFIType.ptr, FFIType.i32], returns: FFIType.u64 },
|
|
201
|
+
OleGetIconOfFile: { args: [FFIType.ptr, FFIType.i32], returns: FFIType.u64 },
|
|
202
|
+
OleInitialize: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
203
|
+
OleIsCurrentClipboard: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
204
|
+
OleIsRunning: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
205
|
+
OleLoad: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
206
|
+
OleLoadFromStream: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
207
|
+
OleLockRunning: { args: [FFIType.ptr, FFIType.i32, FFIType.i32], returns: FFIType.i32 },
|
|
208
|
+
OleMetafilePictFromIconAndLabel: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.u64 },
|
|
209
|
+
OleNoteObjectVisible: { args: [FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
210
|
+
OleQueryCreateFromData: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
211
|
+
OleQueryLinkFromData: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
212
|
+
OleRegEnumFormatEtc: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
213
|
+
OleRegEnumVerbs: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
214
|
+
OleRegGetMiscStatus: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
215
|
+
OleRegGetUserType: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
216
|
+
OleRun: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
217
|
+
OleSave: { args: [FFIType.ptr, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
218
|
+
OleSaveToStream: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
219
|
+
OleSetAutoConvert: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
220
|
+
OleSetClipboard: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
221
|
+
OleSetContainedObject: { args: [FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
222
|
+
OleSetMenuDescriptor: { args: [FFIType.u64, FFIType.u64, FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
223
|
+
OleTranslateAccelerator: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
224
|
+
OleUninitialize: { args: [], returns: FFIType.void },
|
|
225
|
+
PropStgNameToFmtId: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
226
|
+
PropVariantChangeType: { args: [FFIType.ptr, FFIType.ptr, FFIType.i32, FFIType.u16], returns: FFIType.i32 },
|
|
227
|
+
ReadClassStg: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
228
|
+
ReadClassStm: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
229
|
+
ReadFmtUserTypeStg: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
230
|
+
ReleaseStgMedium: { args: [FFIType.ptr], returns: FFIType.void },
|
|
231
|
+
SetConvertStg: { args: [FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
232
|
+
StgConvertPropertyToVariant: { args: [FFIType.ptr, FFIType.u16, FFIType.ptr, FFIType.ptr], returns: FFIType.u8 },
|
|
233
|
+
StgConvertVariantToProperty: { args: [FFIType.ptr, FFIType.u16, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u8, FFIType.ptr], returns: FFIType.ptr },
|
|
234
|
+
StgCreateDocfile: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
235
|
+
StgCreateDocfileOnILockBytes: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
236
|
+
StgCreatePropSetStg: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
237
|
+
StgCreatePropStg: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
238
|
+
StgCreateStorageEx: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
239
|
+
StgGetIFillLockBytesOnFile: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
240
|
+
StgGetIFillLockBytesOnILockBytes: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
241
|
+
StgIsStorageFile: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
242
|
+
StgIsStorageILockBytes: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
243
|
+
StgOpenAsyncDocfileOnIFillLockBytes: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
244
|
+
StgOpenPropStg: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
245
|
+
StgOpenStorage: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
246
|
+
StgOpenStorageEx: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
247
|
+
StgOpenStorageOnILockBytes: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
248
|
+
StgPropertyLengthAsVariant: { args: [FFIType.ptr, FFIType.u32, FFIType.u16, FFIType.u8], returns: FFIType.u32 },
|
|
249
|
+
StgSetTimes: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
250
|
+
WriteClassStg: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
251
|
+
WriteClassStm: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
252
|
+
WriteFmtUserTypeStg: { args: [FFIType.ptr, FFIType.u16, FFIType.ptr], returns: FFIType.i32 },
|
|
253
|
+
} as const satisfies Record<string, FFIFunction>;
|
|
254
|
+
|
|
255
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-bindmoniker
|
|
256
|
+
public static BindMoniker(pmk: LPMONIKER, grfOpt: DWORD, iidResult: REFIID, ppvResult: LPLPVOID): HRESULT {
|
|
257
|
+
return Ole32.Load('BindMoniker')(pmk, grfOpt, iidResult, ppvResult);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-coallowsetforegroundwindow
|
|
261
|
+
public static CoAllowSetForegroundWindow(pUnk: LPUNKNOWN, lpvReserved: LPVOID | NULL): HRESULT {
|
|
262
|
+
return Ole32.Load('CoAllowSetForegroundWindow')(pUnk, lpvReserved);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-cobuildversion
|
|
266
|
+
public static CoBuildVersion(): DWORD {
|
|
267
|
+
return Ole32.Load('CoBuildVersion')();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-codosdatetimetofiletime
|
|
271
|
+
public static CoDosDateTimeToFileTime(nDosDate: WORD, nDosTime: WORD, lpFileTime: FILETIME): BOOL {
|
|
272
|
+
return Ole32.Load('CoDosDateTimeToFileTime')(nDosDate, nDosTime, lpFileTime);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-cofiletimetodosdatetime
|
|
276
|
+
public static CoFileTimeToDosDateTime(lpFileTime: FILETIME, lpDosDate: LPWORD, lpDosTime: LPWORD): BOOL {
|
|
277
|
+
return Ole32.Load('CoFileTimeToDosDateTime')(lpFileTime, lpDosDate, lpDosTime);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-cofreealllibraries
|
|
281
|
+
public static CoFreeAllLibraries(): void {
|
|
282
|
+
return Ole32.Load('CoFreeAllLibraries')();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-cofreelibrary
|
|
286
|
+
public static CoFreeLibrary(hInst: HINSTANCE): void {
|
|
287
|
+
return Ole32.Load('CoFreeLibrary')(hInst);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/callobj/nf-callobj-cogetinterceptor
|
|
291
|
+
public static CoGetInterceptor(iidIntercepted: REFIID, punkOuter: LPUNKNOWN, iid: REFIID, ppv: LPLPVOID): HRESULT {
|
|
292
|
+
return Ole32.Load('CoGetInterceptor')(iidIntercepted, punkOuter, iid, ppv);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-cogetobject
|
|
296
|
+
public static CoGetObject(pszName: LPCWSTR, pBindOptions: BIND_OPTS | NULL, riid: REFIID, ppv: LPLPVOID): HRESULT {
|
|
297
|
+
return Ole32.Load('CoGetObject')(pszName, pBindOptions, riid, ppv);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-coinitialize
|
|
301
|
+
public static CoInitialize(pvReserved: LPVOID | NULL): HRESULT {
|
|
302
|
+
return Ole32.Load('CoInitialize')(pvReserved);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-coinstall
|
|
306
|
+
public static CoInstall(pbc: LPBC, dwFlags: DWORD, pClassSpec: uCLSSPEC, pQuery: QUERYCONTEXT, pszCodeBase: LPWSTR): HRESULT {
|
|
307
|
+
return Ole32.Load('CoInstall')(pbc, dwFlags, pClassSpec, pQuery, pszCodeBase);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-coloadlibrary
|
|
311
|
+
public static CoLoadLibrary(lpszLibName: LPOLESTR, bAutoFree: BOOL): HINSTANCE {
|
|
312
|
+
return Ole32.Load('CoLoadLibrary')(lpszLibName, bAutoFree);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-coregistermessagefilter
|
|
316
|
+
public static CoRegisterMessageFilter(lpMessageFilter: LPMESSAGEFILTER | NULL, lplpMessageFilter: PPMESSAGEFILTER | NULL): HRESULT {
|
|
317
|
+
return Ole32.Load('CoRegisterMessageFilter')(lpMessageFilter, lplpMessageFilter);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree
|
|
321
|
+
public static CoTaskMemFree(pv: LPVOID | NULL): void {
|
|
322
|
+
return Ole32.Load('CoTaskMemFree')(pv);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createantimoniker
|
|
326
|
+
public static CreateAntiMoniker(ppmk: PPMONIKER): HRESULT {
|
|
327
|
+
return Ole32.Load('CreateAntiMoniker')(ppmk);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createbindctx
|
|
331
|
+
public static CreateBindCtx(reserved: DWORD, ppbc: PPBC): HRESULT {
|
|
332
|
+
return Ole32.Load('CreateBindCtx')(reserved, ppbc);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createclassmoniker
|
|
336
|
+
public static CreateClassMoniker(rclsid: REFCLSID, ppmk: PPMONIKER): HRESULT {
|
|
337
|
+
return Ole32.Load('CreateClassMoniker')(rclsid, ppmk);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createdataadviseholder
|
|
341
|
+
public static CreateDataAdviseHolder(ppDAHolder: PPDATAADVISEHOLDER): HRESULT {
|
|
342
|
+
return Ole32.Load('CreateDataAdviseHolder')(ppDAHolder);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createdatacache
|
|
346
|
+
public static CreateDataCache(pUnkOuter: LPUNKNOWN | NULL, rclsid: REFCLSID, iid: REFIID, ppv: LPLPVOID): HRESULT {
|
|
347
|
+
return Ole32.Load('CreateDataCache')(pUnkOuter, rclsid, iid, ppv);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createfilemoniker
|
|
351
|
+
public static CreateFileMoniker(lpszPathName: LPCOLESTR, ppmk: PPMONIKER): HRESULT {
|
|
352
|
+
return Ole32.Load('CreateFileMoniker')(lpszPathName, ppmk);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-creategenericcomposite
|
|
356
|
+
public static CreateGenericComposite(pmkFirst: LPMONIKER | NULL, pmkRest: LPMONIKER | NULL, ppmkComposite: PPMONIKER): HRESULT {
|
|
357
|
+
return Ole32.Load('CreateGenericComposite')(pmkFirst, pmkRest, ppmkComposite);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-createilockbytesonhglobal
|
|
361
|
+
public static CreateILockBytesOnHGlobal(hGlobal: HGLOBAL | 0n, fDeleteOnRelease: BOOL, pplkbyt: PPLOCKBYTES): HRESULT {
|
|
362
|
+
return Ole32.Load('CreateILockBytesOnHGlobal')(hGlobal, fDeleteOnRelease, pplkbyt);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createitemmoniker
|
|
366
|
+
public static CreateItemMoniker(lpszDelim: LPCOLESTR, lpszItem: LPCOLESTR, ppmk: PPMONIKER): HRESULT {
|
|
367
|
+
return Ole32.Load('CreateItemMoniker')(lpszDelim, lpszItem, ppmk);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createobjrefmoniker
|
|
371
|
+
public static CreateObjrefMoniker(punk: LPUNKNOWN | NULL, ppmk: PPMONIKER): HRESULT {
|
|
372
|
+
return Ole32.Load('CreateObjrefMoniker')(punk, ppmk);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-createoleadviseholder
|
|
376
|
+
public static CreateOleAdviseHolder(ppOAHolder: PPOLEADVISEHOLDER): HRESULT {
|
|
377
|
+
return Ole32.Load('CreateOleAdviseHolder')(ppOAHolder);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-createpointermoniker
|
|
381
|
+
public static CreatePointerMoniker(punk: LPUNKNOWN | NULL, ppmk: PPMONIKER): HRESULT {
|
|
382
|
+
return Ole32.Load('CreatePointerMoniker')(punk, ppmk);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-dllgetclassobject
|
|
386
|
+
public static DllGetClassObject(rclsid: REFCLSID, riid: REFIID, ppv: LPLPVOID): HRESULT {
|
|
387
|
+
return Ole32.Load('DllGetClassObject')(rclsid, riid, ppv);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/olectl/nf-olectl-dllregisterserver
|
|
391
|
+
public static DllRegisterServer(): HRESULT {
|
|
392
|
+
return Ole32.Load('DllRegisterServer')();
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-dodragdrop
|
|
396
|
+
public static DoDragDrop(pDataObj: LPDATAOBJECT, pDropSource: LPDROPSOURCE, dwOKEffects: DWORD, pdwEffect: LPDWORD): HRESULT {
|
|
397
|
+
return Ole32.Load('DoDragDrop')(pDataObj, pDropSource, dwOKEffects, pdwEffect);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-fmtidtopropstgname
|
|
401
|
+
public static FmtIdToPropStgName(pfmtid: FMTID, oszName: LPOLESTR): HRESULT {
|
|
402
|
+
return Ole32.Load('FmtIdToPropStgName')(pfmtid, oszName);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-getclassfile
|
|
406
|
+
public static GetClassFile(szFilename: LPCOLESTR, pclsid: CLSID): HRESULT {
|
|
407
|
+
return Ole32.Load('GetClassFile')(szFilename, pclsid);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-getconvertstg
|
|
411
|
+
public static GetConvertStg(pStg: LPSTORAGE): HRESULT {
|
|
412
|
+
return Ole32.Load('GetConvertStg')(pStg);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-gethglobalfromilockbytes
|
|
416
|
+
public static GetHGlobalFromILockBytes(plkbyt: LPLOCKBYTES, phglobal: PHGLOBAL): HRESULT {
|
|
417
|
+
return Ole32.Load('GetHGlobalFromILockBytes')(plkbyt, phglobal);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-getrunningobjecttable
|
|
421
|
+
public static GetRunningObjectTable(reserved: DWORD, pprot: PPRUNNINGOBJECTTABLE): HRESULT {
|
|
422
|
+
return Ole32.Load('GetRunningObjectTable')(reserved, pprot);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-isaccelerator
|
|
426
|
+
public static IsAccelerator(hAccel: HACCEL, cAccelEntries: INT, lpMsg: LPMSG, lpwCmd: LPWORD): BOOL {
|
|
427
|
+
return Ole32.Load('IsAccelerator')(hAccel, cAccelEntries, lpMsg, lpwCmd);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/guiddef/nf-guiddef-isequalguid
|
|
431
|
+
public static IsEqualGUID(rguid1: REFGUID, rguid2: REFGUID): BOOL {
|
|
432
|
+
return Ole32.Load('IsEqualGUID')(rguid1, rguid2);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-mkparsedisplayname
|
|
436
|
+
public static MkParseDisplayName(pbc: LPBC, szUserName: LPCOLESTR, pchEaten: PULONG, ppmk: PPMONIKER): HRESULT {
|
|
437
|
+
return Ole32.Load('MkParseDisplayName')(pbc, szUserName, pchEaten, ppmk);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-monikercommonprefixwith
|
|
441
|
+
public static MonikerCommonPrefixWith(pmkThis: LPMONIKER, pmkOther: LPMONIKER, ppmkCommon: PPMONIKER): HRESULT {
|
|
442
|
+
return Ole32.Load('MonikerCommonPrefixWith')(pmkThis, pmkOther, ppmkCommon);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-monikerrelativepathto
|
|
446
|
+
public static MonikerRelativePathTo(pmkSrc: LPMONIKER, pmkDest: LPMONIKER, ppmkRelPath: PPMONIKER, dwReserved: BOOL): HRESULT {
|
|
447
|
+
return Ole32.Load('MonikerRelativePathTo')(pmkSrc, pmkDest, ppmkRelPath, dwReserved);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olebuildversion
|
|
451
|
+
public static OleBuildVersion(): DWORD {
|
|
452
|
+
return Ole32.Load('OleBuildVersion')();
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleconvertistoragetoolestream
|
|
456
|
+
public static OleConvertIStorageToOLESTREAM(pstg: LPSTORAGE, lpolestream: LPOLESTREAM): HRESULT {
|
|
457
|
+
return Ole32.Load('OleConvertIStorageToOLESTREAM')(pstg, lpolestream);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleconvertistoragetoolestreamex
|
|
461
|
+
public static OleConvertIStorageToOLESTREAMEx(pstg: LPSTORAGE, cfFormat: CLIPFORMAT, lWidth: LONG, lHeight: LONG, dwSize: DWORD, pmedium: LPSTGMEDIUM, polestm: LPOLESTREAM): HRESULT {
|
|
462
|
+
return Ole32.Load('OleConvertIStorageToOLESTREAMEx')(pstg, cfFormat, lWidth, lHeight, dwSize, pmedium, polestm);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleconvertolestreamtoistorage
|
|
466
|
+
public static OleConvertOLESTREAMToIStorage(lpolestream: LPOLESTREAM, pstg: LPSTORAGE, ptd: DVTARGETDEVICE): HRESULT {
|
|
467
|
+
return Ole32.Load('OleConvertOLESTREAMToIStorage')(lpolestream, pstg, ptd);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleconvertolestreamtoistorageex
|
|
471
|
+
public static OleConvertOLESTREAMToIStorageEx(polestm: LPOLESTREAM, pstg: LPSTORAGE, pcfFormat: LPWORD, plwWidth: LPLONG, plHeight: LPLONG, pdwSize: LPDWORD, pmedium: LPSTGMEDIUM): HRESULT {
|
|
472
|
+
return Ole32.Load('OleConvertOLESTREAMToIStorageEx')(polestm, pstg, pcfFormat, plwWidth, plHeight, pdwSize, pmedium);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreate
|
|
476
|
+
public static OleCreate(rclsid: REFCLSID, riid: REFIID, renderopt: DWORD, pFormatEtc: LPFORMATETC, pClientSite: LPOLECLIENTSITE, pStg: LPSTORAGE, ppvObj: LPLPVOID): HRESULT {
|
|
477
|
+
return Ole32.Load('OleCreate')(rclsid, riid, renderopt, pFormatEtc, pClientSite, pStg, ppvObj);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatedefaulthandler
|
|
481
|
+
public static OleCreateDefaultHandler(clsid: REFCLSID, pUnkOuter: LPUNKNOWN, riid: REFIID, lplpObj: LPLPVOID): HRESULT {
|
|
482
|
+
return Ole32.Load('OleCreateDefaultHandler')(clsid, pUnkOuter, riid, lplpObj);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreateembeddinghelper
|
|
486
|
+
public static OleCreateEmbeddingHelper(clsid: REFCLSID, pUnkOuter: LPUNKNOWN, flags: DWORD, pCF: LPCLASSFACTORY, riid: REFIID, lplpObj: LPLPVOID): HRESULT {
|
|
487
|
+
return Ole32.Load('OleCreateEmbeddingHelper')(clsid, pUnkOuter, flags, pCF, riid, lplpObj);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreateex
|
|
491
|
+
public static OleCreateEx(
|
|
492
|
+
rclsid: REFCLSID,
|
|
493
|
+
riid: REFIID,
|
|
494
|
+
dwFlags: DWORD,
|
|
495
|
+
renderopt: DWORD,
|
|
496
|
+
cFormats: ULONG,
|
|
497
|
+
rgAdvf: LPDWORD,
|
|
498
|
+
rgFormatEtc: LPFORMATETC,
|
|
499
|
+
lpAdviseSink: IAdviseSink,
|
|
500
|
+
rgdwConnection: LPDWORD,
|
|
501
|
+
pClientSite: LPOLECLIENTSITE,
|
|
502
|
+
pStg: LPSTORAGE,
|
|
503
|
+
ppvObj: LPLPVOID,
|
|
504
|
+
): HRESULT {
|
|
505
|
+
return Ole32.Load('OleCreateEx')(rclsid, riid, dwFlags, renderopt, cFormats, rgAdvf, rgFormatEtc, lpAdviseSink, rgdwConnection, pClientSite, pStg, ppvObj);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatefromdata
|
|
509
|
+
public static OleCreateFromData(pSrcDataObj: LPDATAOBJECT, riid: REFIID, renderopt: DWORD, pFormatEtc: LPFORMATETC, pClientSite: LPOLECLIENTSITE, pStg: LPSTORAGE, ppvObj: LPLPVOID): HRESULT {
|
|
510
|
+
return Ole32.Load('OleCreateFromData')(pSrcDataObj, riid, renderopt, pFormatEtc, pClientSite, pStg, ppvObj);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatefromdataex
|
|
514
|
+
public static OleCreateFromDataEx(
|
|
515
|
+
pSrcDataObj: LPDATAOBJECT,
|
|
516
|
+
riid: REFIID,
|
|
517
|
+
dwFlags: DWORD,
|
|
518
|
+
renderopt: DWORD,
|
|
519
|
+
cFormats: ULONG,
|
|
520
|
+
rgAdvf: LPDWORD,
|
|
521
|
+
rgFormatEtc: LPFORMATETC,
|
|
522
|
+
lpAdviseSink: IAdviseSink,
|
|
523
|
+
rgdwConnection: LPDWORD,
|
|
524
|
+
pClientSite: LPOLECLIENTSITE,
|
|
525
|
+
pStg: LPSTORAGE,
|
|
526
|
+
ppvObj: LPLPVOID,
|
|
527
|
+
): HRESULT {
|
|
528
|
+
return Ole32.Load('OleCreateFromDataEx')(pSrcDataObj, riid, dwFlags, renderopt, cFormats, rgAdvf, rgFormatEtc, lpAdviseSink, rgdwConnection, pClientSite, pStg, ppvObj);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatefromfile
|
|
532
|
+
public static OleCreateFromFile(rclsid: REFCLSID, lpszFileName: LPCOLESTR, riid: REFIID, renderopt: DWORD, lpFormatEtc: LPFORMATETC, pClientSite: LPOLECLIENTSITE, pStg: LPSTORAGE, ppvObj: LPLPVOID): HRESULT {
|
|
533
|
+
return Ole32.Load('OleCreateFromFile')(rclsid, lpszFileName, riid, renderopt, lpFormatEtc, pClientSite, pStg, ppvObj);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatefromfileex
|
|
537
|
+
public static OleCreateFromFileEx(
|
|
538
|
+
rclsid: REFCLSID,
|
|
539
|
+
lpszFileName: LPCOLESTR,
|
|
540
|
+
riid: REFIID,
|
|
541
|
+
dwFlags: DWORD,
|
|
542
|
+
renderopt: DWORD,
|
|
543
|
+
cFormats: ULONG,
|
|
544
|
+
rgAdvf: LPDWORD,
|
|
545
|
+
rgFormatEtc: LPFORMATETC,
|
|
546
|
+
lpAdviseSink: IAdviseSink,
|
|
547
|
+
rgdwConnection: LPDWORD,
|
|
548
|
+
pClientSite: LPOLECLIENTSITE,
|
|
549
|
+
pStg: LPSTORAGE,
|
|
550
|
+
ppvObj: LPLPVOID,
|
|
551
|
+
): HRESULT {
|
|
552
|
+
return Ole32.Load('OleCreateFromFileEx')(rclsid, lpszFileName, riid, dwFlags, renderopt, cFormats, rgAdvf, rgFormatEtc, lpAdviseSink, rgdwConnection, pClientSite, pStg, ppvObj);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatelink
|
|
556
|
+
public static OleCreateLink(pmkLinkSrc: LPMONIKER, riid: REFIID, renderopt: DWORD, lpFormatEtc: LPFORMATETC, pClientSite: LPOLECLIENTSITE, pStg: LPSTORAGE, ppvObj: LPLPVOID): HRESULT {
|
|
557
|
+
return Ole32.Load('OleCreateLink')(pmkLinkSrc, riid, renderopt, lpFormatEtc, pClientSite, pStg, ppvObj);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatelinkex
|
|
561
|
+
public static OleCreateLinkEx(
|
|
562
|
+
pmkLinkSrc: LPMONIKER,
|
|
563
|
+
riid: REFIID,
|
|
564
|
+
dwFlags: DWORD,
|
|
565
|
+
renderopt: DWORD,
|
|
566
|
+
cFormats: ULONG,
|
|
567
|
+
rgAdvf: LPDWORD,
|
|
568
|
+
rgFormatEtc: LPFORMATETC,
|
|
569
|
+
lpAdviseSink: IAdviseSink,
|
|
570
|
+
rgdwConnection: LPDWORD,
|
|
571
|
+
pClientSite: LPOLECLIENTSITE,
|
|
572
|
+
pStg: LPSTORAGE,
|
|
573
|
+
ppvObj: LPLPVOID,
|
|
574
|
+
): HRESULT {
|
|
575
|
+
return Ole32.Load('OleCreateLinkEx')(pmkLinkSrc, riid, dwFlags, renderopt, cFormats, rgAdvf, rgFormatEtc, lpAdviseSink, rgdwConnection, pClientSite, pStg, ppvObj);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatelinkfromdata
|
|
579
|
+
public static OleCreateLinkFromData(pSrcDataObj: LPDATAOBJECT, riid: REFIID, renderopt: DWORD, pFormatEtc: LPFORMATETC, pClientSite: LPOLECLIENTSITE, pStg: LPSTORAGE, ppvObj: LPLPVOID): HRESULT {
|
|
580
|
+
return Ole32.Load('OleCreateLinkFromData')(pSrcDataObj, riid, renderopt, pFormatEtc, pClientSite, pStg, ppvObj);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatelinkfromdataex
|
|
584
|
+
public static OleCreateLinkFromDataEx(
|
|
585
|
+
pSrcDataObj: LPDATAOBJECT,
|
|
586
|
+
riid: REFIID,
|
|
587
|
+
dwFlags: DWORD,
|
|
588
|
+
renderopt: DWORD,
|
|
589
|
+
cFormats: ULONG,
|
|
590
|
+
rgAdvf: LPDWORD,
|
|
591
|
+
rgFormatEtc: LPFORMATETC,
|
|
592
|
+
lpAdviseSink: IAdviseSink,
|
|
593
|
+
rgdwConnection: LPDWORD,
|
|
594
|
+
pClientSite: LPOLECLIENTSITE,
|
|
595
|
+
pStg: LPSTORAGE,
|
|
596
|
+
ppvObj: LPLPVOID,
|
|
597
|
+
): HRESULT {
|
|
598
|
+
return Ole32.Load('OleCreateLinkFromDataEx')(pSrcDataObj, riid, dwFlags, renderopt, cFormats, rgAdvf, rgFormatEtc, lpAdviseSink, rgdwConnection, pClientSite, pStg, ppvObj);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatelinktofile
|
|
602
|
+
public static OleCreateLinkToFile(lpszFileName: LPCOLESTR, riid: REFIID, renderopt: DWORD, lpFormatEtc: LPFORMATETC, pClientSite: LPOLECLIENTSITE, pStg: LPSTORAGE, ppvObj: LPLPVOID): HRESULT {
|
|
603
|
+
return Ole32.Load('OleCreateLinkToFile')(lpszFileName, riid, renderopt, lpFormatEtc, pClientSite, pStg, ppvObj);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatelinktofileex
|
|
607
|
+
public static OleCreateLinkToFileEx(
|
|
608
|
+
lpszFileName: LPCOLESTR,
|
|
609
|
+
riid: REFIID,
|
|
610
|
+
dwFlags: DWORD,
|
|
611
|
+
renderopt: DWORD,
|
|
612
|
+
cFormats: ULONG,
|
|
613
|
+
rgAdvf: LPDWORD,
|
|
614
|
+
rgFormatEtc: LPFORMATETC,
|
|
615
|
+
lpAdviseSink: IAdviseSink,
|
|
616
|
+
rgdwConnection: LPDWORD,
|
|
617
|
+
pClientSite: LPOLECLIENTSITE,
|
|
618
|
+
pStg: LPSTORAGE,
|
|
619
|
+
ppvObj: LPLPVOID,
|
|
620
|
+
): HRESULT {
|
|
621
|
+
return Ole32.Load('OleCreateLinkToFileEx')(lpszFileName, riid, dwFlags, renderopt, cFormats, rgAdvf, rgFormatEtc, lpAdviseSink, rgdwConnection, pClientSite, pStg, ppvObj);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatemenudescriptor
|
|
625
|
+
public static OleCreateMenuDescriptor(hmenuCombined: HMENU, lpMenuWidths: LPOLEMENUGROUPWIDTHS): HOLEMENU {
|
|
626
|
+
return Ole32.Load('OleCreateMenuDescriptor')(hmenuCombined, lpMenuWidths);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olecreatestaticfromdata
|
|
630
|
+
public static OleCreateStaticFromData(pSrcDataObj: LPDATAOBJECT, iid: REFIID, renderopt: DWORD, pFormatEtc: LPFORMATETC, pClientSite: LPOLECLIENTSITE, pStg: LPSTORAGE, ppvObj: LPLPVOID): HRESULT {
|
|
631
|
+
return Ole32.Load('OleCreateStaticFromData')(pSrcDataObj, iid, renderopt, pFormatEtc, pClientSite, pStg, ppvObj);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oledestroymenudescriptor
|
|
635
|
+
public static OleDestroyMenuDescriptor(holemenu: HOLEMENU): HRESULT {
|
|
636
|
+
return Ole32.Load('OleDestroyMenuDescriptor')(holemenu);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oledoautoconvert
|
|
640
|
+
public static OleDoAutoConvert(pStg: LPSTORAGE, pClsidNew: LPCLSID): HRESULT {
|
|
641
|
+
return Ole32.Load('OleDoAutoConvert')(pStg, pClsidNew);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oledraw
|
|
645
|
+
public static OleDraw(pUnknown: LPUNKNOWN, dwAspect: DWORD, hdcDraw: HDC, lprcBounds: LPCRECT): HRESULT {
|
|
646
|
+
return Ole32.Load('OleDraw')(pUnknown, dwAspect, hdcDraw, lprcBounds);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleduplicatedata
|
|
650
|
+
public static OleDuplicateData(hSrc: HANDLE, cfFormat: CLIPFORMAT, uiFlags: UINT): HANDLE {
|
|
651
|
+
return Ole32.Load('OleDuplicateData')(hSrc, cfFormat, uiFlags);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleflushclipboard
|
|
655
|
+
public static OleFlushClipboard(): HRESULT {
|
|
656
|
+
return Ole32.Load('OleFlushClipboard')();
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olegetautoconvert
|
|
660
|
+
public static OleGetAutoConvert(clsidOld: REFCLSID, pClsidNew: LPCLSID): HRESULT {
|
|
661
|
+
return Ole32.Load('OleGetAutoConvert')(clsidOld, pClsidNew);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olegetclipboard
|
|
665
|
+
public static OleGetClipboard(ppDataObj: PPDATAOBJECT): HRESULT {
|
|
666
|
+
return Ole32.Load('OleGetClipboard')(ppDataObj);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olegetclipboardwithenterpriseinfo
|
|
670
|
+
public static OleGetClipboardWithEnterpriseInfo(dataObject: PPDATAOBJECT, dataEnterpriseId: PPWSTR, sourceDescription: PPWSTR, targetDescription: PPWSTR, dataDescription: PPWSTR): HRESULT {
|
|
671
|
+
return Ole32.Load('OleGetClipboardWithEnterpriseInfo')(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olegeticonofclass
|
|
675
|
+
public static OleGetIconOfClass(rclsid: REFCLSID, lpszLabel: LPOLESTR | NULL, fUseTypeAsLabel: BOOL): HGLOBAL {
|
|
676
|
+
return Ole32.Load('OleGetIconOfClass')(rclsid, lpszLabel, fUseTypeAsLabel);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olegeticonoffile
|
|
680
|
+
public static OleGetIconOfFile(lpszPath: LPOLESTR, fUseFileAsLabel: BOOL): HGLOBAL {
|
|
681
|
+
return Ole32.Load('OleGetIconOfFile')(lpszPath, fUseFileAsLabel);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleinitialize
|
|
685
|
+
public static OleInitialize(pvReserved: LPVOID | NULL): HRESULT {
|
|
686
|
+
return Ole32.Load('OleInitialize')(pvReserved);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleiscurrentclipboard
|
|
690
|
+
public static OleIsCurrentClipboard(pDataObj: LPDATAOBJECT): HRESULT {
|
|
691
|
+
return Ole32.Load('OleIsCurrentClipboard')(pDataObj);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleisrunning
|
|
695
|
+
public static OleIsRunning(pObject: LPOLEOBJECT): BOOL {
|
|
696
|
+
return Ole32.Load('OleIsRunning')(pObject);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleload
|
|
700
|
+
public static OleLoad(pStg: LPSTORAGE, riid: REFIID, pClientSite: LPOLECLIENTSITE, ppvObj: LPLPVOID): HRESULT {
|
|
701
|
+
return Ole32.Load('OleLoad')(pStg, riid, pClientSite, ppvObj);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleloadfromstream
|
|
705
|
+
public static OleLoadFromStream(pStm: LPSTREAM, iidInterface: REFIID, ppvObj: LPLPVOID): HRESULT {
|
|
706
|
+
return Ole32.Load('OleLoadFromStream')(pStm, iidInterface, ppvObj);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olelockrunning
|
|
710
|
+
public static OleLockRunning(pUnknown: LPUNKNOWN, fLock: BOOL, fLastUnlockCloses: BOOL): HRESULT {
|
|
711
|
+
return Ole32.Load('OleLockRunning')(pUnknown, fLock, fLastUnlockCloses);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olemetafilepictfromiconandlabel
|
|
715
|
+
public static OleMetafilePictFromIconAndLabel(hIcon: HICON, lpszLabel: LPOLESTR, lpszSourceFile: LPOLESTR, iIconIndex: UINT): HGLOBAL {
|
|
716
|
+
return Ole32.Load('OleMetafilePictFromIconAndLabel')(hIcon, lpszLabel, lpszSourceFile, iIconIndex);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olenoteobjectvisible
|
|
720
|
+
public static OleNoteObjectVisible(pUnknown: LPUNKNOWN, fVisible: BOOL): HRESULT {
|
|
721
|
+
return Ole32.Load('OleNoteObjectVisible')(pUnknown, fVisible);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olequerycreatefromdata
|
|
725
|
+
public static OleQueryCreateFromData(pSrcDataObject: LPDATAOBJECT): HRESULT {
|
|
726
|
+
return Ole32.Load('OleQueryCreateFromData')(pSrcDataObject);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olequerylinkfromdata
|
|
730
|
+
public static OleQueryLinkFromData(pSrcDataObject: LPDATAOBJECT): HRESULT {
|
|
731
|
+
return Ole32.Load('OleQueryLinkFromData')(pSrcDataObject);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleregenumformatetc
|
|
735
|
+
public static OleRegEnumFormatEtc(clsid: REFCLSID, dwDirection: DWORD, ppenum: PPENUMFORMATETC): HRESULT {
|
|
736
|
+
return Ole32.Load('OleRegEnumFormatEtc')(clsid, dwDirection, ppenum);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleregenumverbs
|
|
740
|
+
public static OleRegEnumVerbs(clsid: REFCLSID, ppenum: PPENUMOLEVERB): HRESULT {
|
|
741
|
+
return Ole32.Load('OleRegEnumVerbs')(clsid, ppenum);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olereggetmiscstatus
|
|
745
|
+
public static OleRegGetMiscStatus(clsid: REFCLSID, dwAspect: DWORD, pdwStatus: LPDWORD): HRESULT {
|
|
746
|
+
return Ole32.Load('OleRegGetMiscStatus')(clsid, dwAspect, pdwStatus);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olereggetusertype
|
|
750
|
+
public static OleRegGetUserType(clsid: REFCLSID, dwFormOfType: DWORD, pszUserType: PPOLESTR): HRESULT {
|
|
751
|
+
return Ole32.Load('OleRegGetUserType')(clsid, dwFormOfType, pszUserType);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olerun
|
|
755
|
+
public static OleRun(pUnknown: LPUNKNOWN): HRESULT {
|
|
756
|
+
return Ole32.Load('OleRun')(pUnknown);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olesave
|
|
760
|
+
public static OleSave(pPS: LPPERSISTSTORAGE, pStg: LPSTORAGE, fSameAsLoad: BOOL): HRESULT {
|
|
761
|
+
return Ole32.Load('OleSave')(pPS, pStg, fSameAsLoad);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olesavetostream
|
|
765
|
+
public static OleSaveToStream(pPStm: LPPERSISTSTREAM, pStm: LPSTREAM): HRESULT {
|
|
766
|
+
return Ole32.Load('OleSaveToStream')(pPStm, pStm);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olesetautoconvert
|
|
770
|
+
public static OleSetAutoConvert(clsidOld: REFCLSID, clsidNew: REFCLSID): HRESULT {
|
|
771
|
+
return Ole32.Load('OleSetAutoConvert')(clsidOld, clsidNew);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olesetclipboard
|
|
775
|
+
public static OleSetClipboard(pDataObj: LPDATAOBJECT): HRESULT {
|
|
776
|
+
return Ole32.Load('OleSetClipboard')(pDataObj);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olesetcontainedobject
|
|
780
|
+
public static OleSetContainedObject(pUnknown: LPUNKNOWN, fContained: BOOL): HRESULT {
|
|
781
|
+
return Ole32.Load('OleSetContainedObject')(pUnknown, fContained);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-olesetmenudescriptor
|
|
785
|
+
public static OleSetMenuDescriptor(holemenu: HOLEMENU, hwndFrame: HWND, hwndActiveObject: HWND, lpFrame: LPOLEINPLACEFRAME, lpActiveObj: LPOLEINPLACEACTIVEOBJECT): HRESULT {
|
|
786
|
+
return Ole32.Load('OleSetMenuDescriptor')(holemenu, hwndFrame, hwndActiveObject, lpFrame, lpActiveObj);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oletranslateaccelerator
|
|
790
|
+
public static OleTranslateAccelerator(lpFrame: LPOLEINPLACEFRAME, lpFrameInfo: LPOLEINPLACEFRAMEINFO, lpmsg: LPMSG): HRESULT {
|
|
791
|
+
return Ole32.Load('OleTranslateAccelerator')(lpFrame, lpFrameInfo, lpmsg);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleuninitialize
|
|
795
|
+
public static OleUninitialize(): void {
|
|
796
|
+
return Ole32.Load('OleUninitialize')();
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-propstgnametofmtid
|
|
800
|
+
public static PropStgNameToFmtId(oszName: LPOLESTR, pfmtid: FMTID): HRESULT {
|
|
801
|
+
return Ole32.Load('PropStgNameToFmtId')(oszName, pfmtid);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/propvarutil/nf-propvarutil-propvariantchangetype
|
|
805
|
+
public static PropVariantChangeType(ppropvarDest: PROPVARIANT, propvarSrc: REFPROPVARIANT, flags: PROPVAR_CHANGE_FLAGS, vt: VARTYPE): HRESULT {
|
|
806
|
+
return Ole32.Load('PropVariantChangeType')(ppropvarDest, propvarSrc, flags, vt);
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-readclassstg
|
|
810
|
+
public static ReadClassStg(pStg: LPSTORAGE, pclsid: CLSID): HRESULT {
|
|
811
|
+
return Ole32.Load('ReadClassStg')(pStg, pclsid);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-readclassstm
|
|
815
|
+
public static ReadClassStm(pStm: LPSTREAM, pclsid: CLSID): HRESULT {
|
|
816
|
+
return Ole32.Load('ReadClassStm')(pStm, pclsid);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-readfmtusertypestg
|
|
820
|
+
public static ReadFmtUserTypeStg(pstg: LPSTORAGE, pcf: LPWORD, lplpszUserType: PPOLESTR | NULL): HRESULT {
|
|
821
|
+
return Ole32.Load('ReadFmtUserTypeStg')(pstg, pcf, lplpszUserType);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-registerdragdrop
|
|
825
|
+
public static RegisterDragDrop(hwnd: HWND, pDropTarget: LPDROPTARGET): HRESULT {
|
|
826
|
+
return Ole32.Load('RegisterDragDrop')(hwnd, pDropTarget);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-releasestgmedium
|
|
830
|
+
public static ReleaseStgMedium(pStgMedium: LPSTGMEDIUM): void {
|
|
831
|
+
return Ole32.Load('ReleaseStgMedium')(pStgMedium);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-revokedragdrop
|
|
835
|
+
public static RevokeDragDrop(hwnd: HWND): HRESULT {
|
|
836
|
+
return Ole32.Load('RevokeDragDrop')(hwnd);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-setconvertstg
|
|
840
|
+
public static SetConvertStg(pStg: LPSTORAGE, fConvert: BOOL): HRESULT {
|
|
841
|
+
return Ole32.Load('SetConvertStg')(pStg, fConvert);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/propidl/nf-propidl-stgconvertpropertytovariant
|
|
845
|
+
public static StgConvertPropertyToVariant(pprop: SERIALIZEDPROPERTYVALUE, CodePage: USHORT, pvar: PROPVARIANT, pma: PMemoryAllocator): BOOLEAN {
|
|
846
|
+
return Ole32.Load('StgConvertPropertyToVariant')(pprop, CodePage, pvar, pma);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/propidl/nf-propidl-stgconvertvarianttoproperty
|
|
850
|
+
public static StgConvertVariantToProperty(pvar: PROPVARIANT, CodePage: USHORT, pprop: SERIALIZEDPROPERTYVALUE | NULL, pcb: PULONG, pid: PROPID, fReserved: BOOLEAN, pcIndirect: PULONG | NULL): SERIALIZEDPROPERTYVALUE {
|
|
851
|
+
return Ole32.Load('StgConvertVariantToProperty')(pvar, CodePage, pprop, pcb, pid, fReserved, pcIndirect);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgcreatedocfile
|
|
855
|
+
public static StgCreateDocfile(pwcsName: LPCWSTR | NULL, grfMode: DWORD, reserved: DWORD, ppstgOpen: PPIStorage): HRESULT {
|
|
856
|
+
return Ole32.Load('StgCreateDocfile')(pwcsName, grfMode, reserved, ppstgOpen);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgcreatedocfileonilockbytes
|
|
860
|
+
public static StgCreateDocfileOnILockBytes(plkbyt: ILockBytes, grfMode: DWORD, reserved: DWORD, ppstgOpen: PPIStorage): HRESULT {
|
|
861
|
+
return Ole32.Load('StgCreateDocfileOnILockBytes')(plkbyt, grfMode, reserved, ppstgOpen);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgcreatepropsetstg
|
|
865
|
+
public static StgCreatePropSetStg(pStorage: LPSTORAGE, dwReserved: DWORD, ppPropSetStg: PPIPropertySetStorage): HRESULT {
|
|
866
|
+
return Ole32.Load('StgCreatePropSetStg')(pStorage, dwReserved, ppPropSetStg);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgcreatepropstg
|
|
870
|
+
public static StgCreatePropStg(pUnk: LPUNKNOWN, fmtid: REFFMTID, pclsid: CLSID, grfFlags: DWORD, dwReserved: DWORD, ppPropStg: PPIPropertyStorage): HRESULT {
|
|
871
|
+
return Ole32.Load('StgCreatePropStg')(pUnk, fmtid, pclsid, grfFlags, dwReserved, ppPropStg);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgcreatestorageex
|
|
875
|
+
public static StgCreateStorageEx(pwcsName: LPCWSTR | NULL, grfMode: DWORD, stgfmt: DWORD, grfAttrs: DWORD, pStgOptions: STGOPTIONS | NULL, pSecurityDescriptor: PSECURITY_DESCRIPTOR | NULL, riid: REFIID, ppObjectOpen: PPVOID): HRESULT {
|
|
876
|
+
return Ole32.Load('StgCreateStorageEx')(pwcsName, grfMode, stgfmt, grfAttrs, pStgOptions, pSecurityDescriptor, riid, ppObjectOpen);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-stggetifilllockbytesonfile
|
|
880
|
+
public static StgGetIFillLockBytesOnFile(pwcsName: LPCOLESTR, ppflb: PPIFillLockBytes): HRESULT {
|
|
881
|
+
return Ole32.Load('StgGetIFillLockBytesOnFile')(pwcsName, ppflb);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-stggetifilllockbytesonilockbytes
|
|
885
|
+
public static StgGetIFillLockBytesOnILockBytes(pilb: ILockBytes, ppflb: PPIFillLockBytes): HRESULT {
|
|
886
|
+
return Ole32.Load('StgGetIFillLockBytesOnILockBytes')(pilb, ppflb);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgisstoragefile
|
|
890
|
+
public static StgIsStorageFile(pwcsName: LPCWSTR): HRESULT {
|
|
891
|
+
return Ole32.Load('StgIsStorageFile')(pwcsName);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgisstorageilockbytes
|
|
895
|
+
public static StgIsStorageILockBytes(plkbyt: ILockBytes): HRESULT {
|
|
896
|
+
return Ole32.Load('StgIsStorageILockBytes')(plkbyt);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-stgopenasyncdocfileonifilllockbytes
|
|
900
|
+
public static StgOpenAsyncDocfileOnIFillLockBytes(pflb: IFillLockBytes, grfMode: DWORD, asyncFlags: DWORD, ppstgOpen: PPIStorage): HRESULT {
|
|
901
|
+
return Ole32.Load('StgOpenAsyncDocfileOnIFillLockBytes')(pflb, grfMode, asyncFlags, ppstgOpen);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgopenpropstg
|
|
905
|
+
public static StgOpenPropStg(pUnk: LPUNKNOWN, fmtid: REFFMTID, grfFlags: DWORD, dwReserved: DWORD, ppPropStg: PPIPropertyStorage): HRESULT {
|
|
906
|
+
return Ole32.Load('StgOpenPropStg')(pUnk, fmtid, grfFlags, dwReserved, ppPropStg);
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgopenstorage
|
|
910
|
+
public static StgOpenStorage(pwcsName: LPCWSTR | NULL, pstgPriority: IStorage | NULL, grfMode: DWORD, snbExclude: SNB | NULL, reserved: DWORD, ppstgOpen: PPIStorage): HRESULT {
|
|
911
|
+
return Ole32.Load('StgOpenStorage')(pwcsName, pstgPriority, grfMode, snbExclude, reserved, ppstgOpen);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgopenstorageex
|
|
915
|
+
public static StgOpenStorageEx(pwcsName: LPCWSTR, grfMode: DWORD, stgfmt: DWORD, grfAttrs: DWORD, pStgOptions: STGOPTIONS | NULL, pSecurityDescriptor: PSECURITY_DESCRIPTOR | NULL, riid: REFIID, ppObjectOpen: PPVOID): HRESULT {
|
|
916
|
+
return Ole32.Load('StgOpenStorageEx')(pwcsName, grfMode, stgfmt, grfAttrs, pStgOptions, pSecurityDescriptor, riid, ppObjectOpen);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgopenstorageonilockbytes
|
|
920
|
+
public static StgOpenStorageOnILockBytes(plkbyt: ILockBytes, pstgPriority: IStorage | NULL, grfMode: DWORD, snbExclude: SNB | NULL, reserved: DWORD, ppstgOpen: PPIStorage): HRESULT {
|
|
921
|
+
return Ole32.Load('StgOpenStorageOnILockBytes')(plkbyt, pstgPriority, grfMode, snbExclude, reserved, ppstgOpen);
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/propapi/nf-propapi-stgpropertylengthasvariant
|
|
925
|
+
public static StgPropertyLengthAsVariant(pProp: SERIALIZEDPROPERTYVALUE, cbProp: ULONG, CodePage: USHORT, bReserved: BYTE): ULONG {
|
|
926
|
+
return Ole32.Load('StgPropertyLengthAsVariant')(pProp, cbProp, CodePage, bReserved);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-stgsettimes
|
|
930
|
+
public static StgSetTimes(lpszName: LPCWSTR, pctime: FILETIME | NULL, patime: FILETIME | NULL, pmtime: FILETIME | NULL): HRESULT {
|
|
931
|
+
return Ole32.Load('StgSetTimes')(lpszName, pctime, patime, pmtime);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-writeclassstg
|
|
935
|
+
public static WriteClassStg(pStg: LPSTORAGE, rclsid: REFCLSID): HRESULT {
|
|
936
|
+
return Ole32.Load('WriteClassStg')(pStg, rclsid);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/coml2api/nf-coml2api-writeclassstm
|
|
940
|
+
public static WriteClassStm(pStm: LPSTREAM, rclsid: REFCLSID): HRESULT {
|
|
941
|
+
return Ole32.Load('WriteClassStm')(pStm, rclsid);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-writefmtusertypestg
|
|
945
|
+
public static WriteFmtUserTypeStg(pstg: LPSTORAGE, cf: CLIPFORMAT, lpszUserType: LPOLESTR): HRESULT {
|
|
946
|
+
return Ole32.Load('WriteFmtUserTypeStg')(pstg, cf, lpszUserType);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
export default Ole32;
|
package/types/Ole32.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { Pointer } from 'bun:ffi';
|
|
2
|
+
|
|
3
|
+
import type { WORD } from '@bun-win32/core';
|
|
4
|
+
|
|
5
|
+
export type { BOOL, BOOLEAN, BYTE, DWORD, HANDLE, HINSTANCE, HRESULT, HWND, INT, LONG, LPCWSTR, LPDWORD, LPVOID, LPWSTR, NULL, PULONG, UINT, ULONG, USHORT, WORD } from '@bun-win32/core';
|
|
6
|
+
|
|
7
|
+
export const CCH_MAX_PROPSTG_NAME = 31;
|
|
8
|
+
|
|
9
|
+
export enum OleRender {
|
|
10
|
+
OLERENDER_ASIS = 3,
|
|
11
|
+
OLERENDER_DRAW = 1,
|
|
12
|
+
OLERENDER_FORMAT = 2,
|
|
13
|
+
OLERENDER_NONE = 0,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum StorageFormat {
|
|
17
|
+
STGFMT_ANY = 4,
|
|
18
|
+
STGFMT_DOCFILE = 5,
|
|
19
|
+
STGFMT_FILE = 3,
|
|
20
|
+
STGFMT_NATIVE = 1,
|
|
21
|
+
STGFMT_STORAGE = 0,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum StorageMode {
|
|
25
|
+
STGM_CONVERT = 0x0002_0000,
|
|
26
|
+
STGM_CREATE = 0x0000_1000,
|
|
27
|
+
STGM_DELETEONRELEASE = 0x0400_0000,
|
|
28
|
+
STGM_DIRECT = 0x0000_0000,
|
|
29
|
+
STGM_DIRECT_SWMR = 0x0040_0000,
|
|
30
|
+
STGM_FAILIFTHERE = 0x0000_0000,
|
|
31
|
+
STGM_NOSCRATCH = 0x0010_0000,
|
|
32
|
+
STGM_NOSNAPSHOT = 0x0020_0000,
|
|
33
|
+
STGM_PRIORITY = 0x0004_0000,
|
|
34
|
+
STGM_READ = 0x0000_0000,
|
|
35
|
+
STGM_READWRITE = 0x0000_0002,
|
|
36
|
+
STGM_SHARE_DENY_NONE = 0x0000_0040,
|
|
37
|
+
STGM_SHARE_DENY_READ = 0x0000_0030,
|
|
38
|
+
STGM_SHARE_DENY_WRITE = 0x0000_0020,
|
|
39
|
+
STGM_SHARE_EXCLUSIVE = 0x0000_0010,
|
|
40
|
+
STGM_SIMPLE = 0x0800_0000,
|
|
41
|
+
STGM_TRANSACTED = 0x0001_0000,
|
|
42
|
+
STGM_WRITE = 0x0000_0001,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type BIND_OPTS = Pointer;
|
|
46
|
+
export type CLIPFORMAT = WORD;
|
|
47
|
+
export type CLSID = Pointer;
|
|
48
|
+
export type DVTARGETDEVICE = Pointer;
|
|
49
|
+
export type FILETIME = Pointer;
|
|
50
|
+
export type FMTID = Pointer;
|
|
51
|
+
export type HACCEL = bigint;
|
|
52
|
+
export type HDC = bigint;
|
|
53
|
+
export type HGLOBAL = bigint;
|
|
54
|
+
export type HICON = bigint;
|
|
55
|
+
export type HMENU = bigint;
|
|
56
|
+
export type HOLEMENU = bigint;
|
|
57
|
+
export type IAdviseSink = Pointer;
|
|
58
|
+
export type IFillLockBytes = Pointer;
|
|
59
|
+
export type ILockBytes = Pointer;
|
|
60
|
+
export type IPropertySetStorage = Pointer;
|
|
61
|
+
export type IPropertyStorage = Pointer;
|
|
62
|
+
export type IStorage = Pointer;
|
|
63
|
+
export type ITypeInfo = Pointer;
|
|
64
|
+
export type IUnknown = Pointer;
|
|
65
|
+
export type LPBC = Pointer;
|
|
66
|
+
export type LPCLASSFACTORY = Pointer;
|
|
67
|
+
export type LPCLSID = Pointer;
|
|
68
|
+
export type LPCOLESTR = Pointer;
|
|
69
|
+
export type LPCRECT = Pointer;
|
|
70
|
+
export type LPDATAADVISEHOLDER = Pointer;
|
|
71
|
+
export type LPDATAOBJECT = Pointer;
|
|
72
|
+
export type LPDROPSOURCE = Pointer;
|
|
73
|
+
export type LPDROPTARGET = Pointer;
|
|
74
|
+
export type LPENUMFORMATETC = Pointer;
|
|
75
|
+
export type LPENUMOLEVERB = Pointer;
|
|
76
|
+
export type LPFORMATETC = Pointer;
|
|
77
|
+
export type LPLONG = Pointer;
|
|
78
|
+
export type LPLOCKBYTES = Pointer;
|
|
79
|
+
export type LPLPVOID = Pointer;
|
|
80
|
+
export type LPMESSAGEFILTER = Pointer;
|
|
81
|
+
export type LPMONIKER = Pointer;
|
|
82
|
+
export type LPMSG = Pointer;
|
|
83
|
+
export type LPOLEADVISEHOLDER = Pointer;
|
|
84
|
+
export type LPOLECLIENTSITE = Pointer;
|
|
85
|
+
export type LPOLEINPLACEACTIVEOBJECT = Pointer;
|
|
86
|
+
export type LPOLEINPLACEFRAME = Pointer;
|
|
87
|
+
export type LPOLEINPLACEFRAMEINFO = Pointer;
|
|
88
|
+
export type LPOLEMENUGROUPWIDTHS = Pointer;
|
|
89
|
+
export type LPOLEOBJECT = Pointer;
|
|
90
|
+
export type LPOLESTR = Pointer;
|
|
91
|
+
export type LPOLESTREAM = Pointer;
|
|
92
|
+
export type LPPERSISTSTORAGE = Pointer;
|
|
93
|
+
export type LPPERSISTSTREAM = Pointer;
|
|
94
|
+
export type LPRUNNINGOBJECTTABLE = Pointer;
|
|
95
|
+
export type LPSTGMEDIUM = Pointer;
|
|
96
|
+
export type LPSTORAGE = Pointer;
|
|
97
|
+
export type LPSTREAM = Pointer;
|
|
98
|
+
export type LPUNKNOWN = Pointer;
|
|
99
|
+
export type LPWORD = Pointer;
|
|
100
|
+
export type PHGLOBAL = Pointer;
|
|
101
|
+
export type PMemoryAllocator = Pointer;
|
|
102
|
+
export type PPBC = Pointer;
|
|
103
|
+
export type PPDATAADVISEHOLDER = Pointer;
|
|
104
|
+
export type PPDATAOBJECT = Pointer;
|
|
105
|
+
export type PPENUMFORMATETC = Pointer;
|
|
106
|
+
export type PPENUMOLEVERB = Pointer;
|
|
107
|
+
export type PPIFillLockBytes = Pointer;
|
|
108
|
+
export type PPLOCKBYTES = Pointer;
|
|
109
|
+
export type PPMESSAGEFILTER = Pointer;
|
|
110
|
+
export type PPMONIKER = Pointer;
|
|
111
|
+
export type PPOLEADVISEHOLDER = Pointer;
|
|
112
|
+
export type PPOLESTR = Pointer;
|
|
113
|
+
export type PPIPropertySetStorage = Pointer;
|
|
114
|
+
export type PPIPropertyStorage = Pointer;
|
|
115
|
+
export type PPIStorage = Pointer;
|
|
116
|
+
export type PPRUNNINGOBJECTTABLE = Pointer;
|
|
117
|
+
export type PPVOID = Pointer;
|
|
118
|
+
export type PPWSTR = Pointer;
|
|
119
|
+
export type PSECURITY_DESCRIPTOR = Pointer;
|
|
120
|
+
export type PROPID = number;
|
|
121
|
+
export type PROPVARIANT = Pointer;
|
|
122
|
+
export type PROPVAR_CHANGE_FLAGS = number;
|
|
123
|
+
export type QUERYCONTEXT = Pointer;
|
|
124
|
+
export type REFCLSID = Pointer;
|
|
125
|
+
export type REFFMTID = Pointer;
|
|
126
|
+
export type REFGUID = Pointer;
|
|
127
|
+
export type REFIID = Pointer;
|
|
128
|
+
export type REFPROPVARIANT = Pointer;
|
|
129
|
+
export type SERIALIZEDPROPERTYVALUE = Pointer;
|
|
130
|
+
export type SNB = Pointer;
|
|
131
|
+
export type STGOPTIONS = Pointer;
|
|
132
|
+
export type uCLSSPEC = Pointer;
|
|
133
|
+
export type VARTYPE = number;
|