OpaqueRawPointer[addr]
represents an untyped pointer to the memory address addr.
OpaqueRawPointer
OpaqueRawPointer[addr]
represents an untyped pointer to the memory address addr.
Details
- RawPointer can be used to represent typed pointers.
- OpaqueRawPointer[ptr] can be used to cast a pointer to an untyped pointer.
- Information for an OpaqueRawPointer may include the following properties:
-
"Address" memory address - Properties can be accessed with OpaqueRawPointer[…][prop].
- Properties that can be extracted include all Information properties listed above.
Examples
open all close allBasic Examples (1)
Scope (1)
Information (1)
Get the pointer to a function in a library:
ptr = ForeignPointerLookup["compilerDemoBase", "addone"]Get Information about the pointer:
Information[ptr]Get the memory address of the pointer:
ptr["Address"]Properties & Relations (3)
NullRawPointerQ returns True if an opaque raw pointer has 0 as its address:
NullRawPointerQ[OpaqueRawPointer[0]]Get the pointer to a function in a library:
opaqueRawPtr = ForeignPointerLookup["compilerDemoBase", "addone"]Convert an OpaqueRawPointer into a RawPointer:
rawPtr = RawPointer[opaqueRawPtr, "UnsignedInteger8"]Convert the raw pointer back to an OpaqueRawPointer:
OpaqueRawPointer[rawPtr]Create a foreign callback function:
cbFun = CreateForeignCallback[EchoEvaluation[# ^ 2]&, {"CLong"} -> "CLong"]cbFun["Value"]["FunctionPointer"]Possible Issues (1)
OpaqueRawPointer returns a Failure for invalid memory addresses:
OpaqueRawPointer["0xAABBCC"]See Also
RawPointer NullRawPointerQ ForeignPointerLookup ForeignCallback
Compiled Types: OpaqueRawPointer
Tech Notes
Related Guides
History
Text
Wolfram Research (2023), OpaqueRawPointer, Wolfram Language function, https://reference.wolfram.com/language/ref/OpaqueRawPointer.html.
CMS
Wolfram Language. 2023. "OpaqueRawPointer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OpaqueRawPointer.html.
APA
Wolfram Language. (2023). OpaqueRawPointer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OpaqueRawPointer.html
BibTeX
@misc{reference.wolfram_2026_opaquerawpointer, author="Wolfram Research", title="{OpaqueRawPointer}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/OpaqueRawPointer.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_opaquerawpointer, organization={Wolfram Research}, title={OpaqueRawPointer}, year={2023}, url={https://reference.wolfram.com/language/ref/OpaqueRawPointer.html}, note=[Accessed: 13-June-2026]}