Comparing version 2.4.3 to 2.4.4
@@ -5,2 +5,11 @@ # Change Log | ||
## [2.4.4](https://github.com/waitingsong/node-win32-def/compare/v2.4.3...v2.4.4) (2019-02-22) | ||
### Features | ||
* export FModel.Buffer as alias of FModel.FFIBuffer ([0285dcc](https://github.com/waitingsong/node-win32-def/commit/0285dcc)) | ||
<a name="2.4.3"></a> | ||
@@ -7,0 +16,0 @@ ## [2.4.3](https://github.com/waitingsong/node-win32-def/compare/v2.4.2...v2.4.3) (2019-02-21) |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 2.4.3 | ||
* @version 2.4.4 | ||
* @author waiting | ||
@@ -129,3 +129,3 @@ * @license MIT | ||
// convert param like ['_WIN64_HOLDER_', 'int64', 'int32] to 'int64' or 'int32' | ||
function parse_placeholder_arch(param, _WIN64$$1) { | ||
function parse_placeholder_arch(param, _WIN64) { | ||
if (typeof param === 'string') { | ||
@@ -137,6 +137,6 @@ return param | ||
} | ||
return _WIN64$$1 ? param[1] : param[2] | ||
return _WIN64 ? param[1] : param[2] | ||
} | ||
// convert param like ['_UNICODE_HOLDER_', 'uint16*', 'uint8*'] to 'uint16*' or 'uint8*' | ||
function parse_placeholder_unicode(param, _UNICODE$$1) { | ||
function parse_placeholder_unicode(param, _UNICODE) { | ||
if (typeof param === 'string') { | ||
@@ -148,3 +148,3 @@ return param | ||
} | ||
return _UNICODE$$1 ? param[1] : param[2] | ||
return _UNICODE ? param[1] : param[2] | ||
} | ||
@@ -151,0 +151,0 @@ /** |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 2.4.3 | ||
* @version 2.4.4 | ||
* @author waiting | ||
@@ -125,3 +125,3 @@ * @license MIT | ||
// convert param like ['_WIN64_HOLDER_', 'int64', 'int32] to 'int64' or 'int32' | ||
function parse_placeholder_arch(param, _WIN64$$1) { | ||
function parse_placeholder_arch(param, _WIN64) { | ||
if (typeof param === 'string') { | ||
@@ -133,6 +133,6 @@ return param | ||
} | ||
return _WIN64$$1 ? param[1] : param[2] | ||
return _WIN64 ? param[1] : param[2] | ||
} | ||
// convert param like ['_UNICODE_HOLDER_', 'uint16*', 'uint8*'] to 'uint16*' or 'uint8*' | ||
function parse_placeholder_unicode(param, _UNICODE$$1) { | ||
function parse_placeholder_unicode(param, _UNICODE) { | ||
if (typeof param === 'string') { | ||
@@ -144,3 +144,3 @@ return param | ||
} | ||
return _UNICODE$$1 ? param[1] : param[2] | ||
return _UNICODE ? param[1] : param[2] | ||
} | ||
@@ -147,0 +147,0 @@ /** |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 2.4.3 | ||
* @version 2.4.4 | ||
* @author waiting | ||
@@ -8,0 +8,0 @@ * @license MIT |
@@ -26,25 +26,51 @@ /// <reference types="node" /> | ||
export interface FFIBuffer extends Buffer { | ||
/** Shorthand for `ref.address`. */ | ||
address(): number; | ||
/** Shorthand for `ref.deref`. */ | ||
deref(): any; | ||
/** Shorthand for `ref.isNull`. */ | ||
isNull(): boolean; | ||
/** Shorthand for `ref.readCString`. */ | ||
readCString(offset?: number): string; | ||
/** Shorthand for `ref.readInt64BE`. */ | ||
readInt64BE(offset?: number): string; | ||
/** Shorthand for `ref.readInt64LE`. */ | ||
readInt64LE(offset?: number): string; | ||
/** Shorthand for `ref.readObject`. */ | ||
readObject(offset?: number): string; | ||
/** Shorthand for `ref.readPointer`. */ | ||
readPointer(offset?: number): string; | ||
/** Shorthand for `ref.readUInt64BE`. */ | ||
readUInt64BE(offset?: number): string; | ||
/** Shorthand for `ref.readUInt64LE`. */ | ||
readUInt64LE(offset?: number): string; | ||
/** Shorthand for `ref.ref`. */ | ||
ref(): FFIBuffer; | ||
/** Shorthand for `ref.reinterpret`. */ | ||
reinterpret(size: number, offset?: number): FFIBuffer; | ||
/** Shorthand for `ref.reinterpretUntilZeros`. */ | ||
reinterpretUntilZeros(size: number, offset?: number): FFIBuffer; | ||
/** Shorthand for `ref.writeCString`. */ | ||
writeCString(offset: number, input: string, encoding?: string): void; | ||
/** Shorthand for `ref.writeInt64BE`. */ | ||
writeInt64BE(offset: number, input: number | string): any; | ||
/** Shorthand for `ref.writeInt64LE`. */ | ||
writeInt64LE(offset: number, input: number | string): any; | ||
/** Shorthand for `ref.writeObject`. */ | ||
writeObject(offset: number, object: Object): void; | ||
/** Shorthand for `ref.writePointer`. */ | ||
writePointer(offset: number, pointer: FFIBuffer): void; | ||
/** Shorthand for `ref.writeUInt64BE`. */ | ||
writeUInt64BE(offset: number, input: number | string): any; | ||
/** Shorthand for `ref.writeUInt64LE`. */ | ||
writeUInt64LE(offset: number, input: number | string): any; | ||
/** | ||
* Generate string for inspecting. | ||
* String includes the hex-encoded memory address of the Buffer instance. | ||
*/ | ||
inspect(): string; | ||
/** add by waiting. below extened via Buffer.prototype by ref.js */ | ||
hexAddress(): string; | ||
} | ||
export { FFIBuffer as Buffer, }; | ||
export declare type PID = number; | ||
@@ -51,0 +77,0 @@ export declare type PPID = number; |
{ | ||
"name": "win32-def", | ||
"author": "waiting", | ||
"version": "2.4.3", | ||
"version": "2.4.4", | ||
"description": "win32 definitions for node-ffi", | ||
@@ -50,3 +50,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@waiting/shared-core": "^1.3.0", | ||
"@waiting/shared-core": "^1.3.1", | ||
"rxjs": "^6.4.0" | ||
@@ -53,0 +53,0 @@ }, |
@@ -58,8 +58,8 @@ # win32-def | ||
const knl32 = K.load() | ||
const buf = <FM.FFIBuffer> Buffer.alloc(4) // ← here the types | ||
const buf = <FM.Buffer> Buffer.alloc(4) // ← here the types | ||
buf.writeInt32LE(12345, 0) | ||
// const hInstance =<W.FFIBuffer> Buffer.alloc(process.arch === 'x64' ? 8 : 4); | ||
const hInstance = <FM.FFIBuffer> ref.alloc(W.HINSTANCE) // W.HINSTANCE is 'int64*' under x64, 'int32*' under ia32 | ||
// const hInstance =<FM.Buffer> Buffer.alloc(process.arch === 'x64' ? 8 : 4); | ||
const hInstance = <FM.Buffer> ref.alloc(W.HINSTANCE) // W.HINSTANCE is 'int64*' under x64, 'int32*' under ia32 | ||
knl32.GetModuleHandleExW(0, null, hInstance) | ||
@@ -66,0 +66,0 @@ ``` |
@@ -58,8 +58,8 @@ # win32-def | ||
const knl32 = K.load() | ||
const buf = <FM.FFIBuffer> Buffer.alloc(4) // ← here the types | ||
const buf = <FM.Buffer> Buffer.alloc(4) // ← here the types | ||
buf.writeInt32LE(12345, 0) | ||
// const hInstance =<W.FFIBuffer> Buffer.alloc(process.arch === 'x64' ? 8 : 4); | ||
const hInstance = <FM.FFIBuffer> ref.alloc(W.HINSTANCE) // W.HINSTANCE is 'int64*' under x64, 'int32*' under ia32 | ||
// const hInstance =<FM.Buffer> Buffer.alloc(process.arch === 'x64' ? 8 : 4); | ||
const hInstance = <FM.Buffer> ref.alloc(W.HINSTANCE) // W.HINSTANCE is 'int64*' under x64, 'int32*' under ia32 | ||
knl32.GetModuleHandleExW(0, null, hInstance) | ||
@@ -66,0 +66,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133486
2848
Updated@waiting/shared-core@^1.3.1