-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create toolhelp32 snapshot #101
Conversation
ok I noticed tha i'm missing the return info |
how or where I should define constats from the MSDN docs? |
Current coverage is 97.35%
|
@@ -39,6 +39,13 @@ BOOL WINAPI TerminateProcess( | |||
_In_ UINT uExitCode | |||
); | |||
|
|||
//https://msdn.microsoft.com/en-us/ms682489 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: one space after //
thx for the comments will check |
To answer your questions:
The return data type in the docs or something else? If it's the return data type you're after the comment I made in the review should help.
Here - Overall the code looks good, thanks! There's only a couple of things left to address I think other than the comments in the review:
|
pushing |
I was wrong i mean parameters like this
|
Are you asking how you define them in the headers or how to you use them once they are defined? |
errr yes if I need to define them |
They need to be defined in the constants.h header I referenced up above. |
ok thx |
but how I set the value eg 0x8000000? |
The development documentation covers this: https://pywincffi.readthedocs.io/en/0.2.0/dev/functions.html#adding-new-constants The |
thx! |
are the test correctly writen? |
def test_get_proces_list(self): | ||
_, library = dist.load() | ||
|
||
handle = CreateToolhelp32Snapshot(library.SNAPPROCESS, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this should be TH32CS_SNAPPROCESS
.
One last request which I forgot to mention earlier, could you please make sure to update the changelog under the 'latest' version? |
sry but i think that this job is to much pro for me... |
There's code in test_terminates_process, which is a few lines above your code, which runs a process and terminates it. Once the process has terminated you could use the pid of the dead process in your test which should be invalid because it no longer exists. |
Run the test gives me this :
I have tryed with 3 as pid, its valid invalid? |
Alright...so after a bit of research I can't get it to raise WindowsAPIError even if I create a process, terminate it, and then feed the terminated process's pid to your function. Guess that's the expected behavior. Sorry for misleading you. Ok, so all that's left for this PR is:
|
done and thak you so much for your patience :) |
Looks like there are some lint issues to resolve still:
Looks like you either need to add or remove a blank line from the end of that file. Do that then run test.bat locally to see if it passes. |
Looks good, thanks! Unless you have objections I think this is ready to merge. |
Going to go ahead and merge this so I can get a release going. |
I have a question
How do you determine in line 260 of process.py the data type?
pls let me know if the PR is ok
thx