[PATCH 1/4] dlls/ntdll: Add handle count to NtQuerySystemInformation

Austin Lund austin.lund at gmail.com
Mon Jun 20 06:28:05 CDT 2011


On 20 June 2011 15:08, Vitaliy Margolen <wine-devel at kievinfo.com> wrote:
> On 06/19/2011 08:15 PM, Austin Lund wrote:
>>
>> +                    ret = wine_server_call( req );
>> +                    shi->Count += reply->handles;
>> +                    len = sizeof(SYSTEM_HANDLE_ENTRY)*shi->Count +
>> sizeof(ULONG);
>> +                    shi = RtlReAllocateHeap(GetProcessHeap(),
>> HEAP_ZERO_MEMORY, shi, len);
>
> Please do allocations outside of server call block. And add handling of
> failed realloc. Also please double the allocated size, don't reallocate
> after each server call.
>
>> +                    for (i = shi->Count - reply->handles; i<  shi->Count;
>> i++) {
>> +                        shi->Handle[i].OwnerPid = reply->pid;
>> +                    }
>
> Please follow file's curly braces style - none for single line blocks, or on
> separate line for multi-line blocks.
>

Thanks for the review.  Does this patch address these concerns correctly?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dlls-ntdll-Add-handle-count-to-NtQuerySystemInformat.patch
Type: text/x-patch
Size: 4883 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110620/b8dc6ccb/attachment-0001.bin>


More information about the wine-devel mailing list