--- /dev/null
+==============================================================\r
+= =\r
+= NOTES FROM THE UNDERGROUND =\r
+= =\r
+==============================================================\r
+Below are some of Alex's notes on the mysterious LPC Subsystem\r
+\r
+=========================\r
+1. Sizes, sizes, sizes...\r
+=========================\r
+\r
+There are four imporant LPC Sizes to keep in mind. Try to understand them:\r
+\r
+/* \r
+ * This determines the absolute maximum message size (0x100 bytes). For\r
+ * larger values, use a section-backed message.\r
+ */\r
+#define PORT_MAXIMUM_MESSAGE_LENGTH 256\r
+\r
+/*\r
+ * This determines the maximum length of an LPC request. It is the largest\r
+ * amount of bytes that an LPC request can take. To calculate this, assume\r
+ * that this is a CONNECTION_REQUEST message, which includes the additionnal\r
+ * LPCP_CONNECTION_MESSAGE structure as well. Therefore, we add the kernel LPC,\r
+ * header, the maximum port size and the size of the connection request \r
+ * structure. This gives a value of 0x15C. However, one must note that NT\r
+ * allocates the Lookaside List using a 16-byte aligned value, making this\r
+ * number 0x160.\r
+ */\r
+#define LPCP_MAX_MESSAGE_SIZE ROUND_UP(PORT_MAXIMUM_MESSAGE_LENGTH + \\r
+ sizeof(LPCP_MESSAGE) + \\r
+ sizeof(LPCP_CONNECTION_MESSAGE), 16)\r
+\r
+/*\r
+ * Now, for an actual LPC Request size, we remove the kernel LPC header, which\r
+ * yields the size of the actual LPC Data that follows the Header, making this\r
+ * number 0x148.\r
+ */\r
+#define LPC_MAX_MESSAGE_LENGTH (LPCP_MAX_MESSAGE_SIZE - \\r
+ FIELD_OFFSET(LPCP_MESSAGE, Request))\r
+\r
+/*\r
+ * Finally, we'll calculate the maximum size of the Connection Info, giving us\r
+ * 0x104\r
+ */\r
+#define LPC_MAX_DATA_LENGTH (LPC_MAX_MESSAGE_LENGTH - \\r
+ sizeof(PORT_MESSAGE) - \\r
+ sizeof(LPCP_CONNECTION_MESSAGE))\r
+\r
+==========================\r
+2. Structures\r
+==========================\r
+SOON. TODO.
\ No newline at end of file