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 "as" in [All]

odbc32

. .

Do you know one? Please contribute it!

.

Please add some!

. .

Do you know one? Please contribute it!

.

Please add some!

. .

Private Declare Auto Function SQLAllocHandle Lib "odbc32.dll" (ByVal HandleType As Short, ByVal InputHandle As IntPtr, ByRef OutputHandle As IntPtr) As Short

.

Please add some!

.

Please add some!

.

public class SqlLocator

.

Do you know one? Please contribute it!

. .
Summary
SQLAllocStmt allocates memory for a statement handle and associates the statement handle with the connection specified by hdbc.
.

    Private Shared Function SQLAllocStmt(ByVal connectionHandle As IntPtr, <Runtime.InteropServices.Out()> _

.

    ByRef statementHandle As IntPtr) As Short

.

Do you know one? Please contribute it!

.

Please add some!

.

Please add some!

. .

Shared Function SQLBindCol(ByVal StatementHandle As HandleRef, ByVal ColumnNumber As _

.

Short, ByVal TargetType As Short, ByVal TargetValue As HandleRef, ByVal BufferLength As _

.

IntPtr, <Out> ByRef StrLen_or_Ind As IntPtr) As Short

.

//****Show the user a list of all tables in a database****

.

            //Allocate a database connection handle, using the environment handle we allocated earlier

.

            //Connect to the DB, the completed connection string will be passed back

.

Do you know one? Please contribute it!

. .

Declare Function SQLBrowseConnect Lib "odbc32.dll" (TODO) As TODO

.

Do you know one? Please contribute it!

.

Please add some!

.

Please add some!

. .

[DllImport("odbc32.dll", SetLastError=true)]

.

Declare Function SQLColAttribute  Lib "odbc32.dll" (TODO) As TODO

.

Do you know one? Please contribute it!

.

Please add some!

.

Please add some!

. .

[DllImport("odbc32.dll", SetLastError=true)]

.

Declare Function SQLColAttribute  Lib "odbc32.dll" (TODO) As TODO

.

Do you know one? Please contribute it!

.

Please add some!

.

Please add some!

. .

    Private Function SQLConnect(ByVal hDBc As IntPtr, ByVal servername As String, ByVal serverlen As Short, _

.

    ByVal username As String, ByVal userlen As Short, ByVal pwd As String, ByVal pwdlen As Short) As Short

.

Please add some!

.

Do you know one? Please contribute it!

. .

/// SQLDataSources returns information about a data source. This function is implemented solely by the Driver Manager.

.

/// <param name="Description">[Output] Pointer to a buffer in which to return the description of the driver associated with the data source.

.

/// For example, dBASE or SQL Server.</param>

.

static extern short SQLDataSources(IntPtr EnvironmentHandle, short Direction,

.

Declare Function SQLDataSources Lib "odbc32.dll" (ByVal EnvironmentHandle As Integer, ByVal Direction As Short, _

.

    ByVal ServerName As String, ByVal BufferLength1 As Short, ByRef NameLength1Ptr As Short, _

.

    ByVal Description As String, ByVal BufferLength2 As Short, ByRef NameLength2Ptr As Short) As Short

.

MSDN Documentation was sourced for the precise parameter definitions and return values.

.

You must provide an Environment Handle provided by SQLAllocHandle as the first parameter. SQLAllocHandle is a replacement for SQLAllocEnv. When using SQLAllocHandle, you must call SQLSetEnvAttr and set the SQL_ATTR_ODBC_VERSION attribute to SQL_OV_ODBC3 before calling SQLDataSources. You must release Environment handle with SQLFreeHandle at the end.

.

public static List<string> GetOdbcDataSources()

.

    rc = SQLDataSources(sql_env_handle, SQL_FETCH_FIRST, dsn_name, (short)dsn_name.Capacity, ref dsn_name_len, desc_name, (short) desc_name.Capacity, ref desc_len);

.

        rc = SQLDataSources(sql_env_handle, SQL_FETCH_NEXT, dsn_name, (short)dsn_name.Capacity, ref dsn_name_len, desc_name, (short)desc_name.Capacity, ref desc_len);

.

    Private Sub OnGetODBCConnectionNames(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbExpSID.DropDown, cmbImpSid.DropDown

.

    Dim c As ComboBox = sender

.

    Dim hEnv As IntPtr

.

        Dim iNameLen As Short = 0

.

        Dim iNameLen2 As Short = 0

.

        Dim nResult As Short = 0

.

        Dim cDSNBuf(64) As Char

.

        Dim cDescBuf(64) As Char

.

        Dim sDSN As String = New String(cDSNBuf)

.

        Dim sDesc As String = New String(cDescBuf)

.

        Dim Dir As SQLVals = SQLVals.SQL_FETCH_NEXT

.

        Dim i As Integer = 0

.

        nResult = SQLDataSources(hEnv, Dir, sDSN, 64, iNameLen, sDesc, 64, iNameLen2)

.

            nResult = SQLDataSources(hEnv, Dir, sDSN, 64, iNameLen, sDesc, 64, iNameLen2)

.

Do you know one? Please contribute it!

.

        Dim strKeyNames() As String

.

        Dim intKeyValues As Integer

.

        Dim intCount As Integer

.

        Dim key As Microsoft.Win32.RegistryKey

.
Documentation
SQLDataSources, SQLAllocHandle, [SQLAllocEnv] on MSDN
. .
Summary
SQLDisconnect closes the connection associated with a specific connection handle.
.

   connectionHandle As Integer) As Short

.

Please add some!

.

Do you know one? Please contribute it!

. .
Summary
SQLDriverConnect is an alternative API to SQLConnect. The difference is that it can popup the dialog to ask the user for more information about the connection
.

    Private Shared Function SQLDriverConnect(ByVal hdbc As IntPtr, ByVal hwnd As IntPtr, ByVal szConnStrIn As String, _

.

    ByVal cbConnStrIn As Short, ByVal szConnStrOut As Text.StringBuilder, ByVal cbConnStrOutMax As Short, _

.

    <Runtime.InteropServices.Out()> ByRef pbcConnStrOut As Short, ByVal fDriverCompletion As Short) As Short

.

Please add some!

.

        string lastError="";

.

            int bracketPos = err.LastIndexOf("]");

.

            lastError = err.Substring(bracketPos+1).Trim();

.

        return lastError;

.

Do you know one? Please contribute it!

. .

Do you know one? Please contribute it!

.

Please add some!

. .

    Private Shared Function SQLExecDirect(ByVal statementHandle As IntPtr, ByVal statementText As String, _

.

    ByVal textLength As Short) As Short

.

Please add some!

.

Please add some!

.

Do you know one? Please contribute it!

. .

    Private Function SQLFetch(ByVal statementHandle As IntPtr) As Short

.

Do you know one? Please contribute it!

.

Please add some!

. .
Summary
SQLFreeConnect releases a connection handle and frees all memory associated with the handle.
.

Do you know one? Please contribute it!

.

Please add some!

. .

Declare Function SQLFreeEnv Lib "odbc32.dll" (ByVal Handle As IntPtr) As Short

.

Do you know one? Please contribute it!

.

Please add some!

. .
Summary
SQLFreeHandle frees resources associated with a specific environment, connection, statement, or descriptor handle.
.

Declare Function SQLFreeHandle Lib "odbc32.dll" (ByVal HandleType As Short, ByVal InputHandle As IntPtr) As Short

.

Do you know one? Please contribute it!

.

HandleType can be one of four values defined as:

.

Please add some!

.

Please add some!

. .
Summary
SQLFreeStmt stops processing associated with a specific hstmt, closes any open cursors associated with the hstmt, discards pending results and, optionally, frees all resources associated with a statement handle.
.

    Private Shared Function SQLFreeStmt(ByVal statementhandle As IntPtr, ByVal [option] As UShort) As Short

.

Do you know one? Please contribute it!

.

Please add some!

.

Please add some!

. .

    Private Shared Function SQLGetData(ByVal statementHandle As IntPtr, ByVal columnNumber As UShort, _

.

    ByVal targetType As Short, ByVal targetValue As IntPtr, ByVal bufferLength As Integer, _

.

    ByRef strLen_or_Ind As Integer) As Short

.

Do you know one? Please contribute it!

.

Please add some!

. .

Declare Function SQLGetDiagField Lib "odbc32.dll" (TODO) As TODO

.

Please add some!

.

Please add some!

.

Do you know one? Please contribute it!

. .

Declare Function SQLGetDiagRec Lib "odbc32.dll" (ByVal handleType As Short, ByVal statementHandle As IntPtr,

.

    ByVal record As Short, ByVal sqlState As Text.StringBuilder, ByRef nativeError As Integer,

.

    ByVal errorMsg As Text.StringBuilder, ByVal errorMsgMax As Short, ByRef errorMsgLength As Short) As Short

.

Please add some!

.

Please add some!

.

Do you know one? Please contribute it!

. .

    Private Shared Function SQLMoreResults(ByVal statementHandle As IntPtr) As Short

.

Please add some!

.

Please add some!

.

Do you know one? Please contribute it!

. .

Declare Function SQLRowCount Lib "odbc32.dll" (TODO) As TODO

.

Please add some!

.

Please add some!

.

Do you know one? Please contribute it!

. .
Summary
SQLSetEnvAttr sets attributes that govern aspects of environments.
.

[DllImport("odbc32.dll", SetLastError=true)]

.

[DllImport("odbc32.dll", SetLastError=true)]

.

    ByVal henv As IntPtr, _

.

    ByVal attribute As Integer, _

.

    ByVal valuePtr As IntPtr, _

.

    ByVal strLength As Integer ) As Short

.

Simple attributes are passed in the pointer itself, hence the overloaded signature.

.

Please add some!

.

Do you know one? Please contribute it!

. .

ODBC ADO.NET does not support a database independent way to retrieve the tables in a database. That is probably the only excuse to be calling this ODBC C API.

.

Resulting table has prefined columns:

.

    string table_cat   = cmd.GetFieldValue(1); //database name

.
Import
advapi32,credui,gdi32,kernel32,ole32,shell32,user32,glossary,coredll,rasapi32,mpr,netapi32,uxtheme,aygshell,avifil32,crypt32,winscard,secur32,wtsapi32,shlwapi,winspool,oleacc,rapi,oleaut32,winfax,Constants,Delegates,Enums,Interfaces,Structures

wintrust

. .

[DllImport("wintrust.dll", SetLastError=true)]

.

Declare Function AuthentiCode Lib "wintrust.dll" (TODO) As TODO

.

Do you know one? Please contribute it!

.

Please add some!

.

Please add some!

. .

     [MarshalAs(UnmanagedType.LPWStr)]

.

Declare Function IsCatalogFile Lib "wintrust.dll" (TODO) As TODO

.

Do you know one? Please contribute it!

. .

[DllImport("wintrust.dll", ExactSpelling = true, SetLastError = false, CharSet = CharSet.Unicode)]

.

     [In] [MarshalAs(UnmanagedType.LPStruct)] Guid pgActionID,

.

Declare Function WinVerifyTrust Lib "wintrust.dll" (TODO) As TODO

.

    enum WinTrustDataStateAction : uint

.

        HashOnlyFlag = 0x00000200,

.

    class WinTrustFileInfo

.

            pszFilePath = Marshal.StringToCoTaskMemAuto(_filePath);

.

                Marshal.FreeCoTaskMem(pszFilePath);

.

    class WinTrustData

.

        // required: which structure is being passed in?

.

        WinTrustDataStateAction StateAction = WinTrustDataStateAction.Ignore;

.

            FileInfoPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(WinTrustFileInfo)));

.

                Marshal.FreeCoTaskMem(FileInfoPtr);

.

         FileNotSigned = 0x800B0100,         // TRUST_E_NOSIGNATURE - File was not signed

.

         SignatureOrFileCorrupt = 0x80096010,    // TRUST_E_BAD_DIGEST - file was probably corrupt

.

         SubjectCertExpired = 0x800B0101,        // CERT_E_EXPIRED - Signer's certificate was expired

.

         SubjectCertificateRevoked = 0x800B010C,     // CERT_E_REVOKED Subject's certificate was revoked

.

    sealed class WinTrust

.

        [DllImport("wintrust.dll", ExactSpelling = true, SetLastError = false, CharSet = CharSet.Unicode)]

.

            [In] [MarshalAs(UnmanagedType.LPStruct)] Guid pgActionID,

.

CAPICOM [http://msdn2.microsoft.com/en-us/library/ms867087.aspx]

.

I noted that under some cicumstances the destructors are called too early and memory is corrupted, therefore WinVerifyTrust returning FileNotSigned even if the file was actually signed. I recommend replacing the destructors with Dispose() and calling dispose at the end of VerifyEmbeddedSignature().

.

[Michael Zarlenga] First, thank you so much for this code! You saved me a lot of work and time. I also experienced corrupted memory issues (access violation exceptions). The problem is, as soon as you exit the WinTrustData constructor, WinTrustFileInfo can be destroyed, before (or even during) the call into WinVerifyTrust. To explicitly call .Dispose() on WinTrustFileInfo from WinTrustData, you need the object reference held in a scope external to the constructor but then sizeof WinTrustData will be wrong. Long story short, I solved that by instantiating a WinTrustFileInfo object myself and passing that to the WinTrustData constructor to use. I implemented .Dispose() on WinTrustData and WinTrustFileInfo and called them both, myself, after the call to WinVerifyTrust completed:

.
Documentation
.

Working examples: [http://github.com/kg/shootblues/blob/master/SignatureCheck.cs], and [http://stackoverflow.com/a/6597017/640326]

.
Import
credui,advapi32,gdi32,kernel32,ole32,shell32,user32,glossary,coredll,rasapi32,mpr,netapi32,uxtheme,avifil32,aygshell,winscard,crypt32,secur32,wtsapi32,shlwapi,winspool,oleacc,rapi,oleaut32,winfax,odbc32,msi,cards,powrprof,urlmon,Constants,Delegates,Enums,Interfaces,Structures

glu32

. .

    public static extern void gluPerspective(double fovy, double aspect, double zNear, double zFar);

.

    public static extern void gluCylinder(ref object qobj, double baseRadius, double topRadius, double height, int slices, int stacks);

. .

Please add some!

.

Do you know one? Please contribute it!

. .

Declare Function gluErrorString Lib "glu32.dll" (TODO) As TODO

.

Please add some!

.

Please add some!!

.

Do you know one? Please contribute it!

. .

[DllImport("glu32.dll", SetLastError=true)]

.

Please add some!

.

Please add some!

.

Do you know one? Please contribute it!

. .

Please add some!

.

Please add some!

.

Do you know one? Please contribute it!

. .

Please add some!

.

Please add some!

.

Do you know one? Please contribute it!

.
Import
credui,advapi32,gdi32,kernel32,ole32,shell32,user32,glossary,coredll,rasapi32,mpr,netapi32,uxtheme,avifil32,aygshell,winscard,crypt32,secur32,wtsapi32,shlwapi,winspool,oleacc,rapi,oleaut32,winfax,odbc32,msi,cards,powrprof,urlmon,xolehlp,twain_32,winmm,wininet,comdlg32,imm32,ntdsapi,odbccp32,opengl32,mapi32,Constants,Delegates,Enums,Interfaces,Structures

wininet

. .
Summary
Removes the file that is associated with the source name from the cache, if the file exists
.

        SetLastError = true,

.

      SetLastError:=True, _

.

    ByVal lpszUrlName As IntPtr) As Boolean

.

Please add some!

.
Documentation
. .
Summary
Releases the specified GROUPID and any associated state in the cache index file
.

    [DllImport(@"wininet", SetLastError = true, CharSet = CharSet.Auto, EntryPoint = "DeleteUrlCacheGroup", CallingConvention = CallingConvention.StdCall)]

.

       SetLastError:=True, _

.

    ByVal GroupId As Long, _

.

    ByVal dwFlags As Int32, _

.

    ByVal lpReserved As IntPtr) As Boolean

.

Please add some!

.
Documentation
. .

[DllImport(@"wininet",SetLastError=true,CharSet=CharSet.Auto,EntryPoint="FindFirstUrlCacheEntryA",CallingConvention=CallingConvention.StdCall)]

.

public static extern IntPtr FindFirstUrlCacheEntry([MarshalAs(UnmanagedType.LPTStr)] string lpszUrlSearchPattern,IntPtr lpFirstCacheEntryInfo,ref int lpdwFirstCacheEntryInfoBufferSize);

.

       SetLastError:=True, _

.

    <MarshalAs(UnmanagedType.LPStr)> ByVal lpszUrlSearchPattern As String, _

.

     ByVal lpFirstCacheEntryInfo As IntPtr, _

.

     ByRef lpdwFirstCacheEntryInfoBufferSize As Int32) As IntPtr

.

Please add some!

.
Documentation
. .

<DllImport("wininet.dll", SetLastError:=True, _

.

    ByVal dwFlags As Int32, _

.

    ByVal dwFilter As Integer, _

.

    ByVal lpSearchCondition As IntPtr, _

.

    ByVal dwSearchCondition As Int32, _

.

    ByRef lpGroupId As Long, _

.

    ByVal lpReserved As IntPtr) As IntPtr

.

Please add some!

.
Documentation
. .

    [DllImport("wininet.dll", SetLastError=true, CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]

.

        SetLastError:=True, _

.

        ByVal hFind As IntPtr, _

.

        ByVal lpNextCacheEntryInfo As IntPtr, _

.

        ByRef lpdwNextCacheEntryInfoBufferSize As Integer) As Boolean

.

Please add some!

.
Documentation
. .

       SetLastError:=True, _

.

    ByVal hFind As IntPtr, _

.

    ByRef lpGroupId As Long, _

.

    ByVal lpReserved As IntPtr) As Boolean

.

Please add some!

.
Documentation
. .

[DllImport("wininet.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]

.

[MarshalAs(UnmanagedType.Bool)] bool fExpectResponse,

.

[MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszCommand,

.

(ByVal hFtpSession As IntPtr, _

.

<MarshalAs(UnmanagedType.Bool)> ByVal fExpectResponse As Boolean, _