Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Windows DLL function doesn't update structure while Linux so does

I'm trying design a cross-platform c code. Inside my code, I call a dll/so library and use functions inside. While I managed to Load the library and access the functions in windows, I'm facing another problem which I don't understand... One of the functions inside the library does take a struct variable as an argument and update it based on another argument. the function doesn't return any value but update the structure variable properly in linux. However, in Windows it doesn't do anything. Below is how my code looks like. Unfortunately, I can't look inside the dll code. Since other functions works fine, I know I'm calling the library and functions correctly... I know the below code doesn't contain much information but that's all I can show at the moment... :( I'm guessing it might be due to different memory handling mechanism(if any) between windows and linux. Any idea will be appriciated!!!.

MYSTRUCT *mypointer;
MYSTRUCT mymodel;
*mypointer=&mymodel;
updatestruct((char*)mypointer, name, value);

Comments