다음을 통해 공유


PREfast Warning 331 (Windows CE 5.0)

Send Feedback

331 - Invalid parameter.
Additional Information: Passing MEM_RELEASE and MEM_DECOMMIT in conjunction to <function> is not allowed.

This message indicates that PREfast has found an invalid parameter being passed to VirtualFree or VirtualFreeEx.

VirtualFree and VirtualFreeEx both reject the flags (MEM_RELEASE | MEM_DECOMMIT) in combination.

The dwFreeType parameter is a type of free operation. This parameter can be one of the following values: MEM_DECOMMIT or MEM_RELEASE.

It is not necessary for the decommit and release to happen as independent steps. Releasing committed memory decommits the pages as well.

Be sure the return value of this function is not ignored.

Example

Defective Source

VirtualFree(NULL,
            0,
            MEM_DECOMMIT | MEM_RELEASE);

Corrected Source

VirtualFree(NULL,
            0,
            MEM_RELEASE);

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.