Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3665
Number of posts: 9109

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
problem with getprocaddress in service Posted by vv40in on 23 Mar 2011 at 2:27 AM
Hello!
For example, i have a little function in dll:
void dll_func(){
char buf[32];
char* p = "qwerty";
strcpy(buf,p);
// or
GetLastError();
}

I call GetProcAddress("dll_func") and call got function.
If it happened in nonservice application, then dll_func works OK.
But if service calls dll_func, then it get access violation in strcpy.
In service debug window I see that [p = "qwerty";] - is unreadable pointer.
The same if dll_func contains only GetLastError() call - it get access violation.
I suspect that dll data segment was loaded incorrectly or did not loaded at all when dll was loaded fom service.
Anybody, could you help me!




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.