Home All Groups Group Topic Archive Search About

Pinvoke and Win32 level API permissions

Author
20 Jan 2006 10:27 PM
r

Author
20 Jan 2006 10:55 PM
Willy Denoyette [MVP]
You should not call GetLastError when using PInvoke, the error returned
(1008) is probably not the 'real' value but an intermediate. Use
Marshal.GetLastWin32Error instead.

Willy.


Show quote
"r" <"***@rstrstrst.org"@r> wrote in message
news:Pine.WNT.4.64.0601201619280.2052@PAVPUBYFYNC.erqubhfr.ud...
|
| I have a console based .net 2.0 C# application that fails on a PInvoke
| call to the HrESEBackupPrepare() function in the Exchange backup API.
|
| How can I determine if the failure is due to .NET 2.0 or Windows 2003
| server restricting the permissions of the application?
|
| HrESEBackupPrepare() returns 5
| GetLastError() returns 1008 (0x000003F0)
| FormatMessage returns
| "An attempt was made to reference a token that does not exist"
| 1008 is windows error "ERROR_NO_TOKEN"
|
| Windows Server 2003
| Exchange 2003
|
| I am logged into the machine as a domain administrator and that domain
| administrator is a member of the local backup operators group.
|
| The online doucmentation for HrESEBackupPrepare() doesn't help much
| because it does not explain how to correct this error.
|
| It only lists three lines for errors:
|
|   S_OK - no error
|   ESE specific error code - see esebkmsg.h from the Exchange SDK
|   Other - a Win32 API or RPC error
|
| Google groups contains many questions asking why this api fails but
| almost no responses.
|
Author
23 Jan 2006 4:36 PM
r

AddThis Social Bookmark Button