Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "GetLastError" in [All]

ntdll

.

/// <returns>Opposite of boolean.  Zero means success, non-zero means fail and use GetLastError</returns>

msi

.

static extern IntPtr MsiGetLastErrorRecord();

.
Documentation
[MsiGetLastErrorRecord] on MSDN

user32

.

/// <para>If the function fails, the return value is NULL. To get extended error information, call GetLastError.</para>

.

''' <para>If the function fails, the return value is NULL. To get extended error information, call GetLastError.</para>

.

When you call this function, the WndProc function must respond to the WM_NCCREATE message by returning TRUE. If it does not, the creation process will fail. A null handle will be returned from CreateWindowEx and GetLastError will return 0. See MSDN on WM_NCCREATE (http://msdn.microsoft.com/en-us/library/ms632635.aspx) and also WM_CREATE (http://msdn.microsoft.com/en-us/library/ms632619.aspx). You can have your WndProc call DefWindowProc, which will take care of this issue.

.

/// <returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>

.

''' <returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>

.

///     <para>To get extended error information, call GetLastError.</para>

.

If the clipboard is not owned, the return value is NULL. To get extended error information, call GetLastError.

.

Windows NT/2000/XP: To get extended error information, call GetLastError.

.

Windows NT/2000/XP: To get extended error information, call GetLastError.

.

static extern uint GetLastError(TODO);

.

Declare Function GetLastError Lib "kernel32.dll" (TODO) As TODO

.
Documentation
[GetLastError] on MSDN
.

    int nLatError = GetLastError(); // in kernel32.dll

.

/// to the specified window, the return value is NULL. To get extended error information, call GetLastError.

.

/// If the function fails, the return value is zero. To get extended error information, call GetLastError.

.

///     call GetLastError.

.

///     or control handle is invalid, the return value is zero. To get extended error information, call GetLastError.<br />

.

///     <br />To get extended error information, call GetLastError.

.

    ''' <para>If the function fails, the return value is zero. To get extended error information, call GetLastError.</para></returns>

.

MSDN says: If the function fails, the return value is zero. To get extended error information, call GetLastError.

.

///     information, call GetLastError.

.

/// <para>Windows Vista: RemoveProp is subject to the restrictions of User Interface Privilege Isolation (UIPI). A process can only call this function on a window belonging to a process of lesser or equal integrity level. When UIPI blocks property changes, GetLastError will return 5.</para>

.

/// <para>Windows Vista: SetProp is subject to the restrictions of User Interface Privilege Isolation (UIPI). A process can only call this function on a window belonging to a process of lesser or equal integrity level. When UIPI blocks property changes, GetLastError will return 5.</para>

.

/// <returns>If the data handle and string are added to the property list, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>

.

/// If the function fails, the return value is zero. To get extended error information, call GetLastError.

.

///     To get extended error information, call GetLastError.

advapi32

.

If the function cannot find an account name for the SID, the LookupAccountSid function fails and GetLastError returns ERROR_NONE_MAPPED. This can occur if a network time-out prevents the function from finding the name. It also occurs for SIDs that have no corresponding account name, such as a logon SID that identifies a logon session.

.

        aWinErrorCode = (uint)GetLastError();

.

public static void SetFileOrFolderOwner(String objectName) //Note this is very basic and is silent on fail as I havent checked GetlastError and thrown an exception etc

psapi

.

                Console.WriteLine("Call to EnumDeviceDrivers failed!  To get extended error information, call GetLastError.");

.

                Console.WriteLine("Call to EnumDeviceDrivers failed!  To get extended error information, call GetLastError.");

.

                Console.WriteLine("Call to EnumDeviceDrivers failed!  To get extended error information, call GetLastError.");

.

                Console.WriteLine("Call to EnumDeviceDrivers failed!  To get extended error information, call GetLastError.");

Enums

.

    // will fail and GetLastError() will indicate ERROR_PASSWORD_RESTRICTION

.

    ' will fail and GetLastError() will indicate ERROR_PASSWORD_RESTRICTION

.

     /// This value returns <B>FALSE</B>. If you call <see cref="GetLastError"/> to get extended error information, <B>GetLastError</B> returns <B>ERROR_NOT_SUPPORTED</B>.

.

     /// This value returns <B>FALSE</B>. If you call <see cref="GetLastError"/> to get extended error information, <B>GetLastError</B> returns <B>ERROR_NOT_SUPPORTED</B>.

.

     /// This value returns <B>FALSE</B>. If you call <see cref="GetLastError"/> to get extended error information, <B>GetLastError</B> returns <B>ERROR_NOT_SUPPORTED</B>.

.

     /// This value returns <B>FALSE</B>. If you call <see cref="GetLastError"/> to get extended error information, <B>GetLastError</B> returns <B>ERROR_NOT_SUPPORTED</B>.

.

     /// This value returns <B>FALSE</B>. If you call <see cref="GetLastError"/> to get extended error information, <B>GetLastError</B> returns <B>ERROR_NOT_SUPPORTED</B>.

.

     /// This value returns <B>FALSE</B>. If you call <see cref="GetLastError"/> to get extended error information, <B>GetLastError</B> returns <B>ERROR_NOT_SUPPORTED</B>.

Constants

.

One of the many error codes returned by GetLastError, which should not be used within the .NET framework. Instead you must use Marshal.GetLastWin32Error().

.

It is documented that you should NOT use the pinvoke GetLastError() due to the fact that the runtime

rapi

. .

public static extern int CeGetLastError();

.

function info on msdn at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceactsy/html/cerefCeGetLastErrorRAPI.asp

.
Documentation
[CeGetLastError] on MSDN
.

Returns 0 for failure. Use CeGetLastError() and CeRapiGetError() to see errors on failure.

ws2_32

34: send
.

If no error occurs, sendto returns the total number of bytes sent, which can be less than the number indicated by len. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.

.

WSAGetLastError.

35: SendTo
.

If no error occurs, sendto returns the total number of bytes sent, which can be less than the number indicated by len. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.

.

WSAGetLastError.

.

static extern Int32 WSAGetLastError();

.

Declare Function WSAGetLastError Lib "ws2_32.dll" () As Int32

.
Documentation
[WSAGetLastError] on MSDN

winspool

.

As always, only do SetLastError=true if you actually intend to call GetLastError.

.

As always, only do SetLastError=true if you actually intend to call GetLastError.

.

As always, only do SetLastError=true if you actually intend to call GetLastError (This includes throwing a Win32Exception if the call fails)

.

    // If you did not succeed, GetLastError may give more information

wininet

.

Return Values : Returns TRUE if successful, or FALSE otherwise. To get a specific error message, call GetLastError.

.

    [DllImport("wininet.dll", EntryPoint = "GetLastError")]

.

    public static extern long GetLastError();

.

    * Returns a valid handle to the FTP, Gopher, or HTTP session if the connection is successful, or NULL otherwise. To get extended error information, call GetLastError. An application can also use InternetGetLastResponseInfo to determine why access to the service was denied.

gdi32

.

If the function succeeds, the return value is a handle to the newly created device-independent bitmap (and ppvBits will point to the bitmap’s bit values). If the function fails, the return value is NULL (and ptr ppvBits will be NULL). To get extended error information, call GetLastError.

wtsapi32

.

As always, only do SetLastError=true if you actually intend to call GetLastError.

.

/// If the function fails, the return value is zero. To get extended error information, call GetLastError.

.

    /// If the function fails, the return value is zero. To get extended error information, call GetLastError.

userenv

.

Otherwise, if the function fails, the return value is zero. To get extended error information, call GetLastError.

coredll

.

    ''' <returns>Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.</returns>

.

    ''' <returns>Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.</returns>

.

//public static extern int GetLastError();

.

You will need the above ProcessInfo class and may also want to use GetLastError and WaitForSingleObject.

.

Returns true if function succeeds; otherwise, false. To retrieve extended error information, call GetLastError

.
Summary
GetLastError- retrieves the last system error.
.

static extern Int32 GetLastError();

.

Declare Function GetLastError Lib "coredll.dll" () As Int32

.

It is recommended that you do not call the Win32 GetLastError method directly. Because of the way P/Invoke works, the error message may get reset between Win32 calls in your code. Instead, call the Marshal.GetLastWin32Error method, which can be combined with the ever useful Marshal.ThrowExceptionForHR method. See below for an example.

.

Int32 lastError = GetLastError();

.

lastError = GetLastError()

.
Documentation
[GetLastError] on MSDN
.

3 - SYSMEM_FAILED: Change failed. Use GetLastError to get more details.

.

     int error = Marshal.GetLastWin32Error();    // Equivalent to Win32 GetLastError()

.

WAIT_FAILED indicates failure. To get extended error information, call GetLastError.

mpr

.

static extern TODO WNetGetLastErrorA(ref int lpError,ref string lpErrorBuf,int nErrorBufSize,string lpNameBuf,int nNameBufSize);

.

public static extern uint WNetGetLastError(ref int lpError,StringBuilder lpErrorBuf,int nErrorBufSize,StringBuilder lpNameBuf,int nNameBufSize);

.

Declare Function WNetGetLastError Lib "mpr.dll" Alias "WNetGetLastErrorA" (ByRef lpError As Integer, ByVal lpErrorBuf As String, ByVal nErrorBufSize As Integer, ByVal lpNameBuf As String, ByVal nNameBufSize As Integer) As Integer

.
Documentation
[WNetGetLastError] on MSDN

credui

.

    ''' <returns><c>True</c> on success; otherwise <c>False</c>. For extended error information, call the GetLastError() function.</returns>

.

    ''' If the password cannot be decrypted, the function returns FALSE, an a call to the GetLastError function will return the value ERROR_NOT_CAPABLE.</param>

.

    ''' <returns><c>True</c> on success; otherwise <c>False</c>. For extended error information, call the GetLastError() function.</returns>

shell32

.

Do not use GetLastError with the return values of this function.

misc

.

I'd go so far as to recommend always mandating SetLastError -- explicitly setting SetLastError=false, to call out the (comparatively rare) Win32 functions that don't expose a failure path through GetLastError.

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: