Comments (4)
Hello @SapientGuardian
std::cin
is not actually a variable (at least for ExVar context) and in general assumes working with streams.
ExVar was just designed for other purposes such as final data as variables or some other const data in memory.
That is,
00007FF844A06070 -> 00007ff8449db0d0 -> data
^^^^^^^^^^^^^^^^
final value at this pointer
See details in #7 and 3F/DllExport#24
Logic of the getVar above was based on getField + our Conari 'native' extension:
-> getField
v
-> -> provider
.Svc
.native(lpProcName)
.t(type)
.Raw.Type.FirstField;
Therefore it will return an wrong pointer because ExVar feature already calculated this as final data by jumping "forward".
I don't remember exactly but more like we don't have special logic for any streams and similar cases in 1.4.
Although for 1.4 you can try at least this:
var cin = l.Svc.getProcAddr(l.Svc.procName("?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A", false));
// now a correct pointer to std::cin stream
I think we need a more elegant ~"Conari way".
But I still can't talk anything specific about some changes/new features/or some releases at least from me due to my health problems and more; However I can try to coordinate some work around my projects and their releases if someone be ready for something.
Thanks for using. Yours,
-- Denis Kuzmin
from conari.
FYI don't forget about aliases which are super useful for C++ (the case of #3). For example:
l.Aliases.Add("cin", "?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A");
then it could be like
_v1 = l.ExVar.DLR.cin<IntPtr>();
_v2 = l.ExVar.get<IntPtr>("cin");
// ...
l.ExVar.get<IntPtr>("class std::basic_istream<char,struct std::char_traits<char>> std::cin");
etc.
from conari.
Thank you for your insights; the getProcAddr method you suggested works perfectly!
from conari.
Conari 1.5 now provides IProvider.addr()
Use it easier,
l.addr("...")
Also note the following,
l.Svc.getProcAddr("...")
l.Svc.native("...")
from conari.
Related Issues (20)
- logo HOT 1
- Speed
- File Not Found HOT 8
- Unmanaged EmitCalli and netstandard2.0 HOT 2
- The BreakPionts Not Work HOT 2
- LoadLibrary/Ex vs Conari. Same memory regions between processes and threads
- Support [Guide to add DllExport attribute to my project] HOT 4
- Failed loading '...': Check used architecture or existence of file.[Error: 126] HOT 5
- The type or namespace name 'DotNet' does not exist HOT 3
- Work with Native C/C++ structures without declaration HOT 1
- Does it support for .net5 sdk? HOT 1
- How to properly use the "NativeStruct" from current Conari Version? HOT 19
- Undecorate functions from C++ compilers HOT 2
- Failed loading '...': Check used architecture or existence of file.[Error: 193]
- Support of .NET libraries
- Incorrect boolean values from unmanaged code HOT 1
- Support of exported variables / constants HOT 2
- IUnknown. COM Interface support
- Aliases for exported-functions and variables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conari.