Hi everyone,
I suppose that my problem would be too simple to most of you but I am currently trying to use NtGetTickCount() in my program to emulate GetTempFileName(). Things are fine until compilation but when I tried to run the program, I am getting a following error which I have not been able to resolve.
‘The procedure entry point NtGetTickCount could not be located in the dynamic link library ntdll.dll’
FYI, I have declared function prototype as follows.
ULONG WINAPI NtGetTickCount(VOID);
Can anyone give me some insight on this?
Thank you very much in advance.
Ilho <><
Use
VOID
KeQueryTickCount(
OUT PLARGE_INTEGER TickCount
);
which is described in the wdk and declared in wdm.h
Christiaan
----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Wednesday, April 25, 2007 10:15 PM
Subject: [ntdev] NtGetTickCount problem
> Hi everyone,
>
> I suppose that my problem would be too simple to most of you but I am currently trying to use NtGetTickCount() in my program to
> emulate GetTempFileName(). Things are fine until compilation but when I tried to run the program, I am getting a following error
> which I have not been able to resolve.
> ‘The procedure entry point NtGetTickCount could not be located in the dynamic link library ntdll.dll’
>
> FYI, I have declared function prototype as follows.
> ULONG WINAPI NtGetTickCount(VOID);
>
> Can anyone give me some insight on this?
> Thank you very much in advance.
>
> Ilho <><
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
xxxxx@trigence.com wrote:
I suppose that my problem would be too simple to most of you but I am currently trying to use NtGetTickCount() in my program to emulate GetTempFileName(). Things are fine until compilation but when I tried to run the program, I am getting a following error which I have not been able to resolve.
‘The procedure entry point NtGetTickCount could not be located in the dynamic link library ntdll.dll’
FYI, I have declared function prototype as follows.
ULONG WINAPI NtGetTickCount(VOID);
Can anyone give me some insight on this?
Yes. It’s not there any more. It’s never been documented, so the fact
that it disappeared is not surprising.
If you are in user mode, why don’t you just call GetTickCount()?
And in what way does GetTickCount “emulate” GetTempFileName?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Thanks for the replies.
I am solely relying on ntdll and thus I am not able to use any of user apis.
I tried to use KeQueryTickCount() but I don’t think I can do that so I will then have to figure out something else.
The reason I needed to use NtGetTickCount() is because I wanted to get some random number for temp file name as follows.
int num = GetTickCount() & 0xffff;
If not GetTickCount(), is there any other function that I can use out of ntdll to get some random number?
Thank you once again.
Ilho <><
I found out that I can use NtQuerySystemTime(). This will also give me some random number with which I can come up with temp filename. Thank you everyone.
Cheers!
Ilho <><
Program? As in user mode? QueryPerformanceFrequency and GetTickCount are
both documented and available.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@trigence.com
Sent: Wednesday, April 25, 2007 4:16 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NtGetTickCount problem
Hi everyone,
I suppose that my problem would be too simple to most of you but I am
currently trying to use NtGetTickCount() in my program to emulate
GetTempFileName(). Things are fine until compilation but when I tried to
run the program, I am getting a following error which I have not been
able to resolve.
‘The procedure entry point NtGetTickCount could not be located in the
dynamic link library ntdll.dll’
FYI, I have declared function prototype as follows.
ULONG WINAPI NtGetTickCount(VOID);
Can anyone give me some insight on this?
Thank you very much in advance.
Ilho <><
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
> I am solely relying on ntdll and thus I am not able to use any of user apis.
Well this is probably the start of your problem. NTDLL contains a number of undocumented APIs and isn’t guaranteed to remain stable from release to release in every area.
Why do you have this requirement? Can you loosen it some and also depend on a low-level Win32 API set like those exposed by kernel32.dll?
-p
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@trigence.com
Sent: Wednesday, April 25, 2007 1:48 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] NtGetTickCount problem
Thanks for the replies.
I am solely relying on ntdll and thus I am not able to use any of user apis.
I tried to use KeQueryTickCount() but I don’t think I can do that so I will then have to figure out something else.
The reason I needed to use NtGetTickCount() is because I wanted to get some random number for temp file name as follows.
int num = GetTickCount() & 0xffff;
If not GetTickCount(), is there any other function that I can use out of ntdll to get some random number?
Thank you once again.
Ilho <><
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Are you programming a “driver” ? KeQueryTickCount() is a “kernel” api , not a “user” api . If you are NOT programming a device
driver , you are posting to a slightly wrong forum …
C.
----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Wednesday, April 25, 2007 10:48 PM
Subject: RE:[ntdev] NtGetTickCount problem
> Thanks for the replies.
> I am solely relying on ntdll and thus I am not able to use any of user apis.
>
> I tried to use KeQueryTickCount() but I don’t think I can do that so I will then have to figure out something else.
>
> The reason I needed to use NtGetTickCount() is because I wanted to get some random number for temp file name as follows.
>
> int num = GetTickCount() & 0xffff;
>
> If not GetTickCount(), is there any other function that I can use out of ntdll to get some random number?
> Thank you once again.
>
> Ilho <><
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
xxxxx@trigence.com wrote:
Thanks for the replies.
I am solely relying on ntdll and thus I am not able to use any of user apis.
Why? That seems like an utterly ridiculous restriction.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
I would guess b/c he is writing a native application (ala chkdsk) that
is running at boot before user mode has been fully initialized
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, April 25, 2007 2:33 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] NtGetTickCount problem
xxxxx@trigence.com wrote:
Thanks for the replies.
I am solely relying on ntdll and thus I am not able to use any of user
apis.
Why? That seems like an utterly ridiculous restriction.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
I *think* you can use kernel32.dll in such an environment. Its only imports are from ntdll.
-p
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, April 25, 2007 3:37 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] NtGetTickCount problem
I would guess b/c he is writing a native application (ala chkdsk) that
is running at boot before user mode has been fully initialized
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, April 25, 2007 2:33 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] NtGetTickCount problem
xxxxx@trigence.com wrote:
Thanks for the replies.
I am solely relying on ntdll and thus I am not able to use any of user
apis.
Why? That seems like an utterly ridiculous restriction.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
I think there’s this whole Kernel mode api you can use to get time.
try:
KeQueryTickCount
KeQueryTimeIncrement http:
KeQueryInterruptTime http:
KeQueryPerformanceCounterhttp:
KeQueryTimeIncrement http:
and I think there are some Rtl… apis to do some further conversions. Look
it up in the DDK.
On 4/26/07, Peter Wieland wrote:
>
> I think you can use kernel32.dll in such an environment. Its only
> imports are from ntdll.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Wednesday, April 25, 2007 3:37 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] NtGetTickCount problem
>
> I would guess b/c he is writing a native application (ala chkdsk) that
> is running at boot before user mode has been fully initialized
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
> Sent: Wednesday, April 25, 2007 2:33 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] NtGetTickCount problem
>
> xxxxx@trigence.com wrote:
> > Thanks for the replies.
> > I am solely relying on ntdll and thus I am not able to use any of user
> apis.
> >
>
> Why? That seems like an utterly ridiculous restriction.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
></http:></http:></http:></http:>
Use kernel32!GetTickCount instead.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> Hi everyone,
>
> I suppose that my problem would be too simple to most of you but I am
currently trying to use NtGetTickCount() in my program to emulate
GetTempFileName(). Things are fine until compilation but when I tried to run
the program, I am getting a following error which I have not been able to
resolve.
> ‘The procedure entry point NtGetTickCount could not be located in the dynamic
link library ntdll.dll’
>
> FYI, I have declared function prototype as follows.
> ULONG WINAPI NtGetTickCount(VOID);
>
> Can anyone give me some insight on this?
> Thank you very much in advance.
>
> Ilho <><
>
What about kernel32 being fully initialized?
I expect it to rely on some data structures (PEB, environment, std handles
or such) which are filled by the parent process’s CreateProcess using
WriteProcessMemory. Is it so or not?
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
“Peter Wieland” wrote in message
news:xxxxx@ntdev…
I think you can use kernel32.dll in such an environment. Its only imports
are from ntdll.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, April 25, 2007 3:37 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] NtGetTickCount problem
I would guess b/c he is writing a native application (ala chkdsk) that
is running at boot before user mode has been fully initialized
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, April 25, 2007 2:33 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] NtGetTickCount problem
xxxxx@trigence.com wrote:
> Thanks for the replies.
> I am solely relying on ntdll and thus I am not able to use any of user
apis.
>
Why? That seems like an utterly ridiculous restriction.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Maxim S. Shatskih wrote:
What about kernel32 being fully initialized?
I expect it to rely on some data structures (PEB, environment, std handles
or such) which are filled by the parent process’s CreateProcess using
WriteProcessMemory. Is it so or not?
But all he’s asking for is GetTickCount. That reads a static dword in
memory – nothing more. It has no external dependencies.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Wow, I did not expect my question will generate this many replies. First of all, I thank all of you for such a great input.
As stated in the previous message, my goal was to get some random number to come up with temp filename so I decided to use NtGetTickCount().
At this point, I am using NtQuerySystemTime() and this may not be as random as it could be but I think that it serves its purpose for me. 
About the work environment, I know that it is not good that I cannot take advantage of other dlls but that is the way it is for now. I am sure many of you have your own restriction.
Have a good one!
Ilho <><
>>As stated in the previous message, my goal was to get some random number
to come up with temp >>filename
Why not just use a random number generator ? Tick counts are hardly " random
" .
On 4/27/07, xxxxx@trigence.com wrote:
>
> Wow, I did not expect my question will generate this many replies. First
> of all, I thank all of you for such a great input.
> As stated in the previous message, my goal was to get some random number
> to come up with temp filename so I decided to use NtGetTickCount().
> At this point, I am using NtQuerySystemTime() and this may not be as
> random as it could be but I think that it serves its purpose for me. 
> About the work environment, I know that it is not good that I cannot take
> advantage of other dlls but that is the way it is for now. I am sure many of
> you have your own restriction.
> Have a good one!
>
> Ilho <><
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
I think the OP meant ‘unique’ not ‘random’…
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of kelvin lim
Sent: Thursday, April 26, 2007 9:15 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] NtGetTickCount problem
>As stated in the previous message, my goal was to get some random
number to come up with temp >>filename
Why not just use a random number generator ? Tick counts are hardly "
random " .
On 4/27/07, xxxxx@trigence.com wrote:
Wow, I did not expect my question will generate this many replies. First
of all, I thank all of you for such a great input.
As stated in the previous message, my goal was to get some random number
to come up with temp filename so I decided to use NtGetTickCount().
At this point, I am using NtQuerySystemTime() and this may not be as
random as it could be but I think that it serves its purpose for me. 
About the work environment, I know that it is not good that I cannot
take advantage of other dlls but that is the way it is for now. I am
sure many of you have your own restriction.
Have a good one!
Ilho <><
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
kernel32 will fail to initialize (i.e. fail DllMain – dead process) when it
can’t connect to CSRSS, in my experience.
–
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
“Peter Wieland” wrote in message
news:xxxxx@ntdev…
I think you can use kernel32.dll in such an environment. Its only imports
are from ntdll.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, April 25, 2007 3:37 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] NtGetTickCount problem
I would guess b/c he is writing a native application (ala chkdsk) that
is running at boot before user mode has been fully initialized
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, April 25, 2007 2:33 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] NtGetTickCount problem
xxxxx@trigence.com wrote:
> Thanks for the replies.
> I am solely relying on ntdll and thus I am not able to use any of user
apis.
>
Why? That seems like an utterly ridiculous restriction.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer