Desktop Functions: Smart Device Functions:
|
Search Results for "SID" in [All]dbghelp
static extern bool MiniDumpWriteDump(IntPtr hProcess, uint ProcessId, IntPtr hFile, int DumpType, ref MINIDUMP_EXCEPTION_INFORMATION ExceptionParam, IntPtr UserStreamParam, IntPtr CallbackParam);
static extern bool MiniDumpWriteDump(IntPtr hProcess, uint ProcessId, IntPtr hFile, int DumpType, ref MINIDUMP_EXCEPTION_INFORMATION ExceptionParam,IntPtr UserStreamParam, IntPtr CallbackParam);
static extern uint GetCurrentProcessId();
MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), file.SafeFileHandle.DangerousGetHandle(), MiniDumpWithFullMemory, ref info, IntPtr.Zero, IntPtr.Zero ); winmmThe winmm dll may not execute properly on 64-bit systems. Consequently, the StructLayout must be Sequential, with CharSet = Ansi, and Pack = 4. This particular type has some special layout considerations (the c union keyword) which typically means developers would use the explicit layout. However, the explicit layout breaks down on 64-bit systems for any type with an IntPtr in the type. Consequently, the C# types have been redesigned to use Sequential layout so that they will automatically adjust to 64-bit systems. This means private fields with public properties which perform the gunky work of making it look like there is a union. The winmm dll may not execute properly on 64-bit systems. Consequently, the StructLayout must be Sequential, with CharSet = Ansi, and Pack = 4. This particular type has some special layout considerations (the c union keyword) which typically means developers would use the explicit layout. However, the explicit layout breaks down on 64-bit systems for any type with an IntPtr in the type. Consequently, the C# types have been redesigned to use Sequential layout so that they will automatically adjust to 64-bit systems. This means private fields with public properties which perform the gunky work of making it look like there is a union. xpsprint4: JOA4DUEQG7YUGUDKSCDS574CTKD6PP14CTJ3GI1E10ONP8J5RNBQPG8ELIASBTTWGFPLJBZMO9IT47LQDWG7GJ61GWE8NIU45Q95 TÇÝò'àoün4ªÚB²I´ÛÈZ!l©7Jq¾'¡l¤j Ö&rsiDM(ÅjlöØes«²¼e¶AD¯{gõ¸I¦õ/ÿàËè* &3×v%BO*1ækjM&FÑ{¬ñÕÒ|ÉÆIÏnagâ¶Û:MPÄ/ZJ<ÐG^Ôʱö3ÆÊ;µP;<hN=Á{Ë9TôÌjÛl{¼#:bs½ËU2G©1 ±æó5Jêߺ*ýcXhLýÐï*UÁ;å»wñdAK>§OODñ³føáÄØíåß!°èøï2ó?J3ã·¥¸×æø@tâD]"ÎïlSÉõXɸ26kéáªiQdæ[ getunameInside we both know what's been going on ncrypt6: 2FDP6D1C48HTCOC983I396PJFCK3GZXUOXG114EUQE6M87GSFBNK8Z9FJKGYXTFM1T4DF6G40DW77LORZFAUW2NAYLMBAH806LK1 °âdÎ¼ÐæºÝÕý nqw#6§JÜ ÙÈÁ&ɵBÌ
lÅéA³ë¶9Ìb
7ÿã}×:qÙ ¿µ»bS½AFò'Ó 3$v·¢Á «mØnÚ0ÓzcF¾ß2VÜY õöv&"ó(Èn «uQhþo¶9gæbp
ñËJ°úùãi+¦¬²JlQ¨¿Ó¬ ÉHs[¡GhÄHT6ѵ66Sid¢¤4 üQÿh¡0q\ë##z2[ãòxv¶Y®´Ûoûµ¬ÇÈû,½3Ö.< msi
static extern int MsiDatabaseCommit(IntPtr hDatabase);
Declare Function MsiDatabaseCommit Lib "msi.dll" (TODO) As TODO
static extern int MsiDatabaseOpenView(IntPtr hDatabase, [MarshalAs(UnmanagedType.LPWStr)] string szQuery, out IntPtr phView);
Declare Function MsiDatabaseOpenView Lib "msi.dll" (TODO) As TODO 9: MsiDoAction 10: MsiEnumPathesEx
string szUserSid,
StringBuilder szTargetUserSid,
ref uint pcchTargetUserSid);
StringBuilder szTargetUserSid = new StringBuilder(300);
uint pcchTargetUserSid = 300;
null, // User SID. null needs if context == MachineContext only (4), it means to use only per-machine installations
szTargetUserSid, // User SID. Indicate owner of this installation. (Here is null)
ref pcchTargetUserSid // Length of user SID 11: MsiEnumProducts
string szUserSid,
string szSid,
ref uint pccSid)
string szSid = new string(new char[300]);
uint pccSid = 300;
uint res = MsiInterop.MsiEnumProductsEx(codeToFind, null, (uint)MsiInterop.MSIINSTALLCONTEXT.MSIINSTALLCONTEXT_USERUNMANAGED, 0, code, out junk, szSid, ref pccSid);
string szUserSid,
string szSid,
ref uint pccSid)
string szSid = new string(new char[300]);
uint pccSid = 300;
uint res = MsiInterop.MsiEnumProductsEx(codeToFind, null, (uint)MsiInterop.MSIINSTALLCONTEXT.MSIINSTALLCONTEXT_USERUNMANAGED, 0, code, out junk, szSid, ref pccSid);
String szUserSid, //pass 'null' to omit.
const uint CURRENT_USER_SID = 0;
CURRENT_USER_SID,
// Query that is extended to all per–user-managed installations for the users that szUserSid specifies.
// Query that is extended to all per–user-unmanaged installations for the users that szUserSid specifies. 14: MsiOpenDatabase The documentation specifies a string for the persist parameter, but any calls to MsiDatabaseCommit are ignored unless this call is given an IntPtr with the desired open mode, e.g. (IntPtr)2. The sample application below demonstrates how to use MsiRecordSetString, MsiOpenDatabase, MsiCreateRecord, MsiCloseHandle, MsiDatabaseOpenView, MsiViewExecute, MsiDatabaseCommit, and MsiViewClose in C# to modify a property value in an MSI database. To run it, simply create a new Windows Console application and replace the code that Visual Studio gives you with the code below. You may have to modify the namespace name. The sample as-is requires a valid MSI database named SETUP.msi, with a property named PROPERTY1 in the Property table, to be located in C:\. You can of course change the path to your MSI database in the calls to ChangeMSIProperty() in Main() and use any existing property you wish.
static extern int MsiDatabaseOpenViewW(IntPtr hDatabase, [MarshalAs(UnmanagedType.LPWStr)] string szQuery, out IntPtr phView);
static extern int MsiDatabaseCommit(IntPtr hDatabase);
const int MSIDBOPEN_READONLY = 0; // database open read-only, no persistent changes
const int MSIDBOPEN_TRANSACT = 1; // database read/write in transaction mode
const int MSIDBOPEN_DIRECT = 2; // database direct read/write without transaction
const int MSIDBOPEN_CREATE = 3; // create new database, transact mode read/write
const int MSIDBOPEN_CREATEDIRECT = 4; // create new database, direct mode read/write
int iOpenMode = MSIDBOPEN_DIRECT;
returnValue = (WINDOWS_MESSAGE_CODES)MsiDatabaseOpenViewW(msiHandle, sql, out msiView);
throw new MsiInstallationSupportException(string.Format(CultureInfo.InvariantCulture, "MsiDatabaseOpenViewW returned error code {0}.", returnValue.ToString()));
returnValue = (WINDOWS_MESSAGE_CODES)MsiDatabaseCommit(msiHandle);
throw new MsiInstallationSupportException(string.Format(CultureInfo.InvariantCulture, "MsiDatabaseCommit returned error code {0}.", returnValue.ToString())); winusbInside we both know what's been going on gdiplus
Guid clsid;
if(!GetCodecClsid(filename, out clsid))
st = GdipSaveImageToFile(img, filename, ref clsid, IntPtr.Zero); user32
static extern bool AllowSetForegroundWindow(int dwProcessId);
Shared Function AllowSetForegroundWindow(ByVal dwProcessId As Integer) As Boolean 19: AnimateWindow This assumes that the AnimateWindow function is declared inside class User32 20: ClipCursor
/// <param name="right">Right most side.</param>
/// <param name="bottom">Bottom most side.</param> 21: CreateDesktop Inside we both know what's been going on 23: GetActiveWindow Inside a Windows Form:
//Optional int ProcessID;
//Optional Win32.GetWindowThreadProcessId(GetForegroundWindow(),out ProcessID)
//Optional if( ProcessID == wordProcess.Id ) return ApplicationState.Focused; 25: GetMonitorInfo Consider System.Windows.Forms.Screen.
Private Const UOI_USER_SID = 4
private const int UOI_USER_SID = 4; 27: GetWindow
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
// When you don't want the ProcessId, use this overload and pass IntPtr.Zero for the second parameter
static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);
Private Shared Function GetWindowThreadProcessId(ByVal hwnd As IntPtr, _
ByRef lpdwProcessId As IntPtr) As UInteger
''' <param name="lpdwProcessId">A pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not. </param>
Private Declare Auto Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, _
ByRef lpdwProcessId As Integer) As Integer We can use this API to get ProcessID from Window's Title by combining this function with EnumWindows.
GetWindowThreadProcessId(lngAccessHwnd, lngPid)
Public Declare Auto Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As IntPtr, ByRef lpdwProcessId As IntPtr) As IntPtr
Dim iProcessID As IntPtr
GetWindowThreadProcessId(hOwner, iProcessID)
oResult = Process.GetProcessById(iProcessID.ToInt32)
IntPtr pID = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero); GetWindowThreadProcessId returns the id of the thread that created the target window. To get the process id of a window, use the first c# signature above, and:
int processID = 0;
int threadID = GetWindowThreadProcessId(hWnd, out processID);
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
// When you don't want the ProcessId, use this overload and pass IntPtr.Zero for the second parameter
static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);
Private Shared Function GetWindowThreadProcessId(ByVal hwnd As IntPtr, _
ByRef lpdwProcessId As Integer) As Integer
''' <param name="lpdwProcessId">A pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not. </param>
Private Declare Auto Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, _
ByRef lpdwProcessId As Integer) As Integer We can use this API to get ProcessID from Window's Title by combining this function with EnumWindows.
GetWindowThreadProcessId(lngAccessHwnd, lngPid)
Public Declare Auto Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As IntPtr, ByRef lpdwProcessId As IntPtr) As IntPtr
Dim iProcessID As IntPtr
GetWindowThreadProcessId(hOwner, iProcessID)
oResult = Process.GetProcessById(iProcessID.ToInt32)
IntPtr pID = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero); GetWindowThreadProcessId returns the id of the thread that created the target window. To get the process id of a window, use the first c# signature above, and:
int processID = 0;
int threadID = GetWindowThreadProcessId(hWnd, out processID); 30: IsHungAppWindow تn5ÿ¬QοëaÃα²cÖ»æ*-¬æ¹öÝ5Ä&iÕÙ¯y¹[Vº]Bý9Ú;<"¦õ/nËRù³ëZÔÏf3c³ßY*¹çÁ\Töµ»Å^Ré¿p¼!xÄi%G:eø³3 ÛÜÞ'Îí<h¿bÄ&âè?§ÃÅ öÔÅ´[´'×þ$SÂÂ>W¤K.´T6/ª>£ûÏýómUZ¤M6ÕG7U8§2fSÆ>¼8}1Qù.Ëh»ä%üÉJõ}t¡l«]cÌüvõíÉ(²Ô&ÔxÃÏðNGt8ùûÙ}àiè/òmw3Gaú®iMÎíá/Hö.±ù9@Æ2ÿ1õÑj8ûú¶¸ÎðÄHê«#TÛõ¥Ú2R-4ùëSy qx?ÊöðýRã¤UÍû+ßå9ÛþáQNB%4^xùü3èÝçÆ@wãÿxJáþPîÛÆi L½À!Hx²dý·½5Ó{1L:Ù¨¢ qñÙ¦:B±ÃJËq.5½mÀ ðcëÓp¶9æ8âN`nX¾FÕMÚ¦í+~[Søi]²?@ÁU%Öy($!iôÔ)cÅÈÌ(Åâ÷ñdºÄìvSIDòdI⨽¢ 32: LoadImage
/// <param name="resId">Name of the resource icon that should be loaded.
public static Icon GetIconFromExe(string path = null, string resId = "#32512", int size = 32) {
IntPtr ptr = LoadImage(h, resId, 1, size, size, 0); 33: MessageBeep With the enum beepType you get intellisense when you type "beep." and you can then select the kind of beep you want. For dylan.NET, use the fields containing the integer values inside the WinSnd class of dnu.dll at http://dylandotnetapps.codeplex.com/ 34: MonitorFromRect Consider System.Windows.Forms.Screen class and its FromRectangle. Consider System.Windows.Forms.Screen. 35: MONITORINFO
/// The rest of the area in rcMonitor contains system windows such as the task bar and side bars.
/// By convention, the right and bottom edges of the rectangle are normally considered exclusive.
/// In other words, the pixel whose coordinates are ( right, bottom ) lies immediately outside of the the rectangle. 36: MONITORINFOEX
/// The rest of the area in rcMonitor contains system windows such as the task bar and side bars.
/// By convention, the right and bottom edges of the rectangle are normally considered exclusive.
/// In other words, the pixel whose coordinates are ( right, bottom ) lies immediately outside of the the rectangle. 37: MoveWindow
/// <param name="X">C++ ( X [in]. Type: int )<br />Specifies the new position of the left side of the window.</param>
''' <param name="X">Specifies the new position of the left side of the window.</param> 38: SB_GETTEXT
Int32 processId
private static extern int GetWindowThreadProcessId(
out Int32 lpdwProcessId
StatusBar.GetWindowThreadProcessId(this._handle, out pid); 39: ScreenToClient
/** this takes the POINT, which is using screen coords (0,0 in top left screen) and converts them into coords inside specified window (0,0 from top left of hWnd) **/ 40: SendInput
[testing.windows]::SetForegroundWindow( @( Get-Process notepad |? { $_.id -in @( get-wmiobject win32_process -filter "name='notepad.exe'" |% { if ( $_.getowner().user -eq $env:username ) { $_.processid } } ) } )[0].MainWindowHandle)
/// calling the AllowSetForegroundWindow function. The process specified by dwProcessId loses the ability to set uint foreThread = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero); 42: SetWindowPos
/// <param name="X">C++ ( X [in]. Type: int )<br />The new position of the left side of the window, in client coordinates.</param>
/// hwnd and window manager operations are only effective inside a session and cross-session attempts to manipulate 43: TCITEM
uint ProcessID;
GetWindowThreadProcessId((IntPtr)handle, out ProcessID);
ProcessAccessFlags.VMWrite | ProcessAccessFlags.QueryInformation, false, ProcessID);
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId); 44: TrackMouseEvent
TRACKMOUSEEVENT tme; // Define it on the outside so you dont recreate it each time the mouse enters queryInside we both know what's been going on odbc3246: SQLDataSources
Private Sub OnGetODBCConnectionNames(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbExpSID.DropDown, cmbImpSid.DropDown oleaut3247: GetActiveObject
static extern int GetActiveObject(ref Guid rclsid, IntPtr pvReserved,
static extern void GetActiveObject(ref Guid rclsid, IntPtr pvReserved,
ByRef rclsid As Guid, pvReserved As IntPtr, _ wtsapi32
Console.WriteLine ("Process ID: " & strucProcessInfo.ProcessID)
WTSIdle,
WTSIdle,
WTSIdle
WTSIdle
Case WTS_CONNECTSTATE_CLASS.WTSIdle
static extern bool WTSTerminateProcess(IntPtr hServer, int processId, int exitCode);
WTSIdle, 52: WTS_INFO_CLASS
WTSIdleTime = 17,
WTSIdleTime = 17 53: WTS_PROCESS_INFO
public int ProcessID;
public IntPtr UserSid;
Dim ProcessID As Int32
Dim UserSid As Int32 rapi54: CeCreateProcess
public int dwProcessID; psapi55: EnumProcesses
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.U4)] [In][Out] UInt32[] processIds,
Public Shared Function EnumProcesses(<MarshalAs(UnmanagedType.LPArray, ArraySubType:=UnmanagedType.U4), [In](), [Out]()> ByVal processIds As Integer(), ByVal size As Integer, <[Out]()> ByRef needed As Integer) As Boolean The ArraySubType field for processIds and the entire MarshalAs attribute for bytesCopied are probably unnecessary (since they're the same as the defaults).
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U4)] [In][Out] UInt32[] processIds,
UInt32[] processIds = new UInt32[arraySize];
bool success = EnumProcesses(processIds, arrayBytesSize, out bytesCopied);
Console.WriteLine("ProcessIds[{0}] = {1}", index, processIds[index]);
GetWindowThreadProcessId(hWnd, out pid); werInside we both know what's been going on 58: OX5A33YYDEJIOHWPQQOAQPS15IZ20S2K0S11ZUCFL5GBAAWNU949SKJLRRUET7ZPA4H3OWQP805PF7SPXU9B5LMTOGP9ZO8Q8GBL 70ûKéͺyâÌ|LÌÑç)éHé§EUbÆÝ@NÌ¿BÁVÛ »CP×Þ3[÷9¿(ii¼ÝhÓtĺ´5{;s~.¬`Õ3öøËO(N¨ðî\>ÖwÓµ-·ìq¦¤9ÿSIdD¬ëİÙ&E<Ëçoùø*ø&ÂÖ«GÞyû1>3\à¼Iÿ§ÏDuh.¬peòQ~æe¶j'ìHG73¢ë÷.½Ê˹ÊÂZr¬&äböÞzõ¦¹HôÑM9b! Tét»»éhèIf7~.ÂÙ~HþP?7ã3D1ÀÌa(þª>lѬÁßUÇkí¬¶¡'0n/ó]Á(ªjn}ìITÀ2+F ©ýùÎ¥©aðÐYoÛóÃe¢CÈËvg±«{#KÀö¯Î 7ÕöE¯ ¶HÈÁµVQ£ZîVýqÒ¾AÝVkû$êÎuíBÛ«¥ûÞ.ÿ¨að÷ÕÖå è;ecÅ1nNð"ÓµeüaOµ/Oz¹5JeK¥2êòTÕ{IÆTHàHSCæðZÕC·ÈÆi²#lxÃ7)»s®»©XÏéÄè¾Äÿ#V@©ü÷ÅÀAftPå ò/³j¹;å¿#óeZòëyQ¡Ñº7ø`,½ë%ÖlƪXe°ú¹#ÖÈ.Çø]0¸¶OðÀD8k]O å,Íp§öMX å"Bh9áÙ+AoìhXp³4°ø coredll59: ByRef To pass a variable by value (i.e. any change made to the variable's value within the function/sub will not affect it outside the function/sub.) use ByVal. 60: ByVal To pass a variable by reference (i.e. change the external variable to whatever value is set inside the function/sub) use ByRef before the parameter name. Cut off search results after 60. Please refine your search. |