Solved

DLL Locked whn run as service.

Posted on 2001-07-30
12
796 Views
Last Modified: 2007-11-27
Hi All,

I had a weird problem like I run my application as service(Automatic) on WIN2k,and when I reboot my m/e the application is running fine as service..automatically.
But for some reason..it's locking the DLL's that it is using....I cannot run any other application that share the same DLL'/s.it gives the error 0x0000142(which is ERROR_DRIVE_BUSY).

can somebody throw some light on the problem.

Thanks a million in advance.

Leo.
0
Comment
Question by:Leo01
  • 7
  • 4
12 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6335697
0x0000142 is *NOT* 'ERROR_DRIVE_BUSY', which is '142' in decimal. Your error code is 322d, and there's no corresponding Win32 error code - where do you get it from?
0
 
LVL 86

Expert Comment

by:jkr
ID: 6335708
Well, it's more likely to be

//
// MessageId: STATUS_DLL_INIT_FAILED
//
// MessageText:
//
//  {DLL Initialization Failed}
//  Initialization of the dynamic link library %hs failed. The process is terminating abnormally.
//
#define STATUS_DLL_INIT_FAILED           ((NTSTATUS)0xC0000142L)

Could you paste the code of your 'DllMain()'?
0
 
LVL 86

Expert Comment

by:jkr
ID: 6335725
>>Could you paste the code of your 'DllMain()'?

Sorry, this should of course be

"Could you post the code of your 'DllMain()'?"

:o)
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:Leo01
ID: 6335881
Yeah...the message is 0xc0000142..."the application failed to initialize".
You are right..JKR..I was looking at the wrong message...
The DLL is the "FOXDLL"...which I use for building the UserInterface.
0
 

Author Comment

by:Leo01
ID: 6335903
Yeah...the message is 0xc0000142..."the application failed to initialize".
You are right..JKR..I was looking at the wrong message...
The DLL is the "FOXDLL"...which I use for building the UserInterface.
0
 

Author Comment

by:Leo01
ID: 6335926
Yeah...the message is 0xc0000142..."the application failed to initialize".
You are right..JKR..I was looking at the wrong message...
The DLL is the "FOXDLL"...which I use for building the UserInterface.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6335957
So, could you post the code of your 'DllMain()' function?

Without that, we could just guess...
0
 
LVL 86

Expert Comment

by:jkr
ID: 6335977
BTW: An option might be to set a specific user account for your service (other than 'LocalSystem', which is used by default). You can set that in your service's options in the MMC.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6348479
Well, anything new?
0
 

Author Comment

by:Leo01
ID: 6348538
well...news is I'm on vacation..I'll post the code as soon as I get to work on 8th August....thanks for your interst JKR...
if I have a chance..in the mean time...I'll do it...but does the API's have a "main"???


Thanks,
Leo
0
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6348550
>>but does the API's have a "main"???

DLLs always have a 'DllMain()':

DllMain
The DllMain function is an optional method of entry into a dynamic-link library (DLL). If the function is used, it is called by the system when processes and threads are initialized and terminated, or upon calls to the LoadLibrary and FreeLibrary functions.

DllMain is a placeholder for the library-defined function name. Earlier versions of the SDK documentation used DllEntryPoint as the entry-point function name. You must specify the actual name you use when you build your DLL. For more information, see the documentation included with your development tools.

BOOL WINAPI DllMain(
  HINSTANCE hinstDLL,  // handle to DLL module
  DWORD fdwReason,     // reason for calling function
  LPVOID lpvReserved   // reserved
);
 
0
 
LVL 11

Expert Comment

by:griessh
ID: 6840313
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "jkr" comment(s) as an answer. If you found your solution you could post it here and get your points refunded.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mixing C++ & C# in Vis Studio 2013 7 202
c++ syntax question 9 52
How can i compile this github project?? 2 91
c++, dynamic object by json 1 53
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question